i3wm Configuration Files

Table of Contents

About

This is my personal i3wm configuration. The actual code itself is inside this one org-mode file that can be tangled from inside Emacs with the command org-babel-tangle-file. I'm using Gnu Stow to create symlinks from the files tangled in this org file into my home directory since not all the files in this repository needs to be symlinked1. i3wm.png

The Rework

After playing with hyprland for a while, I realized that I still need to have an Xorg configuration for my desktop experience. And this i3 configuration has not been updated for a long time.

The thing is, the Xorg itself needs configuring, and the i3 configuration itself doesn't configure X. I've had a separate repository for Xorg configuration files, but it's a pain to update them just for small changes in the window manager.

My goal is to have a repository for i3 window manager, but also have the configuration for X, and also i3 supporting apps.

Required packages

I'm using archlinux as my main system for years, so I don't really know if the application listed here are also available on other distribution.

Full Xorg package
by installing the xorg package group, perhaps not all are required, but I rather have them from the start just in case.
i3-wm
Archlinux package for i3-wm. Also install the optional dependencies:
i3lock-fancy-git
i3lock script that takes a screenshot of the desktop, blurs the background and adds a lock icon and text.
xidlehook
xautolock rewrite in Rust, with a few extra features.
i3status
for the default status bar generator.
perl-anyevent-i3
for i3-save-tree.
dunst
a lightweight replacement for the notification-daemons provided by most desktop environments. Should be started using systemd, unless you only used it for i3.
libnotify
Library for sending desktop notifications.
firefox
I used to love chromium, but keeps falling back to firefox eventually.
picom
Lightweight compositor for X11.

Optional packages

archlinux-wallpaper
for initial wallpapers.
feh
a lightweight image viewer aimed mainly at users of command line interfaces. Unlike most graphical image viewers.
dex
Program to generate and execute DesktopEntry files of type Application. If used, try running dex -d -v --autostart for testing which applications get auto started in dry run. Note that this will auto start every .desktop files in /etc/xdg/autostart/.
x11-ssh-askpass
Lightweight passphrase dialog for SSH.
polkit-kde-agent
Daemon providing a polkit authentication UI for KDE. It is suggested not to use polkit-gnome. I should start checking if that's still true.
Blueman
GTK+ Bluetooth Manager.
Udiskie
Removable disk automounter using udisks.
Thunar
Modern, fast and easy-to-use file manager for Xfce. Install all the optional dependencies if needed.
Scrot
Simple command-line screenshot utility for X.
Wmctrl
Control your EWMH compliant window manager from command line.
Maim
Utility to take a screenshot using imlib2.
Tesseract
An OCR program.

Themes, fonts, and other UI related packages

ttf-jetbrains-mono-nerd
Patched font JetBrains Mono from nerd fonts library
otf-overpass-nerd
Patched font Overpass from nerd fonts library.
bibata-cursor-theme
Material Based Cursor Theme.
papirus-icon-theme
Papirus icon theme.
Breeze
Artwork, styles and assets for the Breeze visual style for the Plasma Desktop.
Breeze-GTK
Breeze widget theme for GTK 2 and 3. Also works on GTK 4 (I think).
Breeze-Icons
Breeze icon theme.
Unclutter
A small program for hiding the mouse cursor, this is already the unclutter-xfixes package on archlinux.
Volumeicon
Volume control for the system tray.

Apps Used

  • Multimedia
    ncmpcpp
    Featureful ncurses based MPD client inspired by ncmpc

Xorg

TODO [0%] xinitrc

archlinux users would want to install xorg-xinit first.

The xinit program allows a user to manually start an Xorg display server. The startx(1) script is a front-end for xinit(1). I think I still needs a separate file for all the common setup between multiple xorg windows manager.

  • TODO [ ] OS-related system configuration
    # ~/.xinitrc
    # Configuration script for manual X session.
    # <alexforsale@yahoo.com>
    userresources=${HOME}/.Xresources
    usermodmap=${HOME}/.Xmodmap
    OS=$(uname -s)
    
    case "${OS}" in
        "Linux")
            if [ "${DISTRO}" = "ubuntu" ]; then
                sysresources=/etc/X11/xinit/Xresources
                sysmodmap=/etc/X11/xinit/Xmodmap
            else
                sysresources=/etc/X11/xinit/.Xresources
                sysmodmap=/etc/X11/xinit/.Xmodmap
            fi
            ;;
        "FreeBSD")
            sysresources=/usr/local/etc/X11/xinit/.Xresources
            sysmodmap=/usr/local/etc/X11/xinit/.Xmodmap
            ;;
    esac
    
    [ -f "${sysresources}" ] &&
        xrdb -merge "${sysresources}"
    
    [ -f "${sysmodmap}" ] &&
        xmodmap "${sysmodmap}"
    
    [ -f "${userresources}" ] &&
        xrdb -merge "${userresources}"
    
    [ -f "${usermodmap}" ] &&
        xmodmap "${usermodmap}"
    # shellcheck disable=1090
    if [ -d /etc/X11/xinit/xinitrc.d ] ; then
        for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
            [ -x "${f}" ] && . "${f}"
        done
        unset f
    fi
    

    Some distro have their own configuration, rather than copying their contents here, we can simply merge them using the xrdb command.

  • TODO [ ] Source xprofile

    This is to make sure xprofile is sourced when using xinit.

    [ -f /etc/xprofile ] && . /etc/xprofile
    [ -f "${HOME}"/.xprofile ] && . "${HOME}"/.xprofile
    

    By putting those 2 lines will also source xprofile for any display manager that uses ~/.xsession.

  • TODO [ ] Initial wallpapers

    By itself i3 doesn't provide wallpapers, luckily archlinux have its own wallpaper package.

    [ -d /usr/share/backgrounds/archlinux/ ] &&
        feh -zr --bg-fill /usr/share/backgrounds/archlinux/
    

    This snippet should be removed if wallpaper is configured inside the i3 config file.

  • TODO [ ] chemacs configuration

    I sometimes used chemacs2 for using multiple Emacs configuration at once.

    for chemacs_profile in ~/.emacs-profile ~/.config/chemacs/profile; do
        if [ -e ${chemacs_profile} ]; then
            export CHEMACS_PROFILE=`cat ${chemacs_profile}`
        fi
    done
    
    if [ -n "${CHEMACS_PROFILE}" ]; then
        _emacs_args="-s ${CHEMACS_PROFILE}"
    fi
    
  • Start i3

    This is taken from the i3 manual.

    # Disable bell
    xset -b
    xset r rate 300 30
    
    # Enable zapping (C-A-<Bksp> kills X)
    setxkbmap -option terminate:ctrl_alt_bksp
    
    # Use XToolkit in java applications
    export AWT_TOOLKIT=XToolkit
    
    mkdir -p ~/.local/share/i3
    # Start i3 and log to ~/.local/share/i3/log
    echo "Starting at $(date)" >> ~/.local/share/i3/log
    exec /usr/bin/i3 -V -d all >> ~/.local/share/i3/log
    

Xresources

