From 4c7aaef74b7c1507ae79f7794eeef80f01dd40e9 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sun, 21 Apr 2019 15:07:23 +0200 Subject: Added script for i3 workspace env --- rofi/workspaces.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 rofi/workspaces.sh (limited to 'rofi') 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 -- cgit v1.2.3