i3

Before proceeding, be aware that I deprecated this i3 config on August 22nd, 2020, meaning I won’t update it anymore unless I use it again some day in the future. I will keep it on my website though.

i3 is a window manager for GNU/Linux which automatically tiles windows in workspaces. This configuration was ade to automatically handle some tasks such as which software allowed where, autostart, and launching software with shortcuts.

It is to be noted I am using Airblader’s fork of i3open in new window, i3-gaps. Some configuration will not work with i3.

Screenshots

img

img

img

Variables declaration

Global

The first I do is declaring the modifier key and the alt key —I don’t find the names Mod1 and Mod4 to be explicit enough. This will map $mod to the Super key (or as some people unfortunately call it, the Windows key) and $alt to the Alt key.

Let’s also bind the $up, $down, $left and $right variables to respectively the up, down, left, and right arrows on the keyboard. Why bind them to variables? If I ever want to modify the arrow keys to some other keys, like é, a, u, and i (the equivalent of wqsd on the bépo layout) or c, t, s, and r (the equivalent of hjkl on the bépo layout), I will just have to modify these four lines.

I’ll also set the $term variable. A lot of shortcuts in my i3 config rely on the terminal emulator itself to launch commands in the terminal, and thus call the terminal itself. If I ever need to move from my current terminal, I will just have to change the name of the executable here.

variablevalue
$modMod4
$altMod1
$upUp
$downDown
$leftLeft
$rightRight
$termst
variablevalue
$exiti3i3-nagbar -t warning -m ‘Leave i3?’ -b ‘Yes’ ‘i3-msg exit’
$lockscreenLucien Cartier-Tilet\n(Phuntsok Drak-pa)\n+33 (0)6 83 90 56 89
$rofiexecrofi -combi-modi ‘window,drun’ -show combi -mohh combi -m -1 -show-icons
$mailemacsclient -c -e ‘(mu4e)’ -n
$ecemacsclient -c -n
$walsetwal -i ~/Pictures/Wallpapers -o wal-set

Variables will be set like so.

set $term st

Finally, some variables hold some long strings for commands I don’t want to have to type multiple times. Here is the configuration:

set $mod Mod4
set $alt Mod1
set $up Up
set $down Down
set $left Left
set $right Right
set $term st
set $exiti3 "i3-nagbar -t warning -m 'Leave i3?' -b 'Yes' 'i3-msg exit'"
set $lockscreen "Lucien Cartier-Tilet\n(Phuntsok Drak-pa)\n+33 (0)6 83 90 56 89"
set $rofiexec "rofi -combi-modi 'window,drun' -show combi -mohh combi -m -1 -show-icons"
set $mail "emacsclient -c -e '(mu4e)' -n"
set $ec "emacsclient -c -n"
set $walset "wal -i ~/Pictures/Wallpapers -o wal-set"

Now comes the font for the window tiles. Honestly, this setting is useless since we do not see it, but let’s set it anyway.

font Fira Sans Book:style=Book:pixelsize=10

Floating windows

Floating windows are windows that are not tiled with other windows, but rather are free to go anywhere on your screen, with any size. A bit like what you would get with any other non-tiling window manager or desktop environment (though most of them support minimal tiling features).

Let’s declare our floading modyfier. With floating windows, you can move them around by clicking on the window’s borders; but since we don’t have any with this config, we will have instead to press the floating modifier while clicking on the window (anywhere on the window is fine) to move them around.

Here is the configuration:

floating_modifier $mod

i3 global settings

Some settings affect i3 globally, such as its aspect or how it handles the mouse. Hence, here are some settings I set in my configuration.

Mouse settings

First of all, I do not want i3 to warp my mouse each time I change windows; my mouse stays where it is.

mouse_warping none

I also to not want the window focus to follow my mouse, because sometimes I will just knock my physical mouse out of the way of my hand, and when I do that the software mouse will most likely end up in another window I do not want to focus.

focus_follows_mouse no

While in fullscreen, some software might generate a popup. In that case, I want to be aware of that, and any popup will make me leave fullscreen in order to be presented with said popup.

popup_during_fullscreen leave_fullscreen

Behavior of workspace changes

When changing workspace as described below, we often want to go back to the previous workspace we were working on, but we might not remember immediately which one it was, or we might still have our fingers ready to fire the shortcut which made us make the first workspace change. Hence, if we type the same workspace change shortcut, instead of doing nothing it will bring us back to the previous workspace we were on.

workspace_auto_back_and_forth yes

Gaps and window appearance

As mentioned in at the beginning of this document, I am using i3-gaps, which brings spacing (gaps) between windows to i3.

First, I want space around my windows only when there are several containers on the same screen, otherwise they will be maximized.

smart_gaps on

I also do not want to see any window border, so I will be turning this setting off.

smart_borders on

By the way, the default border is invisible, since it is zero pixels wide.

default_border pixel 0

Then comes the size of these gaps. I made the outer gap negative so the space between my windows and the border of my screens is smaller than the gap between my containers.

gaps inner 20
gaps outer -10

Some parameters are also available when it comes to the colors i3 uses. Honestly, we won’t see these colors much, so let’s simply keep the default values.

set_from_resource $fg i3wm.color7 #f0f0f0
set_from_resource $bg i3wm.color2 #f0f0f0

# class                 border  backgr. text indicator child_border
client.focused          $bg     $bg     $fg  $bg       $bg
client.focused_inactive $bg     $bg     $fg  $bg       $bg
client.unfocused        $bg     $bg     $fg  $bg       $bg
client.urgent           $bg     $bg     $fg  $bg       $bg
client.placeholder      $bg     $bg     $fg  $bg       $bg

Assigning windows to workspaces

I decided to bind some windows to some workspaces in order to have a better organization of my desktop.

ApplicationClassWorkspace
EmacsEmacs2
ChromiumChromium3
Firefoxfirefox3
NemoNemo4
WonderdraftGodot5
GimpGimp*6
Gnome Boxesgnome-boxes8
SteamSteam9
Discorddiscord10

The class table is used in the assignment in the i3 config file. For instance, Gimp’s assignment will look like this:

assign [class="Gimp*"] 6

Here is the configuration:

assign [class="Emacs"] 2
assign [class="Chromium"] 3
assign [class="firefox"] 3
assign [class="Nemo"] 4
assign [class="Godot"] 5
assign [class="Gimp*"] 6
assign [class="gnome-boxes"] 8
assign [class="Steam"] 9
assign [class="discord"] 10

And although this is not specifically assigning a window to a workspace, I also want to have the tenth workspace assigned to a specific output in case I have two screens — and since this is the case when I am using only one computer, Marpa, I will be using some EmacsLisp in order to generate a different configuration file from this org file depending on the name of the machine. Now I’ll call the above code as a noweb reference that should be executed.


Shortcuts

I use A LOT of shortcuts when it comes to my workflow. Like, all the time. So, expect this chapter to be a bit long, and I’ll try to make it readable still.

Shortcuts are set like so:

bindsym shortcut command

Terminal shortcuts

I have a couple of shortcuts which are related to my terminal. For instance, $mod+Return opens a regular terminal instance while $mod+$alt+M opens an SSH instance on my Mila host.

shortcutcommandWhat it does
$mod+Returnexec $termOpens a regular terminal console
$mod+$alt+Returnsplit h;; exec $termOpens a terminal console below the current one
$mod+Shift+Returnsplit v;; exec $termOpens a terminal on the right of the current one
$mod+$alt+mexec $term ssh MilaOpens an SSH instance in my Mila host
$mod+$alt+nexec $term ssh NaroOpens an SSH instance in my Naro host
$mod+Shift+hexec $term htopOpens a terminal with htop

Here is the configuration:

bindsym $mod+Return exec $term
bindsym $mod+$alt+Return split h;; exec $term
bindsym $mod+Shift+Return split v;; exec $term
bindsym $mod+$alt+m exec $term ssh Mila
bindsym $mod+$alt+n exec $term ssh Naro
bindsym $mod+Shift+h exec $term htop

i3 shortcuts

A couple of shortcuts are dedicated to i3 itself.

shortcutcommandwhat it does
$mod+Shift+cexec yadm alt && i3-msg reloadReload the i3 configuration file
$mod+Shift+rexec yadm alt && i3-msg restartRestart i3 inplace
$mod+Shift+eexec $exiti3Quit i3

And although this is not really an i3 shortcut per se, I add here the shortcut for launching pywal, which will set one of my wallpapers as the wallpaper and will generate my system’s color configuration from it.

shortcutcommandwhat it does
$mod+wexec $walsetSet a random wallpaper and generates a color profile from it

We also have some shortcuts to lock our screen, sleep, hibernate and shut down our computer.

shortcutcommandwhat it does
$mod+lexec i3lock -folLock the screen
$mod+$alt+hexec “systemctl suspend”Suspend the computer
$mod+Ctrl+hexec “systemctl hibernate”Hibernate the computer
$mod+Shift+F4exec poweroffPower off the computer

Here is the configuration:

bindsym $mod+Shift+c exec yadm alt && i3-msg reload
bindsym $mod+Shift+r exec yadm alt && i3-msg restart
bindsym $mod+Shift+e exec $exiti3
bindsym $mod+w exec $walset
bindsym $mod+l exec i3lock -fol
bindsym $mod+$alt+h exec "systemctl suspend"
bindsym $mod+Ctrl+h exec "systemctl hibernate"
bindsym $mod+Shift+F4 exec poweroff

Window and workspace management

Managing how windows will split

It is possible to indicate to i3 how windows interact with one another, and especially how they are organized by spawning new windows either to the right or below the current window.

shortcutscommandwhat it does
$mod+hsplit hNext window to spawn will spawn below the current one
$mod+vsplit vNext window to spawn will spawn beside the current one

Here is the configuration:

bindsym $mod+h split h
bindsym $mod+v split v

Focus windows

To change window focus, you can use one of the following shortcuts:

shortcutcommandwhat it does
$mod+$leftfocus leftFocus the window left of the current one
$mod+$downfocus downFocus the window down of the current one
$mod+$upfocus upFocus the window up of the current one
$mod+$rightfocus rightFocus the windof right of the current one

Here is the configuration:

bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right

Focus workspaces

Just like windows, it is also possible to change focus between workspaces, because let’s be honest, most people won’t have ten screens to display all ten workspaces at the same time, and frankly that would be impractical.

shortcutwindowwhat it does
$mod+1workspace 1Focus first workspace
$mod+2workspace 2Focus second workspace
$mod+3workspace 3Focus third workspace
$mod+4workspace 4Focus fourth workspace
$mod+5workspace 5Focus fifth workspace
$mod+6workspace 6Focus sixth workspace
$mod+7workspace 7Focus seventh workspace
$mod+8workspace 8Focus eighth workspace
$mod+9workspace 9Focus ninth workspace
$mod+0workspace 10Focus tenth workspace

Here is the configuration:

bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10

Moving windows

To move windows, a couple of shortcuts are available:

shortcutcommandwhat it does
$mod+Shift+$leftmove leftMove the focused window left
$mod+Shift+$downmove downMove the focused window down
$mod+Shift+$upmove upMove the focused window up
$mod+Shift+$rightmove rightMove the focused window right

Here is the configuration:

bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right

Moving containers

To move containers between the available screens, you have the following shortcuts:

shortcutcommandwhat it does
$mod+Ctrl+$leftmove container to output leftMoves the container to the screen left of the current one
$mod+Ctrl+$downmove container to output downMoves the container to the screen down of the current one
$mod+Ctrl+$upmove container to output upMoves the container to the screen above the current one
$mod+Ctrl+$rightmove container to output rightMoves the container to the screen right of the current one

You can also send containers to other workspaces by their number.

shortcutcommandwhat it does
$mod+Shift+1move container to workspace 1Move current container to the workspace 1
$mod+Shift+2move container to workspace 2Move current container to the workspace 2
$mod+Shift+3move container to workspace 3Move current container to the workspace 3
$mod+Shift+4move container to workspace 4Move current container to the workspace 4
$mod+Shift+5move container to workspace 5Move current container to the workspace 5
$mod+Shift+6move container to workspace 6Move current container to the workspace 6
$mod+Shift+7move container to workspace 7Move current container to the workspace 7
$mod+Shift+8move container to workspace 8Move current container to the workspace 8
$mod+Shift+9move container to workspace 9Move current container to the workspace 9
$mod+Shift+0move container to workspace 10Move current container to the workspace 10

Here is the configuration:

bindsym $mod+Ctrl+$left move container to output left
bindsym $mod+Ctrl+$down move container to output down
bindsym $mod+Ctrl+$up move container to output up
bindsym $mod+Ctrl+$right move container to output right
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10

Moving workspaces

It is also possible to move workspaces. The related shortcuts available are the following:

shortcutcommandwhat it does
$mod+Ctrl+Shift+$leftmove workspace to output leftMoves the workspace to the screen left of the current one
$mod+Ctrl+Shift+$downmove workspace to output downMoves the workspace to the screen down of the current one
$mod+Ctrl+Shift+$upmove workspace to output upMoves the workspace to the screen above the current one
$mod+Ctrl+Shift+$rightmove workspace to output rightMoves the workspace to the screen right of the current one

Here is the configuration:

bindsym $mod+Ctrl+Shift+$left move workspace to output left
bindsym $mod+Ctrl+Shift+$down move workspace to output down
bindsym $mod+Ctrl+Shift+$up move workspace to output up
bindsym $mod+Ctrl+Shift+$right move workspace to output right

Close windows

To close windows, we have two main shortcuts: Alt+F4 and mod+q. The first one is here due to habits, but I don’t really use it anymore due to my main keyboard which doesn’t have any easy access to the functions keys, hence mod+q.

shortcutcommandwhat it does
$mod+qkillkill the current window
$alt+F4killkill the current window

Here is the configuration:

bindsym $mod+q kill
bindsym $alt+F4 kill

Manage the size of the current window

It is possible to change the size of the current window, even if it is a floating one. The first shortcut that might interest you is $mod+f which switches your current window to fullscreen. But to resize a window, you will need to enter the resize mode.

shortcutcommandwhat it does
$mod+ffullscreen togglePuts the current window in fullscreen or exits it
$mod+rmode “resize”Enter resize mode

When it comes to modes, they are defined as follows:

mode "nameofyourmode" {
    here go your shortcuts
}

So, all the following shortcuts will be inserted in a mode called resize. Note that not only are the resizing shortcuts bound to the arrow keys, they are also bound to ctsr, which is the bépo equivalent of hjkl.

shortcutcommandwhat it does
$rightresize grow width 20 px or 10 pptIncrease the width of the current window
rresize grow width 20 px or 10 pptIncrease the width of the current window
$leftresize shrink width 10 px or 5 pptDecrease the width of the current window
cresize shrink width 10 px or 5 pptDecrease the width of the current window
$downresize grow height 10 px or 5 pptIncrease the height of the current window
tresize grow height 10 px or 5 pptIncrease the height of the current window
$upresize shrink height 10 px or 5 pptDecrease the height of the current window
sresize shrink height 10 px or 5 pptDecrease the height of the current window
Returnmode “default”Return to the default mode
Escapemode “default”Return to the default mode

If you prefer, you can think of these shortcuts not as increasing or decreasing the width or height of the current window, but rather as how the bottom or right limit of the windows will be moved relative to the top left corner.

Here is the configuration:

bindsym $mod+f fullscreen toggle
bindsym $mod+r mode "resize"
mode "resize" {
    bindsym $right resize grow width 20 px or 10 ppt
    bindsym r resize grow width 20 px or 10 ppt
    bindsym $left resize shrink width 10 px or 5 ppt
    bindsym c resize shrink width 10 px or 5 ppt
    bindsym $down resize grow height 10 px or 5 ppt
    bindsym t resize grow height 10 px or 5 ppt
    bindsym $up resize shrink height 10 px or 5 ppt
    bindsym s resize shrink height 10 px or 5 ppt
    bindsym Return mode "default"
    bindsym Escape mode "default"
}

Manage floating windows

As said above, your windows can be floating windows instead of being tiled like they are by default. For this too we have a couple of shortcuts:

shortcutcommandwhat it does
$mod+Shift+spacefloating toggleToggles the window between tiled and floating mode
$mod+spacefocus mode_toggleToggles the focus between tiled and floating windows
$mod+Ctrl+cmove position centerCenters the focused floating window

If you want to move around your floating window, you can do it with your mouse while holding down the floating modifier declared here.

Here is the configuration:

bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
bindsym $mod+Ctrl+c move position center

Scratchpad and window display

You can think of i3’s scratchpad as some sort of extra workspace in which you can hide your windows you are not using, or as if you want to reduce a window to the taskbar of other window managers or desktop environments. You have basically two shortcuts for the scratchpad: one that sends the current window to the scratchpad, and one that cicles through the windows sent to the scratchpad and shows them to you sequencially. If you go through all of them, they will be hidden again. You can get a window out of the scratchpad by tiling it to the current workspace with the shortcut described above.

You also have the possibility of making a floating window a sticky window. This means not only will it show on all workspaces, it will also be on top of every other window. It can be useful if you have some notes you want to keep an eye on for instance.

shortcutcommandwhat it does
$mod+Shift+smove scratchpadSends the current window to the scratchpad
$mod+sscratchpad showShows and cycles through windows from the scratchpad
$mod+Ctrl+ssticky toggleToggles sticky mode on current window

Here is the configuration:

bindsym $mod+Shift+s move scratchpad
bindsym $mod+s scratchpad show
bindsym $mod+Ctrl+s sticky toggle

Gaps management

It is possible to dynamically change the gaps between containers if we want to change a bit the appearance of i3. For that, we obviously have some shortcuts.

shortcutcommandwhat it does
$mod+ggaps inner current plus 5Increase the inner gap size
$mod+Shift+ggaps inner current minus 5Decrease the inner gap size
$mod+Ctrl+ggaps outer current plus 5Increase the outer gap size
$mod+Ctrl+Shift+ggaps outer current minus 5Decrease the outer gap size
$mod+$alt+ggaps inner all set 20; gaps outer all set -10Reset gaps

Here is the corresponding configuration:

bindsym $mod+g gaps inner current plus 5
bindsym $mod+Shift+g gaps inner current minus 5
bindsym $mod+Ctrl+g gaps outer current plus 5
bindsym $mod+Ctrl+Shift+g gaps outer current minus 5
bindsym $mod+$alt+g gaps inner all set 20; gaps outer all set -10

Launching software

A big part of my i3 shortcuts though are related to launching various software. I’ll try to sort them by category here, but do take a look even at categories which you might not be interested in, they might actually have something useful for you.

Software and command launcher

These commands will allow the user to launch applications which provide .desktop files or user-defined .desktop files, as well as commands with the help of rofi.

shortcutcommandwhat it does
$mod+Shift+dexec –no-startup-id j4-dmenu-desktopLaunch a registered application
$mod+dexec –no-startup-id $rofiexecLaunch a terminal command or a registered application

Here is the configuration:

bindsym $mod+Shift+d exec --no-startup-id j4-dmenu-desktop
bindsym $mod+d exec --no-startup-id $rofiexec

Internet software

I have a couple of Internet-related software I can launch easily.

shortcutcommandwhat it does
$mod+bexec firefoxLaunch browser
$mod+mexec $mailLaunch Gnus, my mail client
Ctrl+Shift+dexec discord-canaryLaunch Discord

Hence this configuration:

bindsym $mod+b exec firefox
bindsym $mod+m exec $mail
bindsym Ctrl+Shift+d exec discord-canary

Screenshots

A couple of shortcuts are available for taking screenshots.

shortcutcommandwhat it does
Printexec –no-startup-id scrotTakes a screenshot of the entire desktop
Ctrl+Printexec –no-startup-id “scrot -s”Takes a screenshot of a region or the selected window
Shift+Printexec –no-startup-id “scrot -d 3”takes a screenshot of the desktop three in three seconds

This gives us this configuration:

