Skip to content

Instantly share code, notes, and snippets.

@astatide
Created November 21, 2016 06:08
Show Gist options
  • Save astatide/4291aba37a8a35c54a71ac60134e0516 to your computer and use it in GitHub Desktop.
Save astatide/4291aba37a8a35c54a71ac60134e0516 to your computer and use it in GitHub Desktop.
1 #! /bin/bash
2 #set -x
3
4 if [[ $1 == 'R' ]]; then
5 wmctrl -s $(wmctrl -d | grep \* | awk '{print $1+1}')
6 fi
7 if [[ $1 == 'L' ]]; then
8 CURRENT=$(wmctrl -d | grep \* | awk '{print $1}')
9 if [[ $CURRENT == 0 ]]; then
10 wmctrl -s 0
11 else
12 export BACK=$(wmctrl -d | grep \* | awk '{print $1-1}')
13 wmctrl -s $BACK
14 fi
15 fi
16 if [[ $1 == 'U' ]]; then
17 dbus-send --print-reply --dest=org.gnome.Shell /org/gnome/Shell org.freedesktop.DBus.Properties.Set string:org.gnome.Shell string:OverviewActive variant:boolean:true
18 fi
19
20 if [[ $1 == 'D' ]]; then
21 dbus-send --print-reply --dest=org.gnome.Shell /org/gnome/Shell org.freedesktop.DBus.Properties.Set string:org.gnome.Shell string:OverviewActive variant:boolean:false
22 fi
23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment