Skip Navigation
i3 Window Manager

About

Community for the i3 window manager and its popular fork i3-gaps.

Resources

Members
309
Posts
24
Active Today
1
Created
4 yr. ago
  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    Remapping CapsLock to be the Compose key, and double-Shift to be the new CapsLock

    If you type anything like I do, the CapsLock key gets very little use on your keyboard. Add the following lines to your i3 config file to remap it to be the Compose key, and use double-Shift as an alternate CapsLock for the infrequent occasions when it's needed:

     undefined
        
    # Remap CapsLock to Compose                                                      
    exec setxkbmap -option compose:caps                                              
                                                                                     
    # Both shift keys enable CapsLock and one shift key cancels it                   
    exec setxkbmap -option shift:both_capslock_cancel    
    
      

    This should work in most Linux distro. To find out if it will work in yours, type:

     undefined
        
    $ grep compose:caps /usr/share/X11/xkb/rules/base.lst
    $ grep shift:both_capslock_cancel /usr/share/X11/xkb/rules/base.lst
    
      

    If the combos are listed in base.lst, they will work.

    There are other ways to rem

  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    Auto-restart a program without drama

    I've been having problems with nm-applet that crashes on a regular basis lately. Apparently I'm not the only one, but it's not often enough to do anything about it apart form restarting it when it drops off the system tray.

    I got tired of doing it by hand, so I got i3 to do it for me of course 🙂

    If you too need to start a program at login and keep restarting it if it stops, you might find this little trick useful:

    In case you didn't know, exec and exec_always in the i3 config file don't directly call an executable, but rather execute the command in a shell. So naturally, you can run an inline shell script rather than a single command.

    So in my case, instead of this line in my i3 config file:

     undefined
        
    exec --no-startup-id nm-applet
    
    
      

    I have this line:

     undefined
        
    exec --no-startup-id while [ 1 ]; do nm-applet; sleep 0.2; done
    
      

    The latter is a one-liner equivalent of running the following shell script inside the shell that i3 cal

  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    The ancient one lives again

    I rescued this Pentium 4 from the landfill a couple days ago. I initially intended to cannibalize its 3"1/2 and 5"1/4 drives, but upon closer inspection, it also had a DAT drive, a DVD burner and it was a pretty nicely specced machine for its time - 2005:

    It was running XP Pro and I left it there, because why not. But I also installed 32-bit Debian on another partition.

    I tried running Gnome but, although it's usable, it's slow enough to be annoying.

    i3 however is no problem of course 🙂 The machine really is no slouch: I was planning to keep it around to read dead media formats, but I might in fact use it for something or other for real, because i3 really makes it decently speedy.

  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    Enable / disable an external display in i3

    Every once in a while, I connect my laptop to my TV at home and watch a movie on my hard drive. So I configured the external display in Xorg in my i3 configuration file and it works fine.

    The problem is, the external display is enabled even if it's not connected, so the mouse regularly "disappears" off the right of the laptop screen.

    Worse, when I run Cinnamon in Xephyr (a windowed environment), the display spans the entire virtual display including the invisible external display, and I only see the left half of the windows in fullscreen mode.

    So I needed some way to configure the external display as secondary display, but start it off, and then define a key binding to turn it on and off as needed.

    Here are the relevant config file lines to achieve this, if you have the same need:

     undefined
        
    # Configure multimonitor layout. Start with the secondary display off            
    set $display1 eDP                                                                
    set $display2 HDMI-A-0             
      
  • i3 Window Manager @lemmy.ml
    amarok @discuss.tchncs.de

    disable red workspace notification on i3wm startup

    Today I was looking for a solution how to disable the urgency hint for programs which I automatically launch in my i3 config file on startup.

    I have saved the layout of my workspace number 2 (see https://i3wm.org/docs/layout-saving.html for the docs) and in my i3 config I attach that layout to workspace number 2 and I also launch some programs (applications) there. Then I let i3-msg switch to workspace 1 so I see the wallpaper. But the launched programs on workspace 2 launch just after that (I guess a few milliseconds later) so they are not focused and i3 changes the workspace color to red, which is annoying because I have to switch to workspace 2 and back to workspace 1 to get rid of the red color.

    Solution: put this Bash script to your i3 config folder, in my case the full path is ~/.config/i3/urgency_off.sh and make the file executable.

     undefined
        
    #!/bin/sh
    # Disable urgency hint of all opened windows on i3wm startup.
    # Add it to i3 config as exec.
    
    sleep 2
    
    for i in $(xdotool searc
      
  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    Blender4 OS-Key middle-button emulation incompatibility with i3

    This problem is rather obscure but I'll leave the solution here in case someone else runs into it and struggles to understand what's going on.

    If you use Blender with a mouse that doesn't have a 3rd button, you can use either Alt or what Blender calls "OS-Key" to navigate: set it in Preferences â–¶ Input â–¶ Mouse â–¶ Emulate 3 Button Mouse in Blender.

    OS-Key is typically the Windows / Super key on a PC, or the ⌘ Command key on a Mac. In other words, for most of us, it's the magic i3 key.

    Alt works fine. The problem comes if you want to use OS-Key instead in Blender and you have floating_modifier $mod defined in your ~/.config/i3/config file: Blender3 doesn't seem to mind sharing the key with i3, but Blender4 does.

    If OS-Key doesn't work in Blender, try assigning floating_modifier to some other key, like Alt for example, like so:

    floating_modifier $Mod1

  • i3 Window Manager @lemmy.ml
    iacus @lemmy.ml

    Window content shrinking in some GTK apps

    I've been having some problem lately with windows "shrinking". They get a wide empty inner border when not in focus, but only if they are not the only window on the workspace, or otherwise maximized (i.e. in a tabbed parent that takes the whole workspace).

    It only happens in i3. I also tested it in gnome and apps don't do that.

    Examples (I'm using Evince here, but I've seen it happen with Firefox, Thunderbird and others)

    Only window on workspace:

    Multiple windows on workspace, unfocused. Note the inner border:

    Multiple windows, focused:

    I know it's not necessarily i3's fault, but any ideas o

  • i3 Window Manager @lemmy.ml
    amarok @discuss.tchncs.de

    i3wm: how to map numeric keys on keypad

    This is a HOW TO, not a question :-)

    Binding numeric keys (for example KP_1 or KP_0) is not as easy as it might seem. A simple bindsym $mod+KP_1 does NOT work in X11 (but maybe it works in Wayland?).

    Solution

    for example to define a key binding to switch to workspace 1 we can use: bindsym $mod+Mod2+KP_1 workspace number $ws1

    Background info: Mod2 specifies the numlock key (although xev reports it's called Num_Lock with code 77). Mod2 is not a key to be pressed, it seems to be the numlock state, so +Mod2 means the keybinding is active with num_lock enabled.

  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    Making Flameshot's "Choose an app to open the capture" option work in i3wm

    If you use the Flameshot screenshot capture and annotation utility, you might have noticed that the Choose an app to open the capture (or Ctrl-O) option doesn't work right: something flashes quickly on the screen but nothing happens.

    That's Flameshot throwing a fit because it can't open a popup window with the size it wants in i3. So to make this option work, let it 🙂

    Add this line to your .config/i3/config:

    for_window [class="flameshot"] floating enable

    As a bonus, it also makes the configuration screen look better.

  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    Workspace assignment doesn't work with fullscreen apps

    Before I open an issue, I'd like to know if anybody has encountered and solved this issue:

    I want certain applications to open in a particular workspaces so naturally I have lines such as these in my ~/.config/i3/config file:

     undefined
        
    assign [title="^.*LibreWolf.*$"] $ws1
    assign [class="org.remmina.Remmina"] $ws2                         
    assign [title="^.*Thunderbird.*$"] $ws4
    assign [class="Signal"] $ws4
    assign [title="^.*ssh tunnels.*$"] $ws5
    
    
      

    This works fine for windowed applications, but it doesn't work for fullscreen ones. For example, if I have those two lines:

     undefined
        
    assign [title="Xephyr"] $ws3                                                     
    assign [title="feh"] $ws3                                                        
    
      

    and I start Xephyr or feh fullscreen with Xephyr :1 -fullscreen or feh -F, they will start fullscreen in whichever workspace I happen to be and won't be moved to workspace 3.

    I did find a workaround by

  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    Mouse click autorepeat

    I have a need to repeatedly click in an application's window many times for testing purposes at work. Since I have no intention of doing that manually and developing RSI, I set up i3 to automate this for me.

    You may find this useful too - for gaming, for instance.

    Setup:

    • Install xdotool
    • Create a Bash script called start_stop_autoclick.shsomewhere (I have a ~/scripts directory in my home directory for that purpose):
       undefined
          
      #!/bin/bash
      
      DELAY=$1
      BUTTON=$2
      CMD=xdotool
      ARGS="click --delay $DELAY --repeat 99999999999999999 $BUTTON"
      
      PID=$(ps -C $CMD -o pid,cmd | awk "/$ARGS/ {print \$1}")
      if [ "$PID" ]; then
        kill $PID
      else
        $CMD $ARGS
      fi
      
      
        
    • Edit ~/.config/i3/config and add the following lines:
       undefined
          
      # Start / stop autoclick
      
      bindsym $mod+Ctrl+button1 --whole-window exec --no-startup-id /bin/bash ~/scripts/start_stop_autoclick.sh 250 1
      bindsym $mod+Ctrl+button2 --whole-window exec --no-startup-i
        
  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    Automatically run commands as root with Rofi

    If you need to run commands as root regularly with Rofi, you may find this useful.

    So let's say you want to run usb-creator-gtk to create a bootable USB stick. You have write access to the USB stick's block device but it's not enough: you need to become root.

    You can of course open a terminal and run sudo usb-creator-gtk. But it's kind of tedious if you need to do that more than once.

    If you want to permanently run that command as root, do this:

    • sudo visudo to edit the /etc/sudoers file.
    • Add the line yourusername ALL = NOPASSWD: /usr/bin/usb-creator-gtk
    • Confirm that you can now run the command as root without being asked your password: sudo usb-creator-gtk should pop the USB Creator window rightaway.
    • Create a desktop entry in your home directory that will override the system-wide one: cp /usr/share/applications/usb-creator-gtk.desktop ~/.local/share/applications/

    That way, when Rofi looks for available app

  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    Best clipboard for i3wm

    My preference is Diodon - especially with the Add images to clipboard history option enabled. And if you enable the Application Indicator plugin, it lhappily stays as an icon in your system tray.

    The perfect clipboard for i3.

  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    Quickly access your Remmina profiles in i3wm

    I use Remmina all the time to access remote computers through RDP and VNC. But it's annoying in i3 to open the main window, select a profile, then close the main window to leave just the remote session window.

    Remmina does have a command line option to dock into the system tray using appindicator (the -i option, i.e. "start as a tray icon") and right-clicking the icon does provide a quick access to saved profiles.

    However, there's a problem with it: when the last window closes, Remmina exits instead of staying docked in the systray- Unfortunately, the Remmina folks won't fix it - and in fact plan of killing the systray icon altogether.

    There's always the possibility of making a small shell script that restarts Remmina each time it closes. The problem with that approach is, it a Remmina process doesn't terminate cleanly and stays in the background for some reason (it happens, especially if i3 is closed unexpectedly) then you have

  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    Most useful bindings

    Here are a few bindings in my i3 config file that I find super useful (bear in mind that I use a Kensington Expert Mouse and Button8 is a suitably unusual but still easily clicked button on that trackball, so you may want to change it to something more suitable to your preferred pointing device):

     undefined
        
    # Clicking the title bar with the upper-right button closes the window (regular default binding, just different button)
    bindsym --release button8 kill
    
    # Scrolling over any window title bar controls the volume
    bindsym button4 exec pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3bar
    bindsym button5 exec pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3bar
    
    [...]
    
    bar {
    
            [...]
    
            # Clicking the empty space in the bottom bar with the upper-right button opens the launcher
            bindsym button8 exec "rofi -modi drun,run -show drun"
    
           
      
  • i3 Window Manager @lemmy.ml
    ExtremeDullard @lemmy.sdf.org

    Electron app won't close in i3

    I still use the old - and last - official Linux .deb package for Teams and sure enough, it doesn't behave properly in i3: Teams starts and shows up in the systray but the window is fullscreen and won't close. I have to keep a workspace around just for Teams.

    I suspect Electron of course. Electron doesn't integrate well with any Linux desktop environment. Just wondering if someone knows if there's a trick to make it close in i3.

  • i3 Window Manager @lemmy.ml
    chocolatine @lemmy.world

    Screen goes black when switching to fullscreen in vlc or mpv

    Hello,

    I have this issue where, when playing any video on VLC or MPV, screen goes black if I switch to full screen mode. Audio is playing fine, and if I go back to windowed mode, video comes back after a couple of seconds.

    I tried with Dragon player (same video file) and it is working fine.

    Any idea on what could be the issue ? I have a nvidia card running on proprietary drivers.

    Thanks

  • i3 Window Manager @lemmy.ml
    Hercules @lemmy.world

    i3bar show network up and down rates

    Hey, im trying to config my i3status bar so that it shows the amound downloaded + uploaded /sec i cant find something on it is this possible? Thanks for your time!

  • i3 Window Manager @lemmy.ml
    doidera @lemmy.eco.br

    Auto move focus with new window to another workspace

    So is it possible to configure?

    Lets say I click a link on the terminal in Workspace 1 and I have Firefox Open in Workspace 2, I want to auto focus firefox in workspace 2 because I clicked the link.


    Answer: focus_on_window_activation focus`

  • i3 Window Manager @lemmy.ml
    vosjedev @lemm.ee

    How to disable colored dots on workspace indicators

    How do I remove the dots in my i3bar?
    I made a screenshot of the dots here:
    dots.png (sorry for linking to my own site, lemmy complains about image being to big for no reason)