bindsym Print exec --no-startup-id scrot
bindsym Ctrl+Print exec --no-startup-id "scrot -s"
bindsym Shift+Print exec --no-startup-id "scrot -d 3"

Screen brightness

Here we have four commands for managing our screen’s brightness (this is useful for laptops, not so much with desktops), and two of them are actually duplicates of the other two in case a laptop doesn’t have dedicated keys or we are using a keyboard which doesn’t provide them.

shortcutcommandwhat it does
XF86MonBrightnessUpexec xbacklight -inc 5Increase the brightness of the screen
$mod+$alt+Nextexec xbacklight -inc 5Increase the brightness of the screen
XF86MonBrightnessDownexec xbacklight -dec 5Decrease the brightness of the screen
$mod+$alt+Prevexec xbacklight -dec 5Decrease the brightness of the screen

This gives us this configuration:

bindsym XF86MonBrightnessUp exec xbacklight -inc 5
bindsym $mod+$alt+Next exec xbacklight -inc 5
bindsym XF86MonBrightnessDown exec xbacklight -dec 5
bindsym $mod+$alt+Prev exec xbacklight -dec 5

Media control

Some shortcuts are dedicated to media control, especially when it comes to controlling music. All of these media control shortcuts will be calls to mpc which will in turn send commands to mpd, which is the music server I use on my computers.

shortcutcommandwhat it does
XF86AudioNextexec mpc nextForward to the next track
$alt+XF86AudioRaiseVolumeexec mpc nextForward to the next track
$mod+Nextexec mpc nextForward to the next track
XF86AudioPrevexec mpc prevBackward to the previous track
$alt+XF86AudioLowerVolumeexec mpc prevBackward to the previous track
$mod+Priorexec mpc prevBackward to the previous track
XF86AudioPlayexec mpc togglePlay or pause the music
$mod+pexec mpc togglePlay or pause the music
$mod+$alt+pexec mpc stopCompletely stop the music
XF86AudioStopexec mpc stopCompletely stop the music
$alt+XF86AudioPlayexec mpc stopCompletely stop the music
$mod+$alt+7exec mpc volume +5Increase the volume from mpd
$mod+$alt+8exec mpc volume -5Decrease the volume from mpd

We also have two shortcuts for launching ncmpcpp, my mpd frontend, either with the playlist open by default, or the visualizes open.

shortcutcommandwhat it does
$mod+Shift+nexec $term ncmpcpp -qLaunch ncmpcpp’s playlist editor
$mod+Shift+vexec $term ncmpcpp -qs visualizerLaunch ncmpcpp’s visualizer

We also have more general shortcuts, like how to manipulate the general volume level.

shortcutcommandwhat it does
XF86AudioMuteexec “amixer set Master 1+ toggle”Mute or unmute audio
Ctrl+$mod+Priorexec “amixer -q set Master 2%+ unmute”Raise volume
XF86AudioRaiseVolumeexec “amixer -q set Master 2%+ unmute”Raise volume
Ctrl+$mod+Nextexec “amixer -q set Master 2%- unmute”Reduce volume
XF86AudioLowerVolumeexec “amixer -q set Master 2%- unmute”Reduce volume

This gives us this configuration:

bindsym XF86AudioNext exec mpc next
bindsym $alt+XF86AudioRaiseVolume exec mpc next
bindsym $mod+Next exec mpc next
bindsym XF86AudioPrev exec mpc prev
bindsym $alt+XF86AudioLowerVolume exec mpc prev
bindsym $mod+Prior exec mpc prev
bindsym XF86AudioPlay exec mpc toggle
bindsym $mod+p exec mpc toggle
bindsym $mod+$alt+p exec mpc stop
bindsym XF86AudioStop exec mpc stop
bindsym $alt+XF86AudioPlay exec mpc stop
bindsym $mod+$alt+7 exec mpc volume +5
bindsym $mod+$alt+8 exec mpc volume -5
bindsym $mod+Shift+n exec $term ncmpcpp -q
bindsym $mod+Shift+v exec $term ncmpcpp -qs visualizer
bindsym XF86AudioMute exec "amixer set Master 1+ toggle"
bindsym Ctrl+$mod+Prior exec "amixer -q set Master 2%+ unmute"
bindsym XF86AudioRaiseVolume exec "amixer -q set Master 2%+ unmute"
bindsym Ctrl+$mod+Next exec "amixer -q set Master 2%- unmute"
bindsym XF86AudioLowerVolume exec "amixer -q set Master 2%- unmute"

