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 Mon 28 Jul 2014, 21:18
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Assign (or change) window icons in Openbox
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
cimarron

Joined: 30 May 2013
Posts: 84

PostPosted: Mon 28 Oct 2013, 12:04    Post subject:  Assign (or change) window icons in Openbox  

This is easy in JWM, but I couldn't find a way in Openbox to assign window icons to applications that didn't have them built in (the little icons that appear on the titlebar and in the taskbar). And I was seeing a lot of default Openbox icons. If anyone has a better way to do this, please share.

The best I could come up with is a little script that is run as the application launches, and it assigns an icon using xseticon. To find the window ID, I use xdotool and assume the newly launched application is the focused window. The application is launched with a command like this:
Code:
firefox "$@" & icon-me firefox.png 25

The png is the image I want to assign as the icon, and the number at the end is a delay in seconds to make sure the application fully launches before this "icon-me" script is run (save in, say, /usr/local/bin and give permissions to execute):
Code:
#!/bin/bash

sleep $2
ID=$(xdotool getactivewindow)
xseticon -id $ID /usr/share/pixmaps/$1

The delay can be varied by application (usually 2-5 seconds is enough, but big applications like Firefox can take longer). The icons are placed in /usr/share/pixmaps.

Here's xdotool provided by technosaurus (just unpack and place in /usr/bin), and a deb package of xseticon, which I think will install in all Debian and Ubuntu compatible pups:
xseticon.tar.gz
Description 
gz

 Download 
Filename  xseticon.tar.gz 
Filesize  7.17 KB 
Downloaded  114 Time(s) 
xdotool.tar.gz
Description 
gz

 Download 
Filename  xdotool.tar.gz 
Filesize  30.27 KB 
Downloaded  114 Time(s) 
Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2285
Location: Germany

PostPosted: Sun 03 Nov 2013, 17:27    Post subject:  

Hi.

I'm creating automatically symbolic links of all icons from /usr/share/pixmaps and also from /usr/local/lib/X11/pixmaps to /usr/share/icons/hicolor/48x48/apps and after this doing a refresh of gtk icon cache:
Code:
gtk-update-icon-cache -f /usr/share/icons/hicolor/

When writing a bash script it's usually needed to give the icons name only (without path and extension), to have application icon shown in an openbox window.
Code:
<window title=\"$m_01\" icon-name=\"lazy_remaster\" resizable=\"false\">

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

Joined: 29 Oct 2013
Posts: 31

PostPosted: Mon 04 Nov 2013, 05:20    Post subject:  

You need to stop using Puppy-only place for installing icons /usr/local/lib/X11/pixmaps, that's simply wrong, maybe it was ok when puppy was first made and it had some window manager that looked like win 95, but now it's wrong. Too bad Puppy developers don't know what is proper place to put icons, and because of that Gtk2 and Gtk3 applications had to use those ugly fallback icons.
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 10936
Location: Arizona USA

PostPosted: Mon 04 Nov 2013, 08:46    Post subject:  

Where should they be, and why?
Back to top
View user's profile Send private message 
cimarron

Joined: 30 May 2013
Posts: 84

PostPosted: Mon 04 Nov 2013, 10:21    Post subject:  

Just to clarify, I'm not trying to assign icons to applications I wrote, but applications I installed (such as Firefox and SpaceFM) that didn't seem to have window icons, at least not ones that worked for me with Openbox. I tried putting icons in the locations suggested (like /usr/share/pixmaps and /usr/share/icons/hicolor...), with very limited success. I mostly kept seeing the default Openbox window icon.

There were also a few icons I wanted to change (like Geany, SMPlayer). In JWM, icons can be assigned in a config file according to window name or class, but Openbox doesn't seem to have this capability.

So this howto offers a simple way to assign a (new) icon automatically as the application launches. Not perfect, but the best solution I've found so far.


EDIT: I figured out how to manually install a new icon theme, and that fixed several of the missing window icons. But a few were still missing, and I wanted to change a few others that didn't use the icon theme I installed. This method works pretty well for that.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
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.0658s ][ Queries: 12 (0.0139s) ][ GZIP on ]