#include ".config/Xresources.d/xterm"
#include ".config/Xresources.d/URxvt"
#include ".config/Xresources.d/colors"
#include ".config/Xresources.d/cursor"
  • Modules
    • xterm
      xterm*termName: xterm-256color
      xterm.vt100.geometry: 80x24
      xterm*saveLines: 4096
      xterm*scrollBar: False
      xterm*.LoginShell: True
      xterm*rightScrollBar: False
      xterm*scrollTtyOutput: False
      xterm.selectToClipboard: true
      xterm.*backarrowKey: false
      xterm*translations: #override \
      Ctrl Shift <KeyPress> C: copy-selection(CLIPBOARD) \n\
      Ctrl Shift <KeyPress> V: insert-selection(CLIPBOARD) \n\
      Ctrl <Btn1Up>: exec-formatted("xdg-open '%t'", PRIMARY) \n\
      ~Meta Shift<Key>Tab: string(\033[Z) \n\
      Meta Shift<Key>Tab: string(\033\033[Z) \n\
      Ctrl <Key> minus: smaller-vt-font() \n\
      Ctrl <Key> plus: larger-vt-font() \n\
      Ctrl <Key> 0: set-vt-font(d)
      xterm*eightBitInput: false
      xterm*metaSendsEscape: true
      xterm*charClass: 33:48,37-38:48,45-47:48,64:48,58:48,126:48,61:48,63:48,43:48,35:48
      xterm*renderFont: true
      xterm*faceName: OverpassM Nerd Font Mono
      xterm*faceSize: 12
      
    • URxvt
       1: xterm*termName: xterm-256color
       2: xterm.vt100.geometry: 80x24
       3: xterm*saveLines: 4096
       4: xterm*scrollBar: False
       5: xterm*.LoginShell: True
       6: xterm*rightScrollBar: False
       7: xterm*scrollTtyOutput: False
       8: xterm.selectToClipboard: true
       9: xterm.*backarrowKey: false
      10: xterm*translations: #override \
      11: Ctrl Shift <KeyPress> C: copy-selection(CLIPBOARD) \n\
      12: Ctrl Shift <KeyPress> V: insert-selection(CLIPBOARD) \n\
      13: Ctrl <Btn1Up>: exec-formatted("xdg-open '%t'", PRIMARY) \n\
      14: ~Meta Shift<Key>Tab: string(\033[Z) \n\
      15: Meta Shift<Key>Tab: string(\033\033[Z) \n\
      16: Ctrl <Key> minus: smaller-vt-font() \n\
      17: Ctrl <Key> plus: larger-vt-font() \n\
      18: Ctrl <Key> 0: set-vt-font(d)
      19: xterm*eightBitInput: false
      20: xterm*metaSendsEscape: true
      21: xterm*charClass: 33:48,37-38:48,45-47:48,64:48,58:48,126:48,61:48,63:48,43:48,35:48
      22: xterm*renderFont: true
      23: xterm*faceName: OverpassM Nerd Font Mono
      24: xterm*faceSize: 12
      
    • colors

      This is (I think) nord color scheme.

       1: ! -*- eval (rainbow-mode 1) -*-
       2: ! X colors.
       3: ! Generated by 'wal'
       4: *foreground:        #fdf6e3
       5: *background:        #292d3e
       6: *.foreground:       #fdf6e3
       7: *.background:       #292d3e
       8: emacs*foreground:   #fdf6e3
       9: emacs*background:   #073642
      10: URxvt*foreground:   #fdf6e3
      11: XTerm*foreground:   #fdf6e3
      12: UXTerm*foreground:  #fdf6e3
      13: URxvt*background:   [100]#073642
      14: XTerm*background:   #073642
      15: UXTerm*background:  #073642
      16: URxvt*cursorColor:  #dc322f
      17: XTerm*cursorColor:  #dc322f
      18: UXTerm*cursorColor: #dc322f
      19: URxvt*borderColor:  [100]#073642
      20: 
      21: ! Colors 0-15.
      22: *.color0: #073642
      23: *color0:  #073642
      24: *.color1: #dc322f
      25: *color1:  #dc322f
      26: *.color2: #859900
      27: *color2:  #859900
      28: *.color3: #b58900
      29: *color3:  #b58900
      30: *.color4: #268bd2
      31: *color4:  #268bd2
      32: *.color5: #d33682
      33: *color5:  #d33682
      34: *.color6: #2aa198
      35: *color6:  #2aa198
      36: *.color7: #eee8d5
      37: *color7:  #eee8d5
      38: *.color8: #6c7c80
      39: *color8:  #6c7c80
      40: *.color9: #dc322f
      41: *color9:  #dc322f
      42: *.color10: #859900
      43: *color10:  #859900
      44: *.color11: #b58900
      45: *color11:  #b58900
      46: *.color12: #268bd2
      47: *color12:  #268bd2
      48: *.color13: #d33682
      49: *color13:  #d33682
      50: *.color14: #2aa198
      51: *color14:  #2aa198
      52: *.color15: #eee8d5
      53: *color15:  #eee8d5
      54: 
      55: ! Black color that will not be affected by bold highlighting.
      56: *.color66: #073642
      57: *color66:  #073642
      58: 
      59: ! Xclock colors.
      60: XClock*foreground: #fdf6e3
      61: XClock*background: #073642
      62: XClock*majorColor:  rgba:ee/e8/d5/ff
      63: XClock*minorColor:  rgba:ee/e8/d5/ff
      64: XClock*hourColor:   rgba:ee/e8/d5/ff
      65: XClock*minuteColor: rgba:ee/e8/d5/ff
      66: XClock*secondColor: rgba:ee/e8/d5/ff
      67: 
      68: ! Set depth to make transparency work.
      69: URxvt*depth: 32
      
    • cursor

      For cursor configuration

      ! cursor theme
      Xcursor.theme: Bibata-Modern-Classic
      Xcursor.size: 24
      Xft.autohint: 0
      Xft.lcdfilter: lcddefault
      Xft.hintstyle: hintslight
      Xft.hinting: 1
      Xft.antialias: 1
      Xft.rgba: rgb
      Xft.dpi: 96
      
      

Xprofile

An xprofile file, ~/.xprofile and /etc/xprofile, allows you to execute commands at the beginning of the X user session - before the window manager is started.

I put snippet of configuration on separate files in ~/.config/xprofile.d/. This will ensure all those files are sourced.

# ~/.xprofile
# user X session startup file.
# <alexforsale@yahoo.com>

if [ -d "${HOME}/.config/xprofile.d" ]; then
    for xfiles in "${HOME}"/.config/xprofile.d/*.sh; do
        # shellcheck disable=1090
        . "${xfiles}"
    done
    unset xfiles
fi

Also source a file name ~/.xprofile.local or ~/.config/xprofile.local if exists. Useful to override settings from the above files.

# shellcheck disable=1091
[ -f "${XDG_CONFIG_HOME}"/xprofile.local ] && . "${XDG_CONFIG_HOME}"/xprofile.local
# shellcheck disable=1091
[ -f "${HOME}"/.xprofile.local ] && . "${HOME}"/.xprofile.local
  • Modules
    • 00-security.sh
      • SSH-askpass

        This will link the executable from /usr/lib/ssh/ to ~/.local/bin/. I forgot why I did this, when I could just use the actual location.

        1: # various ui-related security settings
        2: # <alexforsale@yahoo.com>
        3: 
        4: if [ -f /usr/lib/ssh/x11-ssh-askpass ];then
        5:     [ ! -L ~/.local/bin/ssh-askpass ] &&
        6:         ln -sf /usr/lib/ssh/x11-ssh-askpass ~/.local/bin/ssh-askpass
        7:     export SSH_ASKPASS=ssh-askpass
        8:     export SUDO_ASKPASS="${HOME}"/.local/bin/ssh-askpass
        9: fi
        
      • dbus

        Set environment variables for systemd user services as well for traditional D-Bus session services.

        1: [ "$(command -v dbus-update-activation-environment)" ] &&
        2:     dbus-update-activation-environment --systemd DISPLAY
        3: 
        4: systemctl --user import-environment DISPLAY XDG_CURRENT_DESKTOP QT_QPA_PLATFORMTHEME QT_XCB_GL_INTEGRATION
        
    • 01-bluetooth.sh
      1: # ~/.config/xprofile.d/04-bluetooth.sh
      2: # bluetooth configuration
      3: 
      4: # blueman-tray
      5: if [ "$(command -v blueman-applet)" ] &&
      6:        [ ! $(pgrep -u ${USER} -x blueman-applet) ] &&
      7:        [ -z "${_NO_BLUEMAN_APPLET}" ]; then
      8:     blueman-tray &
      9: fi
      
    • 02-cursor.sh
      # ~/.config/xprofile.d/02-cursor.sh
      # various ui settings
      # monitor
      
      # Everything else should be picked up from ~/.Xresources
      if [[ -z "${XCURSOR_PATH}" ]]; then
          export XCURSOR_PATH=${XCURSOR_PATH}:/usr/share/icons:~/.local/share/icons
      fi
      
    • 03-udiskie.sh

      -C for no config file since I don't use any. -s for enabling the smart tray icon.

      # ~/.config/xprofile.d/03-udiskie.sh
      # udiskie startup
      
      [ "$(command -v udiskie)" ] &&
          udiskie -C -t &
      
    • 04-qt.sh
      # ~/.config/xprofile.d/04-qt.sh
      # QT Environment variables
      
      [ -z "${QT_STYLE_OVERRIDE}" ] && export QT_STYLE_OVERRIDE=Breeze
      

GTK

GTK, or the GIMP Toolkit, is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK is suitable for projects ranging from small one-off tools to complete application suites. Most of these settings are taken from Arch wiki.

GTK 3

  • Settings
    [Settings]
    gtk-theme-name=Breeze-Dark
    gtk-cursor-theme-size=0
    gtk-toolbar-style=GTK_TOOLBAR_BOTH
    gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
    gtk-button-images=1
    gtk-menu-images=1
    gtk-enable-event-sounds=1
    gtk-enable-input-feedback-sounds=1
    gtk-xft-antialias=1
    gtk-xft-hinting=1
    gtk-xft-hintstyle=hintfull
    gtk-key-theme-name=Emacs
    gtk-font-name=JetBrainsMonoNL Nerd Font Mono 10
    gtk-sound-theme-name=freedesktop
    gtk-icon-theme-name=Papirus
    gtk-cursor-theme-name=Bibata-Modern-Classic
    gtk-application-prefer-dark-theme=1
    gtk-xft-rgba=rgb
    

GTK 4

  • Settings
    [Settings]
    gtk-theme-name=Breeze-Dark
    gtk-cursor-theme-size=0
    gtk-toolbar-style=GTK_TOOLBAR_BOTH
    gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
    gtk-button-images=1
    gtk-menu-images=1
    gtk-enable-event-sounds=1
    gtk-enable-input-feedback-sounds=1
    gtk-xft-antialias=1
    gtk-xft-hinting=1
    gtk-xft-hintstyle=hintfull
    gtk-key-theme-name=Emacs
    gtk-font-name=JetBrainsMonoNL Nerd Font Mono, 10
    gtk-sound-theme-name=freedesktop
    gtk-icon-theme-name=Papirus
    gtk-cursor-theme-name=Bibata-Modern-Classic
    gtk-application-prefer-dark-theme=1
    

i3wm

The i3-wm package that I used is from the default repository in archlinux.

variables

Mostly these variables are set to avoid repetion.

  • mod key

    Mod4 is the Super key, or Win key for the rest of the world. Mod1 is Alt2. You don't have to set this variable, but by using variable, we can change the mod key without having to change each individual lines of keybindings.

    set $mod Mod4
    
  • font
    # font
    font pango:JetBrainsMonoNL Nerd Font Mono 10
    
  • notify

    I used dunst as a desktop notification, though there's many other packages that can replace it. I prefer dunst because it's easier to configure.

    set $notify exec notify-send -t 1000
    
  • refresh i3status

    The preferred status bar for i3, I like the simplicity of i3status.

    set $refresh_i3status killall -SIGUSR1 i3status
    
  • navigation keys

    I use vim keys obviously.

    set $up k
    set $down j
    set $left h
    set $right l
    
  • TODO workspaces

    I tried to have a uniformed workspaces across all my window manager configurations. I should work on this.

    set $ws1 "1: Term"
    set $ws2 "2: Code"
    set $ws3 "3: Web"
    set $ws4 "4: Mail"
    set $ws5 "5: File"
    set $ws6 "6: Office"
    set $ws7 "7: Others"
    set $ws8 "8: Media"
    set $ws9 "9: Remote"
    set $ws10 "10: Steam"
    

    Set =workspace_back_and_forth Bound to $mod+TAB, I really use this alot, this is mandatory in every window manager I use.

    workspace_auto_back_and_forth yes
    
  • applications
    set $terminal alacritty
    set $browser firefox
    set $mail thunderbird
    set $guiemacs emacsclient -c -a emacs
    set $tuiemacs emacsclient -t -a emacs
    set $file thunar
    
  • Xresouces
    #### https://build.i3wm.org/docs/userguide.html#xresources
    set_from_resource         $background_i3wm  background      #000000
    set_from_resource         $foreground_i3wm  foreground      #000000
    set_from_resource         $color00_i3wm         color0          #000000
    set_from_resource         $color01_i3wm         color1          #000000
    set_from_resource         $color02_i3wm         color2          #000000
    set_from_resource         $color03_i3wm         color3          #000000
    set_from_resource         $color04_i3wm         color4          #000000
    set_from_resource         $color05_i3wm         color5          #000000
    set_from_resource         $color06_i3wm   color6          #000000
    set_from_resource         $color07_i3wm   color7          #000000
    set_from_resource         $color08_i3wm   color8          #000000
    set_from_resource         $color09_i3wm   color9          #000000
    set_from_resource         $color10_i3wm         color10         #000000
    set_from_resource         $color11_i3wm         color11         #000000
    set_from_resource         $color12_i3wm         color12         #000000
    set_from_resource         $color13_i3wm         color13         #000000
    set_from_resource         $color14_i3wm         color14         #000000
    set_from_resource         $color15_i3wm         color15         #000000
    
  • Colors
    # Theme colors
    # class                 border          backgr.         text            indic.                  child_border
    # My colors
    client.background $background_i3wm
    
    client.focused          $foreground_i3wm  $background_i3wm  $foreground_i3wm $background_i3wm $background_i3wm
    client.unfocused        $foreground_i3wm  $background_i3wm  $foreground_i3wm $background_i3wm $background_i3wm
    client.focused_inactive $foreground_i3wm  $background_i3wm  $foreground_i3wm $background_i3wm $background_i3wm
    client.urgent           $foreground_i3wm  $background_i3wm  $foreground_i3wm $background_i3wm $background_i3wm
    client.placeholder      $foreground_i3wm  $background_i3wm  $foreground_i3wm $background_i3wm $background_i3wm
    
  • floating modifier
    floating_modifier $mod
    

bar

bar {
  status_command i3status
  position bottom
  workspace_buttons yes
  mode dock
  colors {
    statusline          $color04_i3wm
    background          $background_i3wm
    separator           $color03_i3wm
    #                   BORDER          BACKGROUND        TEXT
    focused_workspace   $color03_i3wm   $color00_i3wm     $color02_i3wm
    inactive_workspace  $color00_i3wm   $color00_i3wm     $color02_i3wm
    active_workspace    $color00_i3wm   $color00_i3wm     $color01_i3wm
    urgent_workspace    $color01_i3wm   $background_i3wm  $color00_i3wm
    binding_mode        $color03_i3wm   $background_i3wm  $color00_i3wm
    }
}

Also set keybinding for toggling bar.

bindsym $mod+Control+m bar mode toggle

application autostart

# exec --no-startup-id ~/.local/bin/monitor-setup
exec --no-startup-id xsetroot -cursor_name left_ptr
exec --no-startup-id dbus-launch --exit-with-session picom -b --config "${XDG_CONFIG_HOME}"/picom/picom.conf &
exec --no-startup-id /usr/lib/geoclue-2.0/demos/agent &
exec --no-startup-id dbus-launch --exit-with-session unclutter &
exec --no-startup-id dbus-launch volumeicon &
exec --no-startup-id dbus-launch --exit-with-session greenclip daemon>/dev/null &
exec --no-startup-id $file --daemon &
exec --no-startup-id ~/.local/bin/transfer-sleep-lock-i3lock-fancy &
exec --no-startup-id ~/.fehbg
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock-fancy -n -f Overpass-Nerd-Font-Reg -detectsleep

window rule

for_window [class=".*"] border pixel 0
# for_window [class="(?i)xclipboard"] , move scratchpad
for_window [instance="(?i)pavucontrol"] floating enable
for_window [window_role="pop-up"] floating enable
for_window [instance="(?i)engrampa"] floating enable
for_window [window_role="GtkFileChooserDialog"] floating enable
for_window [title="(?i)alsamixer"] floating enable
for_window [class="(?i)qtconfig-qt4"] floating enable
for_window [title="(?i)nmtui"] floating enable
for_window [window_role="buddy_list"] floating enable, resize set 360 680
for_window [window_role="conversation"] floating enable, resize set 480 680
for_window [class="(?i)blueman.*"] floating enable, resize set 512 256
for_window [class="evolution-alarm-notify"] floating enable
for_window [class="Evolution-alarm-notify"] floating enable
for_window [class="(?i)kooha"] floating enable
for_window [class="^org.kde.polkit-kde-authentication-agent-1"] floating enable
for_window [class="thunderbird" title="status"] floating enable
for_window [class="thunderbird" title="(.*)Reminders"] floating enable
for_window [class="thunderbird" title="Write.*"] floating enable resize set 680 680
for_window [class="thunderbird" title="Send.*"] floating enable
for_window [class="Msgcompose.*"] floating enable resize set 680 680
for_window [class="QtPass"] floating enable
for_window [class="(?i)zoom"] floating enable
for_window [class="(?i)file-roller"] floating enable
for_window [class="(?i)ncmpcpp"] floating enable
for_window [class="(?i)khal"] floating enable
for_window [class="(?i)htop"] floating enable
for_window [class="(?i)nmtui"] floating enable
for_window [class="(?i)vim"] floating enable
for_window [class="(?i)org.kde.kdeconnect.app"] floating enable
for_window [title="(?i)File Operation Progress"] floating enable
for_window [class="(?i)showmethekey-gtk"] floating enable
for_window [class="(?i)screenkey"] floating enable
for_window [class="(?i)bitwarden"] floating enable
for_window [class="(?i)authy.*"] floating enable
for_window [class="(?i)transmission.*"] floating enable
for_window [class="(?i)anydesk.*"] floating enable
for_window [class="(?i)lxappearance"] floating enable
for_window [class="(?i)steam.*"] floating enable

workspace assignment

  • workspace 1
    assign [class="XTerm"] $ws1
    assign [class="URxvt"] $ws1
    assign [class="Gnome-terminal"] $ws1
    assign [class="Termite"] $ws1
    
  • workspace 2
    assign [class="Emacs"] $ws2
    assign [class="Leafpad"] $ws2
    assign [class="L3afpad"] $ws2
    assign [class="Gedit"] $ws2
    assign [class="code-oss"] $ws2
    
  • workspace 3
    assign [class="qutebrowser"] $ws3
    assign [class="firefox"] $ws3
    assign [class="google-chrome"] $ws3
    assign [class="Nyxt"] $ws3
    assign [class="pidgin"] $ws7
    
  • workspace 4
    assign [class="Evolution"] $ws4
    assign [class="thunderbird"] $ws4
    
  • workspace 5
    assign [class="Thunar"] $ws5
    
  • workspace 6
    assign [title="Libreoffice"] $ws6
    assign [title="com-sonicwall-NetExtender"] $ws6
    assign [title="Bitwarden"] $ws6
    assign [title="zoom"] $ws6
    
  • workspace 7
    assign [class="Gucharmap"] $ws7
    assign [class="org.gnome.Characters"] $ws7
    assign [class="winbox.exe"] $ws7
    assign [class="discord"] $ws7
    
  • workspace 8
    assign [class="Rhythmbox"] $ws8
    assign [class="vlc"] $ws8
    assign [class="mpv"] $ws8
    assign [class="Cheese"] $ws8
    assign [class="Spotify"] $ws8
    assign [class="Picard"] $ws8
    
  • workspace 9
    assign [class="org.remmina.remmina"] $ws9
    assign [class="Virt-manager"] $ws9
    assign [class="Vncviewer"] $ws9
    
  • workspace 0
    assign [class="Steam"] $ws10
    assign [title="Steam"] $ws10
    

Keybindings

  • media keys
    bindsym XF86AudioRaiseVolume exec --no-startup-id ~/.local/bin/dunst-volume -i 1 && $refresh_i3status
    bindsym XF86AudioLowerVolume exec --no-startup-id ~/.local/bin/dunst-volume -d 1 && $refresh_i3status
    bindsym XF86AudioMute exec --no-startup-id ~/.local/bin/dunst-volume -t && $refresh_i3status
    bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
    
    bindsym XF86AudioPlay exec playerctl play-pause
    bindsym XF86AudioNext exec playerctl next
    bindsym XF86AudioPrev exec playerctl previous
    
    bindsym XF86MonBrightnessUp exec --no-startup-id ~/.local/bin/dunst-backlight +1%
    bindsym XF86MonBrightnessDown exec --no-startup-id ~/.local/bin/dunst-backlight 1%-
    
    bindsym Print exec flameshot gui
    

    For keyboard with no media keys:

    bindsym $mod+F9 exec --no-startup-id ~/.local/bin/dunst-volume -i 1 && $refresh_i3status
    bindsym $mod+F8 exec --no-startup-id ~/.local/bin/dunst-volume -d 1 && $refresh_i3status
    bindsym $mod+F7 exec --no-startup-id ~/.local/bin/dunst-volume -t && $refresh_i3status
    
    bindsym $mod+F11 exec playerctl play-pause
    bindsym $mod+F12 exec playerctl next
    bindsym $mod+F10 exec playerctl previous
    
    bindsym $mod+Shift+F3 exec --no-startup-id brightnessctl set +1%
    bindsym $mod+Shift+F2 exec --no-startup-id brightnessctl set 1%-
    
  • browser
    bindsym XF86MyComputer exec $browser
    bindsym $mod+Mod1+f exec $browser
    
  • mail
    bindsym XF86Mail exec $mail
    bindsym $mod+Mod1+t exec $mail
    
  • music
    bindsym $mod+Mod1+m exec $terminal --class ncmpcpp -e ncmpcpp
    
  • htop
    bindsym $mod+Mod1+h exec $terminal --class htop -e htop
    
  • nmtui
    bindsym $mod+Mod1+w exec $terminal --class nmtui -e nmtui
    
  • khal
    bindsym $mod+Mod1+k exec $terminal --class khal -e khal interactive
    
  • vim
    bindsym $mod+Mod1+v exec $terminal --class vim -e vim
    
  • dired
    bindsym $mod+Mod1+e exec emacsclient -c -a emacs -e '(dired (getenv "HOME"))'
    
  • rofi-pass

    rofi-pass.png Rofi front end for pass. It stores passwords using git and encrypted with GnuPG. It also has an OTP extensions.

    bindsym $mod+Mod1+p exec rofi-pass
    
  • rofi-calc
    bindsym $mod+Mod1+c exec rofi -show calc -modi calc -no-show-match -no-sort -theme calculator
    
  • rofi-rbw

    Similar to rofi-pass, but for bitwarden.

    bindsym $mod+Mod1+b exec rofi-rbw
    
  • text editor
    bindsym $mod+Mod1+n exec $guiemacs
    bindsym $mod+Control+n exec $terminal -e $tuiemacs
    
  • file manager
    bindsym $mod+e exec $file
    
  • terminal
    bindsym $mod+Return exec $terminal
    
  • terminal + screen
    bindsym $mod+Shift+Return exec $terminal -e screen -m
    
  • kill focused window
    bindsym $mod+Shift+F4 kill
    bindsym Mod1+F4 kill
    
  • rofi-menu
    bindsym $mod+d exec --no-startup-id rofi -show drun -theme i3-apps
    
  • rofi-greenclip
    bindsym $mod+c exec --no-startup-id rofi -theme i3-apps -modi "clipboard:greenclip print" -show clipboard
    
  • rofi window menu
    bindsym $mod+shift+w exec rofi -theme i3-apps -show windowcd
    bindsym $mod+w exec rofi -theme i3-apps -show window
    
  • tesseract
    bindsym $mod+shift+t exec ~/.local/bin/ocr
    
  • screenkey
    bindsym $mod+Mod1+s exec screenkey
    
  • window management
    • change focus
      bindsym $mod+$left focus left
      bindsym $mod+$down focus down
      bindsym $mod+$up focus up
      bindsym $mod+$right focus right
      

      Alternatively, with arrow keys:

      bindsym $mod+Left focus left
      bindsym $mod+Down focus down
      bindsym $mod+Up focus up
      bindsym $mod+Right focus right
      
    • move focused window
      bindsym $mod+Shift+$left move left
      bindsym $mod+Shift+$down move down
      bindsym $mod+Shift+$up move up
      bindsym $mod+Shift+$right move right
      

      Also, with arrow keys:

      bindsym $mod+Shift+Left move left
      bindsym $mod+Shift+Down move down
      bindsym $mod+Shift+Up move up
      bindsym $mod+Shift+Right move right
      
    • split

      horizontally

      bindsym $mod+Control+h split h; exec $notify "Horizontal split"
      

      vertically

      bindsym $mod+Control+v split v exec $notify "Vertical split"
      
    • fullscreen toggle
      bindsym $mod+f fullscreen toggle; exec $notify "Fullscreen toggle"
      
    • container layout

      stacked

      bindsym $mod+Control+s layout stacking; exec $notify "Stacking layout"
      

      tabbed

      bindsym $mod+Control+w layout tabbed; exec $notify "Tabbed layout"
      

      split

      bindsym $mod+Control+e layout toggle split; exec $notify "Split toggle"
      
    • toggle tiling / floating
      bindsym $mod+Shift+space floating toggle; exec $notify "Floating toggle"
      
    • change focus between tiling / floating windows
      bindsym $mod+space focus mode_toggle; exec $notify "Window focus toggle"
      
    • focus parent container
      bindsym $mod+Control+a focus parent; exec $notify "Focus parentcontainer"
      
    • focus child container
      bindsym $mod+Control+d focus child; exec $notify "Focus child container"
      
    • move to scratchpad

      Move the current focused window into the scratchpad

      bindsym $mod+Shift+minus move scratchpad; exec $notify "Moved to scratchpad"
      
    • show scratchpad

      Show the next scratchpad window or hide the focused scratchpad window. If there are multiple scratchpad windows, this command cycles through them.

      bindsym $mod+minus scratchpad show; exec $notify "Show scratchpad"
      bindsym $mod+Shift+c [class="(?i)xclipboard"] scratchpad show
      
  • workspace management
    bindsym $mod+1 workspace $ws1
    bindsym $mod+2 workspace $ws2
    bindsym $mod+3 workspace $ws3
    bindsym $mod+4 workspace $ws4
    bindsym $mod+5 workspace $ws5
    bindsym $mod+6 workspace $ws6
    bindsym $mod+7 workspace $ws7
    bindsym $mod+8 workspace $ws8
    bindsym $mod+9 workspace $ws9
    bindsym $mod+0 workspace $ws10
    
    • switch to workspace prev / next
      bindsym $mod+bracketleft workspace prev
      bindsym $mod+bracketright workspace next
      
    • move focused containerto workspace
      bindsym $mod+Shift+1 move container to workspace $ws1
      bindsym $mod+Shift+2 move container to workspace $ws2
      bindsym $mod+Shift+3 move container to workspace $ws3
      bindsym $mod+Shift+4 move container to workspace $ws4
      bindsym $mod+Shift+5 move container to workspace $ws5
      bindsym $mod+Shift+6 move container to workspace $ws6
      bindsym $mod+Shift+7 move container to workspace $ws7
      bindsym $mod+Shift+8 move container to workspace $ws8
      bindsym $mod+Shift+9 move container to workspace $ws9
      bindsym $mod+Shift+0 move container to workspace $ws10
      
    • move using bracket keys
      bindsym Control+Mod1+bracketleft move to workspace previous
      bindsym Control+Mod1+bracketright move to workspace next
      
    • back and forth
      bindsym $mod+Tab workspace back_and_forth
      bindsym $mod+Shift+Tab move container to workspace back_and_forth
      
    • switch output focus
      bindsym $mod+Control+1 focus output primary
      bindsym $mod+Control+2 focus output right
      
    • moving to output
      bindsym $mod+Control+Shift+1 move workspace to output primary
      bindsym $mod+Control+Shift+2 move workspace to output right
      
  • Reload configuration
    bindsym $mod+Shift+F11 reload
    
  • Hot restart
    bindsym $mod+Control+r restart
    
  • exit i3
    bindsym $mod+q exec ~/.local/bin/rofi-i3-logout
    
  • picom transparency
    bindsym $mod+F3 exec picom-trans -c +5
    bindsym $mod+F2 exec picom-trans -c -5
    
  • dunst
    bindsym $mod+Mod1+grave exec dunstctl history-pop
    bindsym $mod+Shift+grave exec dunstctl context
    bindsym $mod+Control+grave exec dunstctl close
    bindsym $mod+grave exec dunstctl action
    
  • modes
    • resize
      # resize window (you can also use the mouse for that)
      mode "resize" {
      # These bindings trigger as soon as you enter the resize mode
      
      # Pressing left will shrink the window’s width.
      # Pressing right will grow the window’s width.
      # Pressing up will shrink the window’s height.
      # Pressing down will grow the window’s height.
      bindsym $left       resize shrink width 10 px or 10 ppt
      bindsym $down       resize grow height 10 px or 10 ppt
      bindsym $up         resize shrink height 10 px or 10 ppt
      bindsym $right      resize grow width 10 px or 10 ppt
      
      # same bindings, but for the arrow keys
      bindsym Left        resize shrink width 10 px or 10 ppt
      bindsym Down        resize grow height 10 px or 10 ppt
      bindsym Up          resize shrink height 10 px or 10 ppt
      bindsym Right       resize grow width 10 px or 10 ppt
      
      # back to normal: Enter or Escape or $mod+r
      bindsym Return mode "default"
      bindsym Escape mode "default"
      bindsym $mod+r mode "default"
      }
      
      bindsym $mod+r mode "resize"
      

i3status

I don't mess much with i3status, it's usually hidden most of the times.

general

general {
        colors = true
        interval = 5
        output_format = i3bar
}

order

order += "ipv6"
order += "wireless _first_"
order += "ethernet _first_"
order += "battery 0"
order += "memory"
order += "tztime local"

wireless

wireless _first_ {
        format_up = "󰖩: (%quality at %essid, %bitrate / %frequency) %ip"
        format_down = "󰖩: down"
}

ethernet

ethernet _first_ {
        format_up = "󰈀: %ip (%speed)"
        format_down = ""
}

battery

battery 0 {
        format = "%status %percentage %remaining"
        format_down = ""
        status_chr = "󰂄"
        status_bat = "󰂂"
        status_unk = "󰂑"
        last_full_capacity = true
}

memory

memory {
        format = "󰍛 %used"
        threshold_degraded = "1G"
        format_degraded = "󰍛 < %available"
}

time

tztime local {
        format = "󰥔 %Y-%m-%d %H:%M:%S"
}

picom

#################################
#             Shadows           #
#################################


# Enabled client-side shadows on windows. Note desktop windows
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
# unless explicitly requested using the wintypes option.
#
# shadow = false
shadow = true;

# The blur radius for shadows, in pixels. (defaults to 12)
# shadow-radius = 12
shadow-radius = 20;

# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
# shadow-opacity = .75

# The left offset for shadows, in pixels. (defaults to -15)
# shadow-offset-x = -15
shadow-offset-x = -20;

# The top offset for shadows, in pixels. (defaults to -15)
# shadow-offset-y = -15
shadow-offset-y = -20;

# Avoid drawing shadows on dock/panel windows. This option is deprecated,
# you should use the *wintypes* option in your config file instead.
#
# no-dock-shadow = false

# Don't draw shadows on drag-and-drop windows. This option is deprecated,
# you should use the *wintypes* option in your config file instead.
#
# no-dnd-shadow = false

# Red color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-red = 0

# Green color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-green = 0

# Blue color value of shadow (0.0 - 1.0, defaults to 0).
# shadow-blue = 0

# Do not paint shadows on shaped windows. Note shaped windows
# here means windows setting its shape through X Shape extension.
# Those using ARGB background is beyond our control.
# Deprecated, use
#   shadow-exclude = 'bounding_shaped'
# or
#   shadow-exclude = 'bounding_shaped && !rounded_corners'
# instead.
#
# shadow-ignore-shaped = ''

# Specify a list of conditions of windows that should have no shadow.
#
# examples:
#   shadow-exclude = "n:e:Notification";
#
# shadow-exclude = []
shadow-exclude = [
  "name = 'Notification'",
  "class_g = 'Conky'",
  "class_g ?= 'Notify-osd'",
  "class_g = 'Cairo-clock'",
  "_GTK_FRAME_EXTENTS@:c",
  "class_g = 'Rofi'"
];

# Specify a X geometry that describes the region in which shadow should not
# be painted in, such as a dock window region. Use
#    shadow-exclude-reg = "x10+0+0"
# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on.
#
# shadow-exclude-reg = ""

# Crop shadow of a window fully on a particular Xinerama screen to the screen.
# xinerama-shadow-crop = false


#################################
#           Fading              #
#################################


# Fade windows in/out when opening/closing and when opacity changes,
#  unless no-fading-openclose is used.
# fading = false
fading = true

# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
# fade-in-step = 0.028
fade-in-step = 0.03;

# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
# fade-out-step = 0.03
fade-out-step = 0.03;

# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
fade-delta = 3

# Specify a list of conditions of windows that should not be faded.
# fade-exclude = []

# Do not fade on window open/close.
no-fading-openclose = false

# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
no-fading-destroyed-argb = false


#################################
#   Transparency / Opacity      #
#################################


# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
# inactive-opacity = 1
inactive-opacity = 0.9;

# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
# frame-opacity = 1.0
frame-opacity = 0.8;

# Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0)
# menu-opacity = 1.0

# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows.
# inactive-opacity-override = true
inactive-opacity-override = false;

# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
active-opacity = 1.0

# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
inactive-dim = 0.0

# Specify a list of conditions of windows that should always be considered focused.
# focus-exclude = []
focus-exclude = [ "class_g = 'Cairo-clock'",
                  "class_g ?= 'rofi'",
                  "class_g ?= 'Steam'"
];

# Use fixed inactive dim value, instead of adjusting according to window opacity.
# inactive-dim-fixed = 1.0

# Specify a list of opacity rules, in the format `PERCENT:PATTERN`,
# like `50:name *= "Firefox"`. picom-trans is recommended over this.
# Note we don't make any guarantee about possible conflicts with other
# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows.
# example:
#    opacity-rule = [ "80:class_g = 'URxvt'" ];
#
# opacity-rule = []
opacity-rule = [ "90:name *= '*'",
                 "99:class_g = 'Emacs' && argb",
                 "98:class_g = 'Firefox' && argb",
                 "98:class_g = 'Brave-browser' && argb",
                 "98:class_g = 'Google-chrome'",
                 "99:class_g = 'vlc'",
                 "99:class_g = 'mpv'",
                 "80:class_g = 'URxvt'",
                 "80:class_g = 'UXTerm'",
                 "80:class_g = 'Alacritty'",
                 "80:class_g = 'XTerm'"
                ]

#################################
#     Background-Blurring       #
#################################


# Parameters for background blurring, see the *BLUR* section for more information.
# blur-method =
blur-method = "gaussian"
# blur-size = 12
blur-size = 12
#
# blur-deviation = false
blur-deviation = 1.0

# Blur background of semi-transparent / ARGB windows.
# Bad in performance, with driver-dependent behavior.
# The name of the switch may change without prior notifications.
#
# blur-background = false
# blur-background = true

# Blur background of windows when the window frame is not opaque.
# Implies:
#    blur-background
# Bad in performance, with driver-dependent behavior. The name may change.
#
# blur-background-frame = false


# Use fixed blur strength rather than adjusting according to window opacity.
# blur-background-fixed = false


# Specify the blur convolution kernel, with the following format:
# example:
#   blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
#
# blur-kern = ''
blur-kern = "3x3box";


# Exclude conditions for background blur.
# blur-background-exclude = []
blur-background-exclude = [
  "window_type = 'dock'",
  "window_type = 'desktop'",
  "_GTK_FRAME_EXTENTS@:c"
];

#################################
#       General Settings        #
#################################

# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
# daemon = false

# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`.
# `xrender` is the default one.
#
# backend = 'glx'
# backend = "xrender";
backend = "glx";

# Enable/disable VSync.
# vsync = false
vsync = true

# Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
dbus = false

# Try to detect WM windows (a non-override-redirect window with no
# child that has 'WM_STATE') and mark them as active.
#
# mark-wmwin-focused = false
mark-wmwin-focused = true;

# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused.
# mark-ovredir-focused = false
mark-ovredir-focused = true;

# Try to detect windows with rounded corners and don't consider them
# shaped windows. The accuracy is not very high, unfortunately.
#
# detect-rounded-corners = false
detect-rounded-corners = true;

# Detect '_NET_WM_OPACITY' on client windows, useful for window managers
# not passing '_NET_WM_OPACITY' of client windows to frame windows.
#
# detect-client-opacity = false
detect-client-opacity = true;

# Specify refresh rate of the screen. If not specified or 0, picom will
# try detecting this with X RandR extension.
#
# refresh-rate = 60
# refresh-rate = 0

# Limit picom to repaint at most once every 1 / 'refresh_rate' second to
# boost performance. This should not be used with
#   vsync drm/opengl/opengl-oml
# as they essentially does sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
#
# sw-opti =

# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
# provided that the WM supports it.
#
# use-ewmh-active-win = false
use-ewmh-active-win = true

# Unredirect all windows if a full-screen opaque window is detected,
# to maximize performance for full-screen windows. Known to cause flickering
# when redirecting/unredirecting windows.
#
# unredir-if-possible = false

# Delay before unredirecting the window, in milliseconds. Defaults to 0.
# unredir-if-possible-delay = 0

# Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
# unredir-if-possible-exclude = []

# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
# in the same group focused at the same time.
#
# detect-transient = false
detect-transient = true

# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
# group focused at the same time. 'WM_TRANSIENT_FOR' has higher priority if
# detect-transient is enabled, too.
#
# detect-client-leader = false
detect-client-leader = true

# Resize damaged region by a specific number of pixels.
# A positive value enlarges it while a negative one shrinks it.
# If the value is positive, those additional pixels will not be actually painted
# to screen, only used in blur calculation, and such. (Due to technical limitations,
# with use-damage, those pixels will still be incorrectly painted to screen.)
# Primarily used to fix the line corruption issues of blur,
# in which case you should use the blur radius value here
# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`,
# with a 5x5 one you use `--resize-damage 2`, and so on).
# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly.
#
# resize-damage = 1

# Specify a list of conditions of windows that should be painted with inverted color.
# Resource-hogging, and is not well tested.
#
# invert-color-include = []

# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer.
# Might cause incorrect opacity when rendering transparent content (but never
# practically happened) and may not work with blur-background.
# My tests show a 15% performance boost. Recommended.
#
# glx-no-stencil = false
glx-no-stencil = true

# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes,
# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.).
# Recommended if it works.
#
# glx-no-rebind-pixmap = false
glx-no-rebind-pixmap = true

# Disable the use of damage information.
# This cause the whole screen to be redrawn everytime, instead of the part of the screen
# has actually changed. Potentially degrades the performance, but might fix some artifacts.
# The opposing option is use-damage
#
# no-use-damage = false
use-damage = true

# Use X Sync fence to sync clients' draw calls, to make sure all draw
# calls are finished before picom starts drawing. Needed on nvidia-drivers
# with GLX backend for some users.
#
# xrender-sync-fence = false

# GLX backend: Use specified GLSL fragment shader for rendering window contents.
# See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl`
# in the source tree for examples.
#
# glx-fshader-win = ''

# Force all windows to be painted with blending. Useful if you
# have a glx-fshader-win that could turn opaque pixels transparent.
#
# force-win-blend = false

# Do not use EWMH to detect fullscreen windows.
# Reverts to checking if a window is fullscreen based only on its size and coordinates.
#
# no-ewmh-fullscreen = false

# Dimming bright windows so their brightness doesn't exceed this set value.
# Brightness of a window is estimated by averaging all pixels in the window,
# so this could comes with a performance hit.
# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0)
#
# max-brightness = 1.0

# Make transparent windows clip other windows like non-transparent windows do,
# instead of blending on top of them.
#
transparent-clipping = false

# Set the log level. Possible values are:
#  "trace", "debug", "info", "warn", "error"
# in increasing level of importance. Case doesn't matter.
# If using the "TRACE" log level, it's better to log into a file
# using *--log-file*, since it can generate a huge stream of logs.
#
# log-level = "debug"
log-level = "warn";

# Set the log file.
# If *--log-file* is never specified, logs will be written to stderr.
# Otherwise, logs will to written to the given file, though some of the early
# logs might still be written to the stderr.
# When setting this option from the config file, it is recommended to use an absolute path.
#
# log-file = '/path/to/your/log/file'

# Show all X errors (for debugging)
# show-all-xerrors = false

# Write process ID to a file.
# write-pid-path = '/path/to/your/log/file'

# Window type settings
#
# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard:
#     "unknown", "desktop", "dock", "toolbar", "menu", "utility",
#     "splash", "dialog", "normal", "dropdown_menu", "popup_menu",
#     "tooltip", "notification", "combo", and "dnd".
#
# Following per window-type options are available: ::
#
#   fade, shadow:::
#     Controls window-type-specific shadow and fade settings.
#
#   opacity:::
#     Controls default opacity of the window type.
#
#   focus:::
#     Controls whether the window of this type is to be always considered focused.
#     (By default, all window types except "normal" and "dialog" has this on.)
#
#   full-shadow:::
#     Controls whether shadow is drawn under the parts of the window that you
#     normally won't be able to see. Useful when the window has parts of it
#     transparent, and you want shadows in those areas.
#
#   redir-ignore:::
#     Controls whether this type of windows should cause screen to become
#     redirected again after been unredirected. If you have unredir-if-possible
#     set, and doesn't want certain window to cause unnecessary screen redirection,
#     you can set this to `true`.
#
wintypes:
{
  tooltip = { fade = true; shadow = true; opacity = 0.90; focus = true; full-shadow = false; };
  normal = { full-shadow = false; };
  dock = { shadow = false; };
  dnd = { shadow = false; };
  popup_menu = { shadow = true; focus = false; blur-background = false; opacity = 0.8; };
  dropdown_menu = { shadow = false; focus = false; opacity = 0.8; };
  above  = { shadow = true; };
  splash = { shadow = false; };
  utility = { focus = false; shadow = false; blur-background = false };
  notification = { shadow = false; };
  desktop = { shadow = false; blur-background = false; };
  menu = { focus = false; };
  dialog = { shadow = true; };
};

Scripts

ocr

This utilize the tesseract package. The script simply select an area in the desktop with maim, pipe it into tesseract, which also pipes it into xclip.

maim -u -s -b 5 -l -c 0.3,0.4,0.6,0.4 -d 0.1 | tesseract -l eng - - | xclip -selection clipboard
notify-send -i ebook-reader "OCR" "Saved to clipboard"

Rofi

  • i3-nord theme

    I separate the main nord theme here so I can make changes to it without 'disturbing' other window manager settings.

    /* -*-css-*- */
    /**
     * Nordic rofi theme
     * Adapted by undiabler <undiabler@gmail.com>
     *
     * Nord Color palette imported from https://www.nordtheme.com/
     *
     */
    
    
    * {
        nord0: #2e3440;
        nord1: #3b4252;
        nord2: #434c5e;
        nord3: #4c566a;
    
        nord4: #d8dee9;
        nord5: #e5e9f0;
        nord6: #eceff4;
    
        nord7: #8fbcbb;
        nord8: #88c0d0;
        nord9: #81a1c1;
        nord10: #5e81ac;
        nord11: #bf616a;
    
        nord12: #d08770;
        nord13: #ebcb8b;
        nord14: #a3be8c;
        nord15: #b48ead;
    
        foreground:  @nord9;
        backlight:   #ccffeedd;
        background-color:  transparent;
    
        highlight:     underline bold #eceff4;
    
        transparent: rgba(46,52,64,0);
    }
    
    window {
        location: center;
        anchor:   center;
        transparency: "screenshot";
        padding: 10px;
        border:  0px;
        border-radius: 6px;
    
        background-color: @transparent;
        spacing: 0;
        children:  [mainbox];
        orientation: horizontal;
    }
    
    mainbox {
        spacing: 0;
        children: [ inputbar, message, listview ];
    }
    
    message {
        color: @nord0;
        padding: 5;
        border-color: @foreground;
        border:  0px 2px 2px 2px;
        background-color: @nord7;
    }
    
    inputbar {
        color: @nord6;
        padding: 11px;
        background-color: @nord1;
    
        border: 1px;
        border-radius:  6px 6px 0px 0px;
        border-color: @nord10;
    }
    
    entry, prompt, case-indicator {
        text-font: inherit;
        text-color:inherit;
    }
    
    prompt {
        margin: 0px 1em 0em 0em ;
    }
    
    listview {
        padding: 8px;
        border-radius: 0px 0px 6px 6px;
        border-color: @nord10;
        border: 0px 1px 1px 1px;
        background-color: rgba(46,52,64,0.9);
        dynamic: false;
    }
    
    element {
        padding: 3px;
        vertical-align: 0.5;
        border-radius: 4px;
        background-color: transparent;
        color: @foreground;
        text-color: rgb(216, 222, 233);
    }
    
    element selected.normal {
        background-color: @nord7;
        text-color: #2e3440;
    }
    
    element-text, element-icon {
        background-color: inherit;
        text-color:       inherit;
    }
    
    button {
        padding: 6px;
        color: @foreground;
        horizontal-align: 0.5;
    
        border: 2px 0px 2px 2px;
        border-radius: 4px 0px 0px 4px;
        border-color: @foreground;
    }
    
    button selected normal {
        border: 2px 0px 2px 2px;
        border-color: @foreground;
    }
    
  • i3-apps theme
    /* -*-css -*- */
    @theme "i3-nord"
    
    window {
        location: southwest;
        anchor: center;
        width: 40%;
        x-offset: 19.5%;
        y-offset: -17.5%;
        /* padding-right: 25px; */
    }
    
    listview {
        columns: 2;
        lines: 6;
    }
    
    /* inputbar { */
    /*     children: [textbox-prompt]; */
    /* } */
    
    /* textbox-prompt { */
    /*     str: "Apps"; */
    /*     text-color: inherit; */
    /* } */
    
  • i3-logout theme
    /* -*-css -*- */
    @theme "i3-nord"
    
    window {
        location: northeast;
        anchor:   center;
        transparency: "screenshot";
        width: 10%;
        padding: 10px;
        border:  0px;
        border-radius: 6px;
        x-offset: -5.5%;
        y-offset: 12.5%;
        spacing: 0;
        children: [mainbox];
    }
    
    listview {
        columns: 1;
        lines: 4;
    }
    

i3-logout

question=$(echo "󰌾 lock|󰍃 logout|󰜉 reboot|󰐥 shutdown" | rofi -sep "|" \
    -dmenu -i -p 'System: ' "" \
    -hide-scrollbar \
    -eh 1 \
    -color-enabled true \
    -theme "i3-logout")

case $question in
    *lock)
        i3lock-fancy
        ;;
    *logout)
        i3-msg exit
        ;;
    *reboot)
        if [[ $(command -v systemctl) ]]; then
            systemctl reboot
        else
            shutdown -r now
        fi
        ;;
    *shutdown)
        if [[ $(command -v systemctl) ]]; then
            systemctl poweroff
        else
            poweroff
        fi
        ;;
    *)
        exit 0  # do nothing on wrong response
        ;;
esac

transfer screen lock

A locker script for i3lock-fancy and xss-lock. Requires xidlehook

# get the primary display
export PRIMARY_DISPLAY="$(xrandr | awk '/ primary/{print $1}')"

# Run xidlehook
xidlehook \
  `# Don't lock when there's a fullscreen application` \
  --not-when-fullscreen \
  `# Don't lock when there's audio playing` \
  --not-when-audio \
  `# Dim the screen after 60 seconds, undim if user becomes active` \
  --timer 60 \
    'xrandr --output "$PRIMARY_DISPLAY" --brightness .1' \
    'xrandr --output "$PRIMARY_DISPLAY" --brightness 1' \
  `# Undim & lock after 10 more seconds` \
  --timer 10 \
    'xrandr --output "$PRIMARY_DISPLAY" --brightness 1; i3lock-fancy -f Overpass-Nerd-Font-Reg -d ' \
    '' \
  `# Finally, suspend an hour after it locks` \
  --timer 3600 \
    'systemctl suspend' \
    ''

Footnotes:

Date: 2022-06-08 Wed 00:00

Author: Kristian Alexander P

Created: 2025-01-05 Sun 18:22