You are not logged in.

#1 2012-08-30 18:43:03

ericvm
Member
Registered: 2012-08-30
Posts: 6

XMonad + Wallpaperd + Compositing

Hello all,

After a considerable amount of browsing and experimenting, I have finally found a decent way to have different wallpapers for each workspace in XMonad, using a nice small application called wallpaperd (https://projects.pekdon.net/projects/wallpaperd), which receives event notification from XMonad when the workspace changes and then changes wallpaper accordingly. If any of you are interested in this setup I could ellaborate on the details.

Anyhow, not content with only this, I decided it would be an excellent idea to use compositing to enable transparency on terminal windows and other possible nice effects to create the absolute best window manager experience ever.

My first attempt was using xcompgmr. However, running xcompmgr caused strange behaviours in wallpaperd. When changing workspace, the background would not update to the correct workspace, but always to the background corresponding to the previous workspace I've been to, like it was changing the background with one workspace change delay.

Having no knowledge of X inner workings and no clue on what could be the problem, I decided to try another compositing manager, cairo-compmgr. Using cairo produced a much better behaviour, but also with a strange quirk: Whenever the workspace was empty, changing to that empty workspace didn't update the screen nor the workspace. That is, the image of the previous workspace remained on the screen frozen, as if I had not changed workspaces at all. It remained like this until I performed some action on the workspace, like opening a window or activating dmenu.

I don't know if this should be a simple thing to solve or whether it is somehow impossible to get wallpaperd working together with a compositing manager. I appreciate any insights you may have on the matter, though, and will gladly supply my XMonad config file if any of you would like to try a similar setup.

Offline

#2 2012-08-30 20:20:23

hellomynameisphil
Member
From: /home/phil/Vancouver
Registered: 2009-10-02
Posts: 257
Website

Re: XMonad + Wallpaperd + Compositing

Try compton. It's the least buggy of all compositing managers I have tried. There's an AUR pkg.

Offline

#3 2012-08-30 22:35:17

ericvm
Member
Registered: 2012-08-30
Posts: 6

Re: XMonad + Wallpaperd + Compositing

Thanks!

I tried compton but it has the same behaviour as xcompmgr... hmm

Offline

#4 2012-09-02 02:15:44

ericvm
Member
Registered: 2012-08-30
Posts: 6

Re: XMonad + Wallpaperd + Compositing

Funny thing is that when using xmobar, cairo-compmgr works like a charm. I think that somehow the bar forces it to draw the workspace, because it has to update the bar or whatever.

I didn't want to use xmobar on all workspaces, but maybe that will work for now.

Offline

#5 2012-09-10 02:39:06

jhall
Member
Registered: 2012-09-10
Posts: 5

Re: XMonad + Wallpaperd + Compositing

I've been trying to do the exact same thing using a couple of different methods (stripped down versions):

By using a log hook:

import XMonad
import qualified XMonad.StackSet as S

main = xmonad $ defaultConfig { logHook = myLogHook }

myLogHook = do
  curTag <- gets (S.currentTag . windowset)
  spawn ("feh --bg-scale /home/jhall/Wallpapers/wallpaper" ++ curTag ++ ".jpg")

By attaching it to the keyboard shortcut for changing workspaces:

import XMonad
import System.IO
import qualified Data.Map as Map

main = xmonad $ defaultConfig { keys = newKeys }

newKeys x = Map.unionWith (\a b -> a >> b)  (Map.fromList myKeys) (keys defaultConfig x)

myKeys = zip (zip (repeat mod1Mask) [xK_1..xK_9]) (map showBg "123456789")

showBg n = spawn $ "feh --bg-scale /home/jhall/Wallpapers/wallpaper" ++ [n] ++ ".jpg"

I've also tried the second method using createProcess instead of spawn.  In all three, the wallpaper changes, but there is an annoying delay where the workspace/windows change but the wallpaper hasn't updated yet.  I tried this with xcompmgr, compton, and cairo-compmgr.  cairo-compmgr had the shortest delay, but it was still noticeable.

I also had a similar issue with things not refreshing when using cairo-compmgr without xmobar.  I did not notice the issue when using xcompmgr or compton.  I prefer using xmobar anyway, but the above methods might work for you.

Offline

#6 2012-09-10 03:13:07

ericvm
Member
Registered: 2012-08-30
Posts: 6

Re: XMonad + Wallpaperd + Compositing

Yes, I also tried to use feh or some similar command-line app to change the background, associating it with the key bindings.

The reason the transition delays, I think, is because everytime you change wallpaper you have to reload it from memory.

If you had an application running as a daemon, responsible for changing wallpapers when some trigger occurs, then the delay is much less (you can't notice the delay in fast computers).

I was almost writing such an application myself, but I found just the app for it, which was wallpaperd (https://projects.pekdon.net/projects/wallpaperd)

All you need to do is to configure and run wallpaperd on startup and enable ewmh hints on XMonad (http://xmonad.org/xmonad-docs/xmonad-co … ktops.html)

Works like a charm!

I just gave up on cairo-compmgr. I decided on using XMobar, but wanted a way to hide it when I wanted. This behaviour was also very buggy on cairo, so I just sent all to hell and enabled compton.

For some unknown devilry, compton now works great with wallpaperd. Maybe it is because of xmobar... Who knows.

At least now I can see which workspace I'm working in looking to the background through my translucent terminal windows tongue

Last edited by ericvm (2012-09-10 03:13:35)

Offline

#7 2012-09-10 03:59:59

jhall
Member
Registered: 2012-09-10
Posts: 5

Re: XMonad + Wallpaperd + Compositing

That is really awesome!  I had tried wallpaperd before but couldn't get it working for some reason.  It's working great now though.  Thanks for sharing your solution smile

Offline

Board footer

Powered by FluxBB