Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 23 Sep 2014, 10:23
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
openbox{Fatdog & other}visually ID which desktop??(Solved)
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
jtwdyp


Joined: 04 Oct 2013
Posts: 137

PostPosted: Tue 11 Mar 2014, 04:44    Post subject:  openbox{Fatdog & other}visually ID which desktop??(Solved)
Subject description: ideally switch wallpaper on DesktopLeft etc...
 

Thanks to Fatdog I've discovered that I actually "LIKE" using openbox. Almost more than E17... If I could {visually} see a major difference between the desktops then I think openbox would soon be my default "desktop*" in all my Linux installations.

* yeah, I know it's only a window manager as opposed to a full "DE".

I'd settle for an {all desktop} application that displayed the current desktop number or name in a bold 48pt font...

Anybody know how Question

_________________

--
JtWdyP



Last edited by jtwdyp on Wed 12 Mar 2014, 22:31; edited 1 time in total
Back to top
View user's profile Send private message 
ProgRob

Joined: 13 Feb 2013
Posts: 14

PostPosted: Tue 11 Mar 2014, 11:07    Post subject:  

The easiest way would be to bind a key to show the client-list-combined-menu which shows you the desktops and the active windows within each. I have the a binding in my rc.xml file like:

Code:

   <keybind key="C-A-2">
      <action name="ShowMenu">
        <menu>client-list-combined-menu</menu>
      </action>
    </keybind>


which puts up a useful menu when I press control-alt-2.

Otherwise the following command typed into a terminal:

Code:

xprop -root _NET_CURRENT_DESKTOP

will display the number of the current desktop.

You can then combine this with gxmessage in a bash script like so:
Code:

#!/usr/bin/bash
DESKTOPNUMBER=`xprop -root _NET_CURRENT_DESKTOP|tail -c 3`
gxmessage -borderless -center -font "serif bold 48" -buttons "Ok" -default "Ok" -timeout 2 -fg white -bg black "Desktop: $((DESKTOPNUMBER+1))"

This gives a message box with the current desktop number on it showing for 2 seconds (or less if you press Ok).

Of course it would be possible to do something even more sophisticated (e.g. have the desktop number appear in large letters at the centre of the screen) but that will take a little programming...

Hope that helps,
Rob
Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Tue 11 Mar 2014, 16:18    Post subject:  

Deleted, reply not longer relevant.
_________________
LazY Puppy
RSH's DNA
SARA B.

Last edited by RSH on Wed 12 Mar 2014, 07:55; edited 1 time in total
Back to top
View user's profile Send private message 
Jasper


Joined: 25 Apr 2010
Posts: 1125
Location: England

PostPosted: Tue 11 Mar 2014, 17:45    Post subject:  

Hi RSH,

VarioMenu seems to work with Precise 5.6 and jwm, although I have "my own" Menu-selector-launcher made with instructions from a stu90/91 thread.

I also use SFS-Tray and Favorites (left click Menu), two jwm apps from seaside, together with other Menu apps including PupMenu from radky which is shown in the screen shot and can be used with jwm, openbox etc etc etc.

Blues Eyes is, I'm 99% sure, from CatDude.

My regards
image.png
 Description   
 Filesize   199.31 KB
 Viewed   267 Time(s)

image.png

Back to top
View user's profile Send private message 
ProgRob

Joined: 13 Feb 2013
Posts: 14

PostPosted: Tue 11 Mar 2014, 19:01    Post subject:  

I noticed that you ideally wanted a different wallpaper for each desktop. I found this solution on a Linux Mint forum which seems to work. I've tweaked it for Puppy. To get this to work you need to have something to set the wallpaper. I have used qiv which can be downloaded from the Ubuntu repos as I have dsiabled the Rox pinboard. I suspect that if you change the qiv line to: rox -p="$desktop_dir$1" it should work. Needs to be tested.

Anyhow, give this a go!

Code:

