justbuchanan / i3scripts

My scripts for enhancing i3wm
Other
162 stars 45 forks source link

Arduino not renaming #10

Closed edn9 closed 6 years ago

edn9 commented 6 years ago

pacman -Ss arduino community/arduino 1:1.8.5-1 [instalado] Manjaro i3.

Looks like Arduino its not working, I used this command:

~ $ xprop | grep WM_CLASS WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "processing-app-Base"

So I put it in the autorename_script, but I still get the default icon.

'processing-app-Base':'',
'sun-awt-X11-XFramePeer':'',
'arduino':'',
'JAVA_TOOL_OPTIONS':'',

DEFAULT_ICON = '*'

The Icon I made and the font its already working in other programs. Font: https://github.com/necronoise/necrofont

justbuchanan commented 6 years ago

I took a look and the issue here is that the script does a case-insensitive lookup to find the correct icon. It does this by requiring that the window class names in WINDOW_ICONS are lowercase, then does something like icon = WINDOW_ICONS[WM_CLASS.lowercase()].

If you change 'sun-awt-X11-XFramePeer' to 'sun-awt-x11-xframepeer', it should work.

I added a check in https://github.com/justbuchanan/i3scripts/commit/14014e8ad182752a20966629c15e81c3eed60664 that should make this clearer - it will now print out an error and exit the program if you attempt to add a window class that isn't lowercase.

justbuchanan commented 6 years ago

Actually scratch that - instead of failing when an uppercase name is present, it now just lowercases it for you. If you pull the latest version of the script now, it should just work™.

edn9 commented 6 years ago

Working awesome, thank you! http://i.imgur.com/ZBK3xPD.png