xeyownt / xseticon Goto Github PK
View Code? Open in Web Editor NEWxseticon from Paul Evans -- http://www.leonerd.org.uk/
License: GNU General Public License v2.0
xseticon from Paul Evans -- http://www.leonerd.org.uk/
License: GNU General Public License v2.0
Do I understand correctly that XSynchronize gives us an exclusive lock on screen interaction? From the man page, it looks like it should be released. Does XCloseDisplay do that? Then a comment near XCloseDisplay should clarify that.
In any case, if it's a lock, we shall try and hold it for the shortest duration possible. File access can be slow depending on circumstances and storage medium. We should thus load the image data earlier, ideally even before we interact with X at all, because failure to load the icon voids any usefulness of the X interaction. And since X interaction always carries risks of bad side effects¹, we should be very conservative about them.
(¹ I'm currently a victim of bad xdotool
freezes that neither me nor IRC can trace even after many hours of debugging.)
Dear maintainer(s),
Snaps are universal Linux packages that can be installed and run on many GNU+Linux distributions with ease. I've been following the Snapcrafters instructions and have built a working snap on the Snap Store, you may try it by running the following commands after installing snapd:
sudo snap install xseticon
I'm also looking forward to working with you to make the packaging work upstream (if you're interested). You may want to check out the current packaging recipe, the documentation, registering a developer account on the Snap Store, and get in touch with us to transfer the work under your control.
Thanks for your time and attention.
xseticon
installed from snap package on Debian 10.2
I'm trying to set the icon for a Chrome window running JupyterLab
xwininfo
reports Window id: 0x460015a "JupyterLab"
$ xseticon -id 0x460015a /tmp/jupyter.png
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Aborted at function fopen()
$ xseticon -name "JupyterLab" /tmp/jupyter.png
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
xseticon: error: No window with name JupyterLab exists!
The specified png file does exist.
On debian sid, compilation exits with the error:
gcc -lglib-2.0 -L /usr/X11R6/lib -lX11 -lXmu -lgd xseticon.o -o xseticon
/usr/bin/ld: xseticon.o: in function `Window_With_Name':
xseticon.c:(.text+0x210): undefined reference to `XFetchName'
/usr/bin/ld: xseticon.c:(.text+0x25a): undefined reference to `XQueryTree'
/usr/bin/ld: xseticon.c:(.text+0x2c6): undefined reference to `XFree'
/usr/bin/ld: xseticon.o: in function `Select_Window_Mouse':
xseticon.c:(.text+0x5a3): undefined reference to `XCreateFontCursor'
/usr/bin/ld: xseticon.c:(.text+0x5dc): undefined reference to `XGrabPointer'
/usr/bin/ld: xseticon.c:(.text+0x619): undefined reference to `XAllowEvents'
/usr/bin/ld: xseticon.c:(.text+0x63b): undefined reference to `XWindowEvent'
/usr/bin/ld: xseticon.c:(.text+0x6a8): undefined reference to `XUngrabPointer'
/usr/bin/ld: xseticon.o: in function `load_icon':
xseticon.c:(.text+0x72d): undefined reference to `gdImageCreateFromPng'
/usr/bin/ld: xseticon.c:(.text+0x799): undefined reference to `g_malloc0_n'
/usr/bin/ld: xseticon.c:(.text+0x837): undefined reference to `gdImageGetPixel'
/usr/bin/ld: xseticon.c:(.text+0x961): undefined reference to `gdImageDestroy'
/usr/bin/ld: xseticon.o: in function `main':
xseticon.c:(.text+0xa22): undefined reference to `XOpenDisplay'
/usr/bin/ld: xseticon.c:(.text+0xa4a): undefined reference to `XSynchronize'
/usr/bin/ld: xseticon.c:(.text+0xae2): undefined reference to `XGetGeometry'
/usr/bin/ld: xseticon.c:(.text+0xb07): undefined reference to `XmuClientWindow'
/usr/bin/ld: xseticon.c:(.text+0xb45): undefined reference to `XInternAtom'
/usr/bin/ld: xseticon.c:(.text+0xbb4): undefined reference to `XChangeProperty'
/usr/bin/ld: xseticon.c:(.text+0xbd9): undefined reference to `XFlush'
/usr/bin/ld: xseticon.c:(.text+0xbfa): undefined reference to `XCloseDisplay'
collect2: error: ld returned 1 exit status
make: *** [Makefile:21: xseticon] Error 1
On Debian Buster (current testing distro), I got the error:
~/tools/xseticon$ make
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Installing libglib2.0-dev (sudo apt install libglib2.0-dev
) fixed it. Thought you should add that dependency to the README.
Thanks for this handy piece of code!
compiles fine but under TDE anything I try to set the icon on I get a Segmentation fault have tried 128x128 and 32x32 icons
Between the lines // FROM programs/xlsfonts/dsimple.c
and // END FROM
, we currently have the functions
Fatal_Error
Window_With_Name
Select_Window_Args
Select_Window_Mouse
However, I can only find Fatal_Error
in Ubuntu's source of xlsfonts/dsimple.c
.
Are the others your own creation? Then we should adjust the END FROM marker.
Even better would be to write our own Fatal_Error
function as well, because I can't currently see license compatibility.
Maybe it would suffice to have Fatal_Error
be a trivial function that just prints the error message, and a comment for where to find a fancier function (e.g. the Ubuntu link above) if someone wants to make a temporary debug build.
Hi! Thanks for writing this program. A tool like this should be shipped with Xorg by default, IMO.
Why do you have the abortprog("XOpenDisplay");
check only after display
has already been used in XSynchronize
and int screen =
?
Hi,
does this support svg image files? I tried and got a segmentation fault error, so I don't know if it's because I used a svg file or something else.
Thank you :)
This is not an issue.
I cannot find another way to message you.
To build on openSUSE Leap 15.5,
I needed to install gd-devel,
sudo zypper in gd-devel
Other dependencies were already present.
Your hint command line works fine
for XTerm, in WSL, on Windows 10.
Thank you,
Aya.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.