Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Comments

Solved issue with swapping mod keys#39

Open
manucalop wants to merge 1 commit intoregolith-linux:masterfrom
manucalop:master
Open

Solved issue with swapping mod keys#39
manucalop wants to merge 1 commit intoregolith-linux:masterfrom
manucalop:master

Conversation

@manucalop
Copy link

@manucalop manucalop commented Nov 8, 2021

Hi! Essentially there were hardcoded Mod1's in the code. That was generating the conflict when swapping mod keys. Hope it helps!
PS: This PR is associated to this bug regolith-linux/regolith-desktop#504 #504

kgilmer added a commit to regolith-linux/regolith-i3-config that referenced this pull request Nov 9, 2021
@kgilmer
Copy link
Member

kgilmer commented Nov 9, 2021

Thanks for your contribution @manucalop ! I'm testing your change in Regolith 2.0, as that's just easier for me at the moment. Will report back w/ results.

@manucalop
Copy link
Author

Great @kgilmer! Could you give me some guidance for me to perform the testing too? I'm experienced with i3 but I'm quite new contributing to open source... Thanks!

@kgilmer
Copy link
Member

kgilmer commented Nov 9, 2021

Hi @manucalop , sure. I would take your edited version and run Regolith using it and ensure that the configuration works in both "super" and "alt" modes. You can find details on overriding the i3 config file here. You'll need to log out and back in for the new i3 config file to be loaded and you can verify with i3 --moreversion.

@kgilmer kgilmer self-requested a review November 9, 2021 15:36
@kgilmer
Copy link
Member

kgilmer commented Nov 23, 2021

Coming back to this after a bit, so I don't this change as-is will work. I believe that i3 will not expand variables on the right hand side of an expression. Rather, it's treated as a literal and so when i3 evaluates the keybinding expression it fails with the literal $alt.

Works

## Navigate // Previous Workspace // <><Alt> ← ##
set_from_resource $i3-wm.binding.ws_prev2 i3-wm.binding.ws_prev2 Left
bindsym $mod+$alt+$i3-wm.binding.ws_prev2 workspace prev

Broken:

## Navigate // Previous Workspace // <><Alt> ← ##
set_from_resource $i3-wm.binding.ws_prev2 i3-wm.binding.ws_prev2 $alt+Left
bindsym $mod+$i3-wm.binding.ws_prev2 workspace prev

Two solutions:

  1. continue with what we had before, with hardcoded values requiring those wishing to swap to alt to maintain their own configuration files
  2. pull $alt into the left-hand side of the expression. this effectively limits the customization capability of keybindings that use both mod keys.

We could also file a bug against i3 to allow variable expansion on the rhs but it's hard to say how well that would be received.

kgilmer added a commit to regolith-linux/regolith-i3-config that referenced this pull request Nov 23, 2021
@kgilmer
Copy link
Member

kgilmer commented Nov 23, 2021

See the above commit. Trying out option 2 for regolith 2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants