bbidulock / icewm

A window manager designed for speed, usability, and consistency
Other
590 stars 100 forks source link

Issues with keyboardLayout switcher and picom #632

Closed dancer69 closed 1 year ago

dancer69 commented 2 years ago

I recently starting to use icewm on arch linux(using icewm2 1.4.2-5 version) and I have 2 issues:

  1. When icewmbg sets the background picom stop working. If I restart picom afterwards, then the background changes to a dark grey color. If then I change the theme for e.g to another one which has a background color setting, picom crash again. So I cannot have a background in icewm with picom enabled.
  2. I'm using an xorg config file to set keyboard layouts and switch them with alt_shift. This works fine on icewm(as with other DEs/WMs), but when I enable the option for keyboard layout switch the shortcut doesn't work anymore. I can change the layouts from icon in taskbar but not with the alt_shift shortcut. The tooltip in icon shows:

rules: evdev model: pc105 layout: us options: grp:alt_shift_toggle

but the shortcut not working. Seems that those are bugs but maybe I' m doing something wrong.

gijsbers commented 2 years ago

That icewm2 package on AUR is a nuisance. Better consult https://archlinux.org/packages/?q=icewm. Also check your picom version. It should be at least 8.2: https://archlinux.org/packages/?q=picom.

dancer69 commented 2 years ago

I changed it with 2.9.3-1. Also picom is 8.2 version, but nothing changed. Still the background changes to a gray color when picom run. The only change is that picom doesn't crash, when I change theme, but the background is always a gray color. Also no difference with keyboardLayout switcher.

gijsbers commented 2 years ago

Turns out the first is a common bug with picom: https://wiki.archlinux.org/title/Picom#Unable_to_change_the_background_color_with_xsetroot

You can also create a solid image as desktop background image:

convert -size 1920×1080 xc:rgba\(000,111,222,1.0\) background.png

We'll add a workaround for this someday.

gijsbers commented 2 years ago

Please explain in detail how you "enable the option for keyboard layout switch" with Alt+Shift, because that is totally unclear to me. What, how, where, which file?

dancer69 commented 2 years ago

In /etc/X11/x.org.conf.d/00-keyboard.conf:

Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us,gr"
        Option "XkbModel" "pc105"
        Option "XkbOptions" "grp:alt_shift_toggle"
EndSection
gijsbers commented 2 years ago

That is not related to icewm. We can't fix X11 bugs.

dancer69 commented 2 years ago

This is a global X11 configuration and works everywhere. It works with kde, xfce, cinnamon, fluxbox, openbox and others. It's also works with icewm. Only when I use the keyboardLayout switcher doesn't work. So seems to me that this function of icewm blocks it.

gijsbers commented 2 years ago

Two programs trying to control the same function is problematic. Make a choice.

Or carefully study all the available documentation until you understand it much better than me and then try to teach me the fine details.

gijsbers commented 2 years ago

This fixes the icewmbg background color with picom. It also retains the background pixmap when icewmbg exits as a temporary resource, if there is only one image or color. This is a nice improvement. Thanks!

gijsbers commented 2 years ago

You didn't tell us your KeyboardLayouts setting. Makes it difficult to help if people keep on refusing to give relevant details. The solution to your keyboard problem is probably that you need to set it like:

KeyboardLayouts="us,gr -option grp:alt_shift_toggle"

which works for me. Just read the man pages for icewm-preferences and setxkbmap.

dancer69 commented 2 years ago

I didn't refuse anything, I just didn't understand what you need to know. I answered on "how you enabled he option for keyboard layout switch with Alt+Shift" with the contents of 00-keyboard.conf because that was the way I enabled this option. In icewm's preferences file I just had: keyboardLayouts="us","gr" I didn't know that I could use(and needed to use) parameters in this option. The description in man is: A comma-separated list of keyboard layouts. and I did this. Also mentions: To support changing keyboard layouts, the "setxkbmap" program must be installed., which is. But it doesn't mention that I can and need to use parameters of setxkbmap. Also I tried the way you posted but it doesn't work either. with: KeyboardLayouts="us,gr -option grp:alt_shift_toggle" there is only "us" layout and in list of layouts there is only 1 item with name "us,gr -option grp:alt_shift_toggle". The same thing happened to me when I set the layouts like this: KeyboardLayouts="us,gr To have a list of 2 layout needed to put it like this: KeyboardLayouts="us","gr" So, what is inside "" is one list item and if this is "us,gr -option grp:alt_shift_toggle", this is the 1 item of the list.

gijsbers commented 2 years ago

it was a general remark. don't take it personal. the man page reads:

A comma-separated list of keyboard layouts.  A layout may be
enclosed in double quotes.  Each layout is a name with optional
arguments, which is to be parsed by the "setxkbmap" program.

a name with optional arguments, which is to be parsed by the "setxkbmap" The full power of setxkbmap is there for anyone who can do man setxkbmap.

lathanasiadis commented 2 years ago

You didn't tell us your KeyboardLayouts setting. Makes it difficult to help if people keep on refusing to give relevant details. The solution to your keyboard problem is probably that you need to set it like:

KeyboardLayouts="us,gr -option grp:alt_shift_toggle"

which works for me. Just read the man pages for icewm-preferences and setxkbmap.

This doesn't reflect the change in the taskbar icon for me (IceWM version 2.9.4 on Fedora 35) I removed everything having to do with layout switching from my keys and startup files and rebooted, but the problem persists.

gijsbers commented 2 years ago

Whenever the keyboard layout changes, icewm parses the output of setxkbmap -query. As long as that output remains identical, icewm can't change the icon. Does that answer your question?

elderkeltir commented 2 years ago

@gijsbers hey there! KeyboardLayouts="us,gr -option grp:alt_shift_toggle" and setxkbmap -query don't work together because output query will always return layout: us,gr. I'm not sure how to fix this, but it would be awesome to have this fixed :-) basically this will close the case with managing keyboard layouts in icewm: both switching and displaying layout info.

Assigning distinct shortcuts for each layout works fine tho.

AndreyBarmaley commented 2 years ago

I am also use IceWM and wrote a qxkb5 switcher. It works perfectly.

https://github.com/AndreyBarmaley/qxkb5