this post was submitted on 04 Jan 2024
23 points (89.7% liked)

Asklemmy

43936 readers
618 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy ๐Ÿ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_[email protected]~

founded 5 years ago
MODERATORS
 

So, i just started using I3 through Arcolinux, it's working pretty nicely all things considered but i'm having one little problem, a game i play uses keys that are very close to a keybind combination that is set here and that makes me accidentally trigger it sometimes, and i wanted to know how, if possible i can make so this keybind is disabled while I'm playing this game, searching for a solution i found this thread on reddit (yeah, lack of better places, but hey I'm asking here now so it's an opportunity to get some info on here!) That seems to be talking about pretty much what i need, buut i have no idea how to create these scripts and all that and i didn't had much success on searching on how to do this kind of thing before so... a little help please? Is there any more efficient method, or something like that?

top 7 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 7 points 10 months ago (1 children)

I use a gaming-mode for that. Like this:

# Create a gaming mode
mode "gaming" {
    # switch to workspace
    bindsym $mod+1 workspace number $ws1 ; mode "default"
    bindsym $mod+2 workspace number $ws2 ; mode "default"
    bindsym $mod+3 workspace number $ws3 ; mode "default"
    bindsym $mod+4 workspace number $ws4 ; mode "default"
    bindsym $mod+5 workspace number $ws5 ; mode "default"
    bindsym $mod+6 workspace number $ws6 ; mode "default"
    bindsym $mod+7 workspace number $ws7 ; mode "default"
    bindsym $mod+8 workspace number $ws8 ; mode "default"
    bindsym $mod+9 workspace number $ws9 ; mode "default"

    # move focused container to workspace
    bindsym $mod+Shift+1 move container to workspace number $ws1
    bindsym $mod+Shift+2 move container to workspace number $ws2
    bindsym $mod+Shift+3 move container to workspace number $ws3
    bindsym $mod+Shift+4 move container to workspace number $ws4
    bindsym $mod+Shift+5 move container to workspace number $ws5
    bindsym $mod+Shift+6 move container to workspace number $ws6
    bindsym $mod+Shift+7 move container to workspace number $ws7
    bindsym $mod+Shift+8 move container to workspace number $ws8
    bindsym $mod+Shift+9 move container to workspace number $ws9
    bindsym $mod+Shift+0 move container to workspace number $ws10
}

# Enter the gaming mode when a game is started
for_window [class="^steam_app_"] move to workspace $ws10; workspace $ws10; mode "gaming"
for_window [class="^hl2_linux"] move to workspace $ws10; workspace $ws10; mode "gaming"

This automatically moves (most) games to workspaces 10 and switches to that workspace. This allows me to use key combinations that would otherwise be used by i3.

[โ€“] Quills 2 points 10 months ago (1 children)

It took me a while of looking at it and a youtube video but i think i got what this does, it's really pretty much what i need! Thank you very much for sharing it, didn't really knew about this groups thing

[โ€“] [email protected] 2 points 10 months ago

I have been in the same spot. Good to read that I've been able to help out. Have fun with this in combination with your gaming!

[โ€“] [email protected] 1 points 10 months ago (1 children)

I use hyprland, but what I do may help (and open the door to all other stupid shit and ways to rice rather than work) Rather than having keybinds to focua a direction, I have it run a script that dumps info about the window or workspace it might move into. It then decides what to do based on the window. In your case, you can have it bind/unbind they key of interest.

And remember kids. Asking questions to proprietary generative AI enshitifies everything for everyone.

[โ€“] Quills 1 points 10 months ago

Seems nice, but i don't know if i got it... How would i do that? i don't have much of experience with all this script stuff...

[โ€“] [email protected] -1 points 10 months ago (1 children)

I asked bing because I miss using I3, and here's the short version of what it gave me.

bindsym --release --no-repeat $mod+Shift+q [class="Firefox"] nop

Might have to fiddle with it, but then dropped the command into a new chat and had it explain what it does, and it figured out that it should use nop when Firefox is focused.

So, hope it helps some. Now I'll go think about getting back to i3 somehow.

[โ€“] [email protected] 2 points 10 months ago

Don't feed the beast