17 lines
350 B
Bash
Executable File
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}"
|
|
|