aboutsummaryrefslogtreecommitdiff
path: root/rofi
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2019-04-21 15:07:23 +0200
committerSébastien Dailly <sebastien@chimrod.com>2019-04-21 15:07:23 +0200
commit4c7aaef74b7c1507ae79f7794eeef80f01dd40e9 (patch)
tree7e0b52ff2573fdb238aa811f6bd861ec6d31803c /rofi
parent96b77e2029a67aeef9faac9cbcb2a00f75026540 (diff)
Added script for i3 workspace env
Diffstat (limited to 'rofi')
-rwxr-xr-xrofi/workspaces.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/rofi/workspaces.sh b/rofi/workspaces.sh
new file mode 100755
index 0000000..4bff293
--- /dev/null
+++ b/rofi/workspaces.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+WORKSPACES=~/.config/i3/workspaces
+
+if [ -z $1 ]; then
+ for fic in ~/.config/i3/workspaces/*.json; do
+ echo $(basename "$fic" .json)
+ done
+ exit 0
+else
+ i3-msg "workspace $1; append_layout ${WORKSPACES}/${1}.json; workspace back_and_forth" > /dev/null
+ # get the list of windows on the current workspace
+ WINDOWS=$(xdotool search --all --onlyvisible --desktop $(xprop -notype -root _NET_CURRENT_DESKTOP | cut -c 24-) "" 2>/dev/null)
+ for window in $WINDOWS; do
+ HAS_PID=$(xdotool getwindowpid $window 2>&1 | grep "pid" | wc -l)
+
+ #if [ ! $HAS_PID -eq 0 ]; then
+ # echo "$window does not have a process"
+ #else
+ xdotool windowunmap $window
+ xdotool windowmap $window
+ #fi
+done
+ exit 1
+fi