How to switch desktops by using Bash?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

How to switch desktops by using Bash?

#1 Post by RSH »

Hi!

I want to write a little script where i need to change the desktop by shell script (bash). How could this be done?

RSH
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#2 Post by technosaurus »

see your window manager's documentation, it will vary
for e16 you can use eesh
for any wm with key bindings for switching desktops, (in jwm the default is Alt + number) you can use any key scripting tool like xdotool (I recently posted a pet in additional software) or this xcb example
http://cgit.freedesktop.org/xcb/demo/tree/app/xte/xte.c
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#3 Post by RSH »

Thank you for your reply, technosaurus (not shinobar - sorry).

I could solve this using xdotool -which has been already installed in LazY Puppy 528-4- using command key. I have also (re)-discovered the FbPanel/Openbox-thread here, which has (re)-leaded me to /root/.config/openbox/rc.xml - i like to use the keyboard and keyboard-shortcuts (left-handed).
Last edited by RSH on Wed 18 Jul 2012, 08:03, edited 1 time in total.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#4 Post by jamesbond »

wmctrl -s $DESKTOP_NUMBER

where $DESKTOP_NUMBER is the desktop number, counted from zero.

http://tomas.styblo.name/wmctrl/. Works in openbox.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

Post Reply