Created
July 27, 2019 03:34
-
-
Save debxp/87a342e124915d56669cda1f132215b9 to your computer and use it in GitHub Desktop.
Script para circular entre espaços de trabalho e exibir o espaço de trabalho atual no plugin Monitor Genérico do Xfce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
IDESKTOP=$(xdotool get_desktop) # índice do desktop atual | |
NDESKTOP=$(xdotool get_num_desktops) # número de desktops | |
desk_next() { | |
xdotool set_desktop --relative 1 | |
xfce4-panel --plugin-event=genmon-1:refresh:bool:true | |
} | |
desk_prev() { | |
[[ $(($IDESKTOP - 1)) -lt 0 ]] \ | |
&& p=$(( $NDESKTOP - 1 )) \ | |
|| p=$(( $IDESKTOP - 1 )) | |
xdotool set_desktop $p | |
xfce4-panel --plugin-event=genmon-1:refresh:bool:true | |
} | |
desk_current() { | |
echo "<txt>$(($IDESKTOP + 1))</txt>" | |
echo "<txtclick>xdotool key ctrl+alt+d</txtclick>" | |
echo "<tool></tool>" | |
} | |
case $1 in | |
"next") desk_next | |
;; | |
"prev") desk_prev | |
;; | |
*) desk_current | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment