regolith-linux / regolith-desktop

Meta package for the Regolith Desktop Environment
1.5k stars 31 forks source link

i3 Key Bindings Applied Inconsistently #624

Open cwh1te opened 2 years ago

cwh1te commented 2 years ago

Describe the bug Key bindings through i3 are inconsistently applied, sometimes overriding Gnome defaults but sometimes not.

To Reproduce Override some keys that Gnome binds by default using the i3 config:

bindsym XF86AudioRaiseVolume exec --no-startup-id $pulse-set Master 1%+
bindsym XF86AudioLowerVolume exec --no-startup-id $pulse-set Master 1%-

Reboot a few times, observing that sometimes the custom bindings are applied while sometimes one or both will fail to override the default behavior. Sometimes they apply after the first time the assigned key is pressed (default behavior on first key press, custom afterward).

Expected behavior Custom key bindings should override Gnome defaults consistently all the time.

Configuration file(s) i3/custom:

### Volume Control ###
set $volume-osd python3 ~/Code/volume-osd/volume-osd.py
set $pulse-set amixer -D pulse sset

# Output Volume Control
bindsym XF86AudioRaiseVolume exec --no-startup-id $pulse-set Master 1%+ && $volume-osd
bindsym XF86AudioLowerVolume exec --no-startup-id $pulse-set Master 1%- && $volume-osd
bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id $pulse-set Master 10%+ && $volume-osd
bindsym Shift+XF86AudioLowerVolume exec --no-startup-id $pulse-set Master 10%- && $volume-osd
bindsym XF86AudioMute exec --no-startup-id $pulse-set Master toggle && $volume-osd

# Input Volume Control
bindsym Ctrl+XF86AudioRaiseVolume exec --no-startup-id $pulse-set Capture 1%+ && $volume-osd input
bindsym Ctrl+XF86AudioLowerVolume exec --no-startup-id $pulse-set Capture 1%- && $volume-osd input
bindsym Ctrl+Shift+XF86AudioRaiseVolume exec --no-startup-id $pulse-set Capture 10%+ && $volume-osd input
bindsym Ctrl+Shift+XF86AudioLowerVolume exec --no-startup-id $pulse-set Capture 10%- && $volume-osd input
bindsym Ctrl+XF86AudioMute exec --no-startup-id $pulse-set Capture toggle && $volume-osd input

# Screenshot
bindsym $mod+Shift+c exec --no-startup-id spectacle -bcpr

# Container Layout Switching
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

# Custom UI font
font pango:Iosevka 16

# Workspace-to-Monitor Bindings
workspace 1 output DisplayPort-1
workspace 2 output HDMI-A-0
workspace 3 output DisplayPort-2

I combine that with the default i3 config like so:

cat /etc/regolith/i3/config ~/.config/regolith/i3/custom > ~/.config/regolith/i3/config

Xresources:

i3-wm.binding.browser: F1
i3-wm.binding.ws_next: F2
i3-wm.binding.ws_next2: F3
i3-wm.binding.ws_next_on_output: F4
i3-wm.binding.ws_next_on_output2: F5
i3-wm.binding.ws_prev: F6
i3-wm.binding.ws_prev2: F7
i3-wm.binding.ws_prev_on_output: F8
i3-wm.binding.ws_prev_on_outpu2: F9
i3-wm.binding.next_free: F10
i3-wm.binding.move_next_free: F11
i3-wm.binding.settings: F12
i3-wm.binding.display: F13
i3-wm.binding.wifi: F14
i3-wm.binding.bluetooth: F15
i3-wm.binding.sound: F16
i3-wm.binding.files: F17
i3-wm.binding.notification_uiq: F18
i3-wm.binding.bar_toggle: F19
i3-wm.binding.layout_mode: F20
i3-wm.binding.reload: F21
i3-wm.binding.orientation_toggle: F22
i3-wm.binding.launcher.cmd: Alt+space
i3-wm.binding.launcher.window: Alt+tab
i3-wm.binding.up: i
i3-wm.binding.left: j
i3-wm.binding.down: k
i3-wm.binding.right: l
i3-wm.binding.move_up: Shift+i
i3-wm.binding.move_left: Shift+j
i3-wm.binding.move_down: Shift+k
i3-wm.binding.move_right: Shift+l
i3-wm.binding.take_up: Ctrl+Shift+i
i3-wm.binding.take_left: Ctrl+Shift+j
i3-wm.binding.take_down: Ctrl+Shift+k
i3-wm.binding.take_right: Ctrl+Shift+l
i3-wm.binding.split_h: h
i3-wm.binding.split_v: v
i3-wm.binding.float_toggle: Shift+space
i3-wm.binding.focus_parent: a
i3-wm.binding.focus_child: d
i3-wm.gaps.smart: inverse_outer
i3-wm.bar.position: top
i3-wm.program.unclutter: :
i3-wm.gaps.inner.size: 12
i3-wm.program.1: spectacle -s
i3-wm.font: pango:Iosevka 16
i3-wm.bar.font: pango:Iosevka 18, Material Design Icons 16
gnome.terminal.font: Iosevka 14

Installation Details

ferdinandyb commented 2 years ago

Hmm, no idea. Although this is unlikely to be a Regolith specific issue. If this worked before you migrated from arch+i3, then it's an Ubuntu issue, if it's new it could be Ubuntu or i3.

kgilmer commented 2 years ago

FWIW @cwh1te , here is the file which specifies Regolith-session overrides to gnome keybindings: https://github.com/regolith-linux/regolith-default-settings/blob/master/debian/regolith-default-settings.gsettings-override#L7-L9

This is performed once when the package is installed. If you're seeing inconsistent behavior perhaps something else is mutating these dconf values after Regolith is installed. In case you're interested in checking more, I believe dconf has a monitor mode that may help you catch the bandit in the act...

cwh1te commented 2 years ago

I tried monitoring dconf, but the /org/gnome/desktop/wm/keybindings path doesn't seem to exist on my system and monitoring the /org/gnome/desktop/wm/ path showed no output when restarting i3 to fix the failed keybinds (which does not work with any consistency - I've now restarted i3 about a dozen times and one of the keybinds is still being ignored while the others have been applied). I also tried monitoring the /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings path, but the value of that is consistently @as [] regardless of the observed behavior.

ploum commented 2 years ago

Not particularly useful comment: I ran into a similar issue with setting the background (I don’t want any background at all). Dconf was the culprit and adding some keys in dconf + setting "gnome-wallpaper:" to an empty value in Xressources allowed me to solve the issue.

Another one, still unsolved, was to switch the default terminal for xdg-open to kitty. It’s a 10 years old bug in the whole dcong/gsettings stack.

So yeah, it is a problem.