#!/bin/bash
# Workspace desktop image switcher WDIS 1.0
# Script to change the desktop image when switching workspaces.
# Tested on Linux Mint 13 'cinnamon'
desktop_dir="/usr/share/backgrounds/" # full path to images directory;
desktop_img[0]="default.jpg"
desktop_img[1]="tyson-skateboarding.jpg"
desktop_img[2]="sunset_jesse.jpg"
desktop_img[3]="squiggles.jpg"
# add more images if using more workspaces

setdesktop() {
   qiv -z "$desktop_dir$1"
}
xprop -root -spy _NET_CURRENT_DESKTOP | (
   while read -r; do
      desk=${REPLY:${#REPLY}-1:1}
      setdesktop ${desktop_img[$desk]}
   done
   )


Credit to garalou on the Linux Mint Forums


Cheers,
Rob
Back to top
View user's profile Send private message 
jtwdyp


Joined: 04 Oct 2013
Posts: 137

PostPosted: Tue 11 Mar 2014, 19:46    Post subject:  

ProgRob wrote:
The easiest way would be to bind a key to show the client-list-combined-menu which shows you the desktops and the active windows within each.


- - - - - - - - -< s n i p STUFF >- - - - - - - - - -

Quote:
which puts up a useful menu when I press control-alt-2.


Yeah, The thing is I'm trying to find out how to have something happen automatically on desktop change...


Quote:
Otherwise the following command typed into a terminal:

Code:

xprop -root _NET_CURRENT_DESKTOP

will display the number of the current desktop.


That piece of the puzzle is priceless! Thank you!

Quote:
You can then combine this with gxmessage in a bash script like so:
Code:

#!/usr/bin/bash
DESKTOPNUMBER=`xprop -root _NET_CURRENT_DESKTOP|tail -c 3`
gxmessage -borderless -center -font "serif bold 48" -buttons "Ok" -default "Ok" -timeout 2 -fg white -bg black "Desktop: $((DESKTOPNUMBER+1))"


I'm not real familiar with gxmessage, so I'm not sure... But it looks to me like that would still need to be called by conscious action. IE I have to remember to push the key bound to this script before it displays anything right?

If I could solve that part of the puzzle. I'd marry that priceless snippet of code you gave me above with a script more like this:

Code:

case $(xprop -root _NET_CURRENT_DESKTOP) in
# #    for Fatdog comment out the feh lines and uncomment the wallpaper lines
#    *0) wallpaper $HOME/0bg/ChillyLickingGood2001.jpg;;
#    *1) wallpaper $HOME/0bg/z_optic2.png;;
#    *2) wallpaper $HOME/0bg/metruck.jpg;;
#    *3) wallpaper $HOME/0bg/greydragon.png;;
#    *4) wallpaper $HOME/0bg/ShiloWannaPlay0273.jpg;;
#    *5) wallpaper $HOME/0bg/jungle.png;;
# #    for Mageia comment out the wallpaper lines and uncomment the feh lines
   *0) feh  --bg-scale "$HOME/0bg/ChillyLickingGood2001.jpg";;
   *1) feh  --bg-scale "$HOME/0bg/z_optic2.png";;
   *2) feh  --bg-scale "$HOME/0bg/metruck.jpg";;
   *3) feh  --bg-scale "$HOME/0bg/greydragon.png";;
   *4) feh  --bg-scale "$HOME/0bg/ShiloWannaPlay0273.jpg";;
   *5) feh  --bg-scale "$HOME/0bg/jungle.png";;
esac


I just need to figure out how to get the action of switching desktop areas to call my script...

RSH wrote:
So you actually LIKE Openbox? Razz

Ok, please read carefully.

Try these two packages and you'll LOVE Openbox.

After installing these packages (Part1 = 1st, Part2 = 2nd) restart X Server.

It should work with gtkdialog 0.8.0 (gtkdialog4) but I recommend to use the latest version, which is currently 0.8.4 - I think.

