Forum › Forums › General › Tips and Tricks › Different wallpapers on each workspace or monitor
- This topic has 14 replies, 5 voices, and was last updated Apr 15-8:11 pm by Brian Masinick.
-
AuthorPosts
-
October 28, 2022 at 8:56 pm #91704Member
zblsv
In antiX wallpaper being set by desktop-session-wallpaper shell script. It takes desktop code as argument. Desktop code (icon manager and window manager names separated by hyphen) is held in DESKTOP_SESSION_CODE environment variable. desktop-session-wallpaper reads $HOME/.desktop-session/wallpaper-list.conf for picture filename for that desktop code and calls appropriate utilities to actually draw the picture on the root window. So we can change wallpaper-list.conf and then run desktop-session-wallpaper $DESKTOP_SESSION_CODE to change wallpaper.
Put together:
# change-wallpaper.sh # Change desktop wallpaper to specified image under antiX Linux. # IMPORTANT: The image filename must not contain spaces. imagefile="$1" sed -i 's|^'$DESKTOP_SESSION_CODE'=.*$|'$DESKTOP_SESSION_CODE'='$imagefile'|' ~/.desktop-session/wallpaper-list.conf desktop-session-wallpaper $DESKTOP_SESSION_CODECurrent workspace number can be obtained by xprop -root _NET_CURRENT_DESKTOP plus one. So we can assign to the workspace change event
. ~/change-wallpaper.sh ~/wallpaper/$(($(xprop -root _NET_CURRENT_DESKTOP | tr -d ' ' | cut -d= -f2)+1)).jpg
And put 1.jpg 2.jpg 3.jpg 4.jpg in, say, ~/wallpaper/For instance, for Fluxbox in ~/.fluxbox/keys by
ChangeWorkspace :Exec . ~/change-wallpaper.sh ~/wallpaper/$(($(xprop -root _NET_CURRENT_DESKTOP | tr -d ' ' | cut -d= -f2)+1)).jpgBut… the conky…
It refreshes itself at the next tick only one second later after the workspace has been changed. It can be restarted by sending it the SIGHUP or SEGUSR1, but it is inappropriate. What we still miss in conky is the ability to send SIGUSER2 to run the next tick immediately.
With that we remain.
- This topic was modified 6 months ago by zblsv.
- This topic was modified 6 months ago by zblsv.
Words are carried away by the wind...
April 14, 2023 at 5:00 pm #104703Membergoobric
::hi I am new to antiX, and resently installed ver 22 (previous ubuntu) can you please explain in simple terms how I have different wallpaper image on different workspaces? When I set the wallpaper on workspace 1 this automatically populates to workspace 2 & 3!
I can accommplish this in other linux distros, but am unable to find a way to complete this in antiX22?Thank you so much for your assistance.
April 14, 2023 at 5:42 pm #104712Forum Admin
anticapitalista
::There is no simple way to do this on antiX.
Philosophers have interpreted the world in many ways; the point is to change it.
antiX with runit - leaner and meaner.
April 14, 2023 at 5:53 pm #104715Member
zblsv
::This theme is valuable for me too. I also want to have different wallpapers on different workspaces. But, I am sorry, goobric. Right now I definitely have no free time to spend to this. I must do the home care that I having defer for years. Therefore only some thoughts.
On antiX (19.3 at least, as I know) desktop-session-wallpaper script intentionally sets only one wallpaper for all the workspaces for the sake to it can be random. Therefore we can disable desktop-session-wallpaper somehow. And than use window manager capabilities to set wallpaper. This is not a trivial task for newbies, I think.
Words are carried away by the wind...
April 14, 2023 at 10:05 pm #104720Membergoobric
::thank you so much for your quick response zblsv, and your advice; much appreciated 🙂
I hope that the maintainers antiX and those that have much better programming understanding and knowledge than I, are able to implement this functionality.April 14, 2023 at 10:35 pm #104721Forum Admin
anticapitalista
::thank you so much for your quick response zblsv, and your advice; much appreciated
I hope that the maintainers antiX and those that have much better programming understanding and knowledge than I, are able to implement this functionality.It is very low priority.
Philosophers have interpreted the world in many ways; the point is to change it.
antiX with runit - leaner and meaner.
April 15, 2023 at 12:07 am #104724Moderator
Brian Masinick
::thank you so much for your quick response zblsv, and your advice; much appreciated
I hope that the maintainers antiX and those that have much better programming understanding and knowledge than I, are able to implement this functionality.Perhaps this is an opportunity to learn and if you figure out a solution share it; that’s how freely available software works.
Alternatively convince someone to build something based on detailed ideas; once in a while that works out, though contributing is the usual approach that works.
--
Brian MasinickApril 15, 2023 at 1:12 am #104725Member
zblsv
::Perhaps this is an opportunity to learn and if you figure out a solution share it; that’s how freely available software works.
Exactly. The open source philosophy is different from the commercial one. If we need functionality, then we shouldn’t try to wait for someone else to do it for us. We have to do it ourselves. If we don’t know how to program, then we have to learn to program to some extent to meet these needs. It’s worth it.
Words are carried away by the wind...
April 15, 2023 at 12:12 pm #104749Member
blur13
::If you only use icewm you can map the key for switching workspace to
wmctrl -s <workspace_name> && feh --no-fehbg --bg-fill /path/to/picture.jpgso for instance, if workspaces are named 1, 2, 3, 4
in .icewm/keyskey Alt+1 /bin/sh -c "wmctrl -s 1 && feh --no-fehbg --bg-fill /path/to/picture.jpg" key Alt+2 /bin/sh -c "wmctrl -s 2 && feh --no-fehbg --bg-fill /path/to/picture.jpg"I havent tried this, I’m basically just thinking out loud. And this is probably along the lines of what OP was doing in the first place, so its not very innovative either.
- This reply was modified 2 weeks, 3 days ago by blur13.
April 15, 2023 at 12:34 pm #104751Moderator
Brian Masinick
::Perhaps this is an opportunity to learn and if you figure out a solution share it; that’s how freely available software works.
Exactly. The open source philosophy is different from the commercial one. If we need functionality, then we shouldn’t try to wait for someone else to do it for us. We have to do it ourselves. If we don’t know how to program, then we have to learn to program to some extent to meet these needs. It’s worth it.
Thank you. Anticapitalista is not being mean. He volunteers a great deal of his own time and energy for this project. If he makes any income from this work at all, it’s an indirect benefit. I’m paid zero. What I gain is excellent free software with which I can use, hack, share and use old equipment. I’ve directly either given computers with antiX on them or customized a solution for at least three people directly and I do my best every year to help as many people as I can with free software and it’s usually antiX.
--
Brian MasinickApril 15, 2023 at 3:06 pm #104759Moderator
Brian Masinick
::If you only use icewm you can map the key for switching workspace to
wmctrl -s <workspace_name> && feh --no-fehbg --bg-fill /path/to/picture.jpgso for instance, if workspaces are named 1, 2, 3, 4
in .icewm/keyskey Alt+1 /bin/sh -c "wmctrl -s 1 && feh --no-fehbg --bg-fill /path/to/picture.jpg" key Alt+2 /bin/sh -c "wmctrl -s 2 && feh --no-fehbg --bg-fill /path/to/picture.jpg"I havent tried this, I’m basically just thinking out loud. And this is probably along the lines of what OP was doing in the first place, so its not very innovative either.
I haven’t tried your idea yet @blur13 but I think you’re on the right track.
Even if that isn’t the final solution, at worst, whenever you change workspace, you could have some kind of script that you run
instead of simply clicking on the other workspace, and in effect, what it’d do is change the workspace and the background.
I don’t know if there is a way to make each workspace concurrently have a different wallpaper, but it’s definitely
possible to change the workspace and the background via a script; if all else fails, that is a workaround solution.--
Brian MasinickApril 15, 2023 at 6:28 pm #104765Moderator
Brian Masinick
::One minor change to the procedure, @blur13 and then it ought to work:
key Alt+1 /bin/sh -c “wmctrl -s 0 && feh –no-fehbg –bg-fill /home/masinick/Pictures/antiX-image.jpg”
key Alt+2 /bin/sh -c “wmctrl -s 1 && feh –no-fehbg –bg-fill /home/masinick/Pictures/Cumberland_Falls.jpg”
key Alt+3 /bin/sh -c “wmctrl -s 2 && feh –no-fehbg –bg-fill /home/masinick/Pictures/Cumberland_Falls_Moonbow_panarama.jpg”
key Alt+4 /bin/sh -c “wmctrl -s 3 && feh –no-fehbg –bg-fill /home/masinick/Pictures/antiX-image.jpg”Notice that Workspace 1 gets key Alt 1 but the wmctrl -s is 0; as far as the workspace backgrounds, they can change.
I did this, and using Alt+1 through Alt+4 did change the wallpaper; however if you use another means to switch workspaces, such as clicking on the task bar workspaces, it does NOT change the workspace, so the solution I show above works, assuming you replace my images with yours.
Nice workable alternative!
--
Brian MasinickApril 15, 2023 at 6:34 pm #104766Moderator
Brian Masinick
::By the way, I DO rename my workspaces; mine are named Web, Mail, Term, and Edit, but for the procedure to work, you have to pass 0, 1, 2, or 3 if you have four workspaces to the wmctrrl -s command.
So if you use the IceWM toolbar and click on your different workspaces, it won’t change the wallpaper, but if you code similar to what I did above, adding the alt key combinations, and the backgrounds for each, it’ll work, but it’s actually changing all the workspaces; still, as long as you use the alt key combos, you won’t notice…
--
Brian MasinickApril 15, 2023 at 8:03 pm #104772Member
blur13
::Nice work Brian!
I checked the man pages for wmctrl and of course you are right about the numbering and also that the “name” given doesnt matter:
-s <DESK> Switch to the desktop <DESK>.
<DESK> A Desktop is always specified by an integer which represents the desktop numbers. Desktop numbers start at 0.
April 15, 2023 at 8:11 pm #104773Moderator
Brian Masinick
::Glad it worked out,
I just tried your method and made minor adjustments so I guess it took both of us cooperating to get it done right 👍
--
Brian Masinick -
AuthorPosts
- You must be logged in to reply to this topic.