aboutsummaryrefslogtreecommitdiff
path: root/rofi
diff options
context:
space:
mode:
Diffstat (limited to 'rofi')
-rwxr-xr-xrofi/workspaces.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/rofi/workspaces.sh b/rofi/workspaces.sh
index 4bff293..8495f8d 100755
--- a/rofi/workspaces.sh
+++ b/rofi/workspaces.sh
@@ -7,18 +7,17 @@ if [ -z $1 ]; then
done
exit 0
else
+ WINDOWS=$(xdotool search --all --onlyvisible --desktop $(xprop -notype -root _NET_CURRENT_DESKTOP | cut -c 24-) "" 2>/dev/null)
+ # Load the workspace
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
+ HAS_PID=$(xdotool getwindowpid $window 2>&1 | grep "pid" | wc -l)
+
+ # Unmap the window to make it disapear, then map it again for i3 trigger the swallow
xdotool windowunmap $window
xdotool windowmap $window
- #fi
-done
+ done
+ i3-msg "workspace $1" > /dev/null
exit 1
fi