Jul
07
2023

When gnome-screenshot stops working in XFCE

(Add / View Comments) (0)Friday, July 7, 2023 - 08:13:07 pm
(Posted Under: Linux Linux, Gentoo)
TL;DR: xfsettingsd --replace

I use gnome-screenshot in non interactive copy to clipboard a fair bit for work these days. 'gnome-screenshot -a -c' is a launcher on my cairo-dock, and it's the bomb - until it stops working.

It seems kinda random, it'll be fine for a while, and then just stop working. Running it interactively (-i) and copying to the clipboard will continue to fine, but non interactively runs copying to the clipboard will not.

In these situations, running it via the command line in interactive mode gets really tedious really fast, if you have to do it more than once. Last time it stopped working on my, I took a look into it for a little while, but got nowhere.

I found myself in the predicament again today, and I spent a fair bit of time looking into it again to try and solve it, without a reboot, not even restarting X. I ended up learning way more about the Linux clipboard (or selection buffers I now know) than I've ever knew. Including the fact that clipboard contents is not maintained once the source program exits. Surprising that I've gone 20 something years (10 of those exclusively using a Linux desktop) without knowing that? Yep.

With that said, nothing much I read seemed that helpful to my problem. Everything suggested running a clipboard manager was the solution. My Gentoo system is pretty lean, and doesn't have one (or so I thought) and gnome-screenshot in non interactive mode works for a while, so I wasn't about to install one. Today I even found myself going as far as unpacking the gnome-screenshot source, throwing in a bunch of debugging to try find out what was going wrong. I didn't get very far with that, other than confirming that if I preventing the program from exiting in non interactive mode, pasting screenshots actually did work.

From here I jumped to my Xbuntu laptop, where things were working fine, I noticed that I use xfce4-screenshooter there, not gnome-screenshot. So I installed that on my Gentoo desktop - still no dice. It was about that time that I decided to see what X11 programs were running, and noticed xfsettingsd. Much earlier in the afternoon I'd tried restarting a bunch of xfce things (including xfdesktop) to no avail. But lo and behold, restarting xfsettingsd (xfsettingsd --replace) did the trick.

Turns out that xfsettingsd contains a clipboard manager, something had gone awry, and restarting fixes it. It just doesn't seem that there is anything on the Internet that will tell you that!

So, there you go. After suffering this problem (periodically) for years, I am quite happy to have worked it out. If taking screenshots in non interactive mode stops working under Xface, restart xfsettingsd.

Switch Styles

About Style Switching.

!Weblog Index

Jun July 2023 Aug
SU MO TU WE TH FR SA
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

Categories

RSS FeedRSS Feed