Files
mabox-tools/bin/lookat
2026-01-26 17:03:18 +01:00

17 lines
350 B
Bash
Executable File

#!/bin/bash
# lookat(Desktop) - switch to desktop, if repeated switch back.
# Replacement for GoToDesktop Openbox action.
LD_FILE=~/.cache/.lastdesk
curdesk=$(wmctrl -d |grep '*' | awk '{print $1}')
todesk=$((${1} - 1))
if [[ "${curdesk}" == "${todesk}" ]];then
todesk=$(< "$LD_FILE")
else
echo "${curdesk}" > "$LD_FILE"
fi
wmctrl -s "${todesk}"