After X has restarted, you'll have a desktop pager in system tray, that shows activated desktop as numerical sign (1, 2, 3 etc.pp). Centered on top of the screen you'll find the VarioMenu-Group Pager which shows activated desktop related to the VarioMenu-Group (like: Admin, Audio, Graphics, Office etc.pp). VarioMenu-Groups and openbox desktops are synchronized for the first 8 VM-Groups/OB-Desktops.

You can add more VM-Groups since Openbox is now setup to have 30 desktops available. So you can add up to 30 VM-Groups.


I'm thinking this is more complex than I'm hoping for...

My brain is used to working with 12 desktop areas. I set my keybindings to use <ctrl>+<F-key> and/or <ctrl>+<Tab> & <ctrl>+<shift>+<Tab> Getting away from the puppy/jwm <alt>+<Num> was why I bothered learning enough about Fatdog's openbox to start liking it...

I'm thinking I could set the initial background image by calling my script in ~/.config/openbox/autostart. Then if I can figure out how to add a second action that calls it to the bindings that switch my desktop... And if the first action would complete before the second action starts, then my script would be called right after the switch to a new desktop, right? I'm not real good with xml though so if anybody feels like giving an example I'd be grateful

Then all I'd have to do is hunt down and disable any desktop switching that doesn't use the keybindings...

Though I suppose there is little to be done about what if I click on a pager such as the one in whatever panel fatdog uses or the similar one in the lxpanel I added to Mageia's openbox package. Still, If I actually click on that instead of using my chosen keybindings, then I deserve to have a hiccup in the background change. Besides I can always fix it with a call to my script...

_________________

--
JtWdyP


Back to top
View user's profile Send private message 
jtwdyp


Joined: 04 Oct 2013
Posts: 137

PostPosted: Tue 11 Mar 2014, 20:06    Post subject:  

ProgRob wrote:
I noticed that you ideally wanted a different wallpaper for each desktop. I found this solution on a Linux Mint forum which seems to work. I've tweaked it for Puppy. To get this to work you need to have something to set the wallpaper. I have used qiv which can be downloaded from the Ubuntu repos as I have dsiabled the Rox pinboard. I suspect that if you change the qiv line to: rox -p="$desktop_dir$1" it should work. Needs to be tested.

Anyhow, give this a go!

Code:

#!/bin/bash
# Workspace desktop image switcher WDIS 1.0
# Script to change the desktop image when switching workspaces.
# Tested on Linux Mint 13 'cinnamon'
desktop_dir="/usr/share/backgrounds/" # full path to images directory;
desktop_img[0]="default.jpg"
desktop_img[1]="tyson-skateboarding.jpg"
desktop_img[2]="sunset_jesse.jpg"
desktop_img[3]="squiggles.jpg"
# add more images if using more workspaces

setdesktop() {
   qiv -z "$desktop_dir$1"
}
xprop -root -spy _NET_CURRENT_DESKTOP | (
   while read -r; do
      desk=${REPLY:${#REPLY}-1:1}
      setdesktop ${desktop_img[$desk]}
   done
   )


Credit to garalou on the Linux Mint Forums


If I'm reading this right, this assigns all the image filenames to an array, Then runs continuously , detecting the desktop change somehow... I'm guessing it's the -spy option to xprop? I don't know about qiv, And I don't want to mess around with rox. But I know the wallpaper command that came with Fatdog64-630 works, and in Mageia I can do it with feh And adapting this to those background setting commands sounds better than messing with my keybindings...

It will take a while for me to have the time again. (my lady has started to threaten to pour water on my keyboards again...) But I will eventually test this idea and post the results. Thanks!

_________________

--
JtWdyP


Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Tue 11 Mar 2014, 20:27    Post subject:  

ProgRob wrote:
I noticed that you ideally wanted a different wallpaper for each desktop.

No, I don't wanted it ideally.

I got it already working and running here, but I think it's just not included completely in the development package above (can't say it for sure).

If you want to check, if it will work by this package, just activate its option in the VarioMenu-GUI (2nd tab), close it by menu entry (not by close button of window!) and switch the OB-desktop/VM-group.

Make sure the wallpaper/s given in the .rc.file/s is/are existing!

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Tue 11 Mar 2014, 20:29    Post subject:  

Jasper wrote:
Hi RSH,

VarioMenu seems to work with Precise 5.6 and jwm, although I have "my own" Menu-selector-launcher made with instructions from a stu90/91 thread.

I also use SFS-Tray and Favorites (left click Menu), two jwm apps from seaside, together with other Menu apps including PupMenu from radky which is shown in the screen shot and can be used with jwm, openbox etc etc etc.

Blues Eyes is, I'm 99% sure, from CatDude.

My regards

Hi.

Though I don't like dogs very much, I must say: nice wallpaper!

Got any links for the applications you mentioned (not the PupMenu, the others)?

The menu looks interesting.

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
CatDude


Joined: 03 Jan 2007
Posts: 1474
Location: UK

PostPosted: Wed 12 Mar 2014, 06:32    Post subject:  

Hi

@ Jasper
Jasper wrote:
..Blues Eyes is, I'm 99% sure, from CatDude.

I did use that image in one of my GRUB gfxmenu files, but it is not mine.
You can find it in various sizes online, here for example

CatDude
.

_________________

Back to top
View user's profile Send private message 
jtwdyp


Joined: 04 Oct 2013
Posts: 137

PostPosted: Wed 12 Mar 2014, 14:56    Post subject:  

ProgRob wrote:
I noticed that you ideally wanted a different wallpaper for each desktop. I found this solution on a Linux Mint forum which seems to work. I've tweaked it for Puppy.


I Know I said my previous example worked on fatdog. But actually, I'd only tested the "wallpaper path/imagefile" part of it there. I've just discovered that neither of my Fatdog64-630 installations have xprop installed...

Anybody know what pet includes it???

But about the openbox background switcher...

This almost does it for me on my Mageia installation:

Code:

#!/bin/bash
# Workspace desktop image switcher WDIS 1.0
# Script to change the desktop image when switching workspaces.
# Tested on Linux Mint 13 'cinnamon'
# desktop_dir="/usr/share/backgrounds/" # full path to images directory;
desktop_dir="$HOME/0bg/" # full path to images directory;
desktop_img[0]="ChillyLickingGood2001.jpg"
desktop_img[1]="z_optic2.png"
desktop_img[2]="metruck.jpg"
desktop_img[3]="greydragon.png"
desktop_img[4]="ShiloWannaPlay0273.jpg"
desktop_img[5]="BlueStone.png"
desktop_img[6]="DragonlySkyscapes-014.jpg"
desktop_img[7]="DragonlySkyscapes-016.jpg"
desktop_img[8]="FantaScene-006.jpg"
desktop_img[9]="DragonlySkyscapes-018.jpg"
desktop_img[10]="DragonlySkyscapes-019.jpg"
desktop_img[11]="jungle.png"
# add more images if using more workspaces

setdesktop() {
# =>    test
#    display "$desktop_dir$1"
# =>       Mageia
    feh  --bg-scale "$desktop_dir$1"
# =>       fatdog
#    wallpaper "$desktop_dir$1"
}
xprop -root -spy _NET_CURRENT_DESKTOP | (
   while read -r; do
      desk=${REPLY:${#REPLY}-1:1}
      setdesktop ${desktop_img[$desk]}
   done
   )



It fails on the last 2 of my 12 desktop areas... Obviously because 10 & 11 are 2 digit numbers... And as best as I can make out, this:

Code:

      desk=${REPLY:${#REPLY}-1:1}


only extracts the last "1" char from the $REPLY string... I could probably figure out how to make it extract the last 2 but then the first 10 values would be invalid... I'll have to figure out some conditional branching logic for that.

But could somebody explain that line to me a little better?

I mean what does the last :1 do? Using it as an example I figured out how to make this:

Code:
 a="badgoodcrap" && b=${a:${#a}-8} && c=${b:${#b}-4} && echo $c


say "crap" But I can't figure out how to make it say good. Question

I'm thinking that one or the other of these would solve the array problem for the last two desktops, but would likely break the first 10...

Code:

      desk=${REPLY:${#REPLY}-2:1}
      desk=${REPLY:${#REPLY}-2:2}


I won't get to play with the PC I installed openbox to until later... But I'm guessing the latter... in which case perhaps something like:

Code:

      case $(desk=${REPLY:${#REPLY}-2:2}) in
         [0-9][0-9]) setdesktop ${desktop_img[$desk]};;
         *)desk=${REPLY:${#REPLY}-1:1};
         setdesktop ${desktop_img[$desk]};;
      esac

_________________

--
JtWdyP


Back to top
View user's profile Send private message 
jtwdyp


Joined: 04 Oct 2013
Posts: 137

PostPosted: Wed 12 Mar 2014, 22:29    Post subject:  

jtwdyp wrote:
But could somebody explain that line to me a little better?

I mean what does the last :1 do? Using it as an example I figured out how to make this:

Code:
 a="badgoodcrap" && b=${a:${#a}-8} && c=${b:${#b}-4} && echo $c


say "crap" But I can't figure out how to make it say good. Question


Seems either of these will do it...

Code:

a="badgoodcrap" && b=${a:${#a}-8:4} && echo $b
a="badgoodcrap" && b=${a:${#a}-8} && c=${b:${#b}-8:4} && echo $c


Quote:

I'm thinking that one or the other of these would solve the array problem for the last two desktops, but would likely break the first 10...

Code:

      desk=${REPLY:${#REPLY}-2:1}
      desk=${REPLY:${#REPLY}-2:2}


I won't get to play with the PC I installed openbox to until later... But I'm guessing the latter... in which case perhaps something like:

Code:

      case $(desk=${REPLY:${#REPLY}-2:2}) in
         [0-9][0-9]) setdesktop ${desktop_img[$desk]};;
         *)desk=${REPLY:${#REPLY}-1:1};
         setdesktop ${desktop_img[$desk]};;
      esac


Not quite... but this one does the job!

Code:
#based on an original script posted to linuxmint forum by garolou
#[url]http://forums.linuxmint.com/viewtopic.php?p=672189#p672189[/url]
# Script to change the desktop image when switching workspaces.
# Tested on Mageia release 3 (Official) for x86_64 Kernel 3.10.28-desktop-1.mga3
# desktop_dir="/usr/share/backgrounds/" # full path to images directory;
desktop_dir="$HOME/0bg/" # full path to images directory;
desktop_img[0]="ChillyLickingGood2001.jpg"
desktop_img[1]="z_optic2.png"
desktop_img[2]="metruck.jpg"
desktop_img[3]="greydragon.png"
desktop_img[4]="ShiloWannaPlay0273.jpg"
desktop_img[5]="snapshot-dragon-storm.png"
desktop_img[6]="DragonlySkyscapes-014.jpg"
desktop_img[7]="DragonlySkyscapes-016.jpg"
desktop_img[8]="FantaScene-006.jpg"
desktop_img[9]="DragonlySkyscapes-018.jpg"
desktop_img[10]="DragonlySkyscapes-019.jpg"
desktop_img[11]="jungle.png"
# add more images if using more workspaces

setdesktop() {
# =>    test
#    display "$desktop_dir$1"
# =>       Mageia
    feh  --bg-scale "$desktop_dir$1"
# =>       fatdog
#    wallpaper "$desktop_dir$1"
}
xprop -root -spy _NET_CURRENT_DESKTOP | (
   while read -r; do
       desk=${REPLY:${#REPLY}-2:2}
       case $desk in
            [0-9][0-9]) setdesktop ${desktop_img[$desk]};;
      *)desk=${REPLY:${#REPLY}-1:1};
      setdesktop ${desktop_img[$desk]};;
       esac
   done
   )

_________________

--
JtWdyP


Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1579s ][ Queries: 12 (0.0271s) ][ GZIP on ]