Rofi utilities

We also have some utilities I’ve written and which are interfaced with rofi. Here are said shortcuts.

shortcutcommandwhat it does
$mod+Shift+pexec rofi-pass –typeTypes the selected password available from pass where the cursor is
$mod+Ctrl+Shift+pexec rofi-passCopies in the clipboard the selected password from pass for 45 sec
$mod+Ctrl+mexec rofi-mountVolume mounting helper
$mod+Ctrl+uexec rofi-umountVolume unmounting helper
$mod+$alt+eexec rofi-emojiEmoji picker, copies it in the clipboard
$mod+Ctrl+wexec wacom-setupSets my Wacom Bamboo tablet as being active on the selected screen
$mod+Shift+wexec connect-wifiConnect to an available WiFi network

This gives us the following configuration:

bindsym $mod+Shift+p exec rofi-pass --type
bindsym $mod+Ctrl+Shift+p exec rofi-pass
bindsym $mod+Ctrl+m exec rofi-mount
bindsym $mod+Ctrl+u exec rofi-umount
bindsym $mod+$alt+e exec rofi-emoji
bindsym $mod+Ctrl+w exec wacom-setup
bindsym $mod+Shift+w exec connect-wifi

Miscellaneous

And last but not least, I have some other shortcuts for various software, some of them which I use quite a lot like the shortcut for launching Emacs.

shortcutcommandwhat it does
$mod+eexec $ecLaunch Emacs client
$mod+nexec nemoLaunch Nemo (file manager)
$mod+$alt+cexec speedcrunchLaunch Speedcrunch (calculator)
$mod+F3exec arandrLaunch arandr

This gives us the following configuration:

bindsym $mod+e exec $ec
bindsym $mod+n exec nemo
bindsym $mod+$alt+c exec speedcrunch
bindsym $mod+F3 exec arandr

Screen management

Additionally, we have a shortcut for entering presentation mode on the additional screen of the computer; on my main computer, Mila, the additional screen is HDMI-1, while it is VGA1 on my travel laptop. We’ll use some Emacs Lisp to determine on the configuration file export which screens names to use. Now, we just have to call this Emacs Lisp code as a noweb reference and execute it.

nil

Software autolaunch

When i3 is launched, I want it to also launch some software automatically. Here is what we will launch:

always execute it?commandwhat it is
no/usr/lib/xfce-polkit/xfce-polkitLaunch the XFCE Polkit
nopicom –experimental-backends -e 1Launch picom
noxss-lock – lockLaunch power management
nonumlockx onActivate NumLock
nodunst -config ~/.config/dunst/dunstrcLaunch notification manager
nonm-appletNetworkManager system tray
yeswal -i “$(< “${HOME}/.cache/wal/wal”)”Sets the wallpaper from last session
noxrdb $HOME/.XresourcesLoad Xresources files
yespolybar-launchLaunch polybar
nompc stopStop music from mpd
nompd_discord_richpresence –no-idle –forkLaunch mpd status sharing with Discord

My travel laptop has a fingerprint reader which can be used as an authentification method when the root password is asked. Let’s launch our policy kit manager if that is the case:


exec --no-startup-id /usr/lib/xfce-polkit/xfce-polkit
exec --no-startup-id picom --experimental-backends -e 1
exec --no-startup-id xss-lock -- lock
exec --no-startup-id numlockx on
exec --no-startup-id dunst -config ~/.config/dunst/dunstrc
exec --no-startup-id nm-applet
exec_always --no-startup-id wal -i "$(< "${HOME}/.cache/wal/wal")"
exec --no-startup-id xrdb $HOME/.Xresources
exec_always --no-startup-id polybar-launch
exec --no-startup-id mpc stop
exec --no-startup-id mpd_discord_richpresence --no-idle --fork