You are not logged in.
Pages: 1
... a script that i could run that would:
1. add another workspace
2. update all workspace switchers to show it
3. move all windows in all workspaces to the next higher workspace (the big shift)
4. switch to workspace 0 (now empty)
5. open the designated program window (terminal, browser, whatever) in workspace 0
i could then make some nice launchers and not need to keep so many empty workspaces ready to go.
Offline
Challenge accepted!
#!/bin/bash
#
# Requires: wmctrl
# Notes: $1 is the executable name of the application to start
# get current workspace number & state of the windows
CURRWS=$(xfconf-query -c xfwm4 -p /general/workspace_count)
CURRSTATE=$(wmctrl -l > ~/.cache/.wsstate)
# add a new workspace
xfconf-query -c xfwm4 -p /general/workspace_count -s $(( $(xfconf-query -c xfwm4 -p /general/workspace_count) + 1 ))
# move all existing windows up a workspace
for (( x=0; x<$CURRWS; x++ ))
do
for app in $(cat ~/.cache/.wsstate | awk '{print $1" "$2}' | grep " $x" | awk '{print $1}')
do
wmctrl -ir $app -t $(( $x + 1 ))
done
done
# go to the first workspace
wmctrl -s 0
# start the executable that was given as a parameter to the script
exec $@
Save the file locally, make it executable and call it like this:
SCRIPTNAME EXECUTABLE
...where SCRIPTNAME is the name that you have the script and EXECUTABLE is the name of program that you want to start in workspace 0. For example:
/home/toz/bin/wslauncher xfce4-terminal
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
nice! thanks! that is also the way i like to learn new things, by example. while i already know programming, including with bash, it is accessing the desktop environment that is new to me.
Offline
Pages: 1
[ Generated in 0.007 seconds, 7 queries executed - Memory usage: 523.85 KiB (Peak: 529.95 KiB) ]