Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active December 9, 2023 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dacr/19d45d65952cf7512762ca1869a1718f to your computer and use it in GitHub Desktop.
Save dacr/19d45d65952cf7512762ca1869a1718f to your computer and use it in GitHub Desktop.
i3 cheat sheet / published by https://github.com/dacr/code-examples-manager #cbe05f62-a3ec-4e61-9e71-6ed3b2837594/6ec248df7db6055ef8e715147b14277ef1993ab4

i3 cheat sheet

control from command line

  • remove current window border : i3 border none
  • small window border : i3 border 1pixel

multiple screens

keyboard settings

alias kbus="setxkbmap -layout us"
alias kbusi="setxkbmap -layout us -variant intl"
setxkbmap -layout us
setxkbmap -layout us -variant intl

setxkbmap -layout fr,us -option grp:alt_shift_toggle

## configuration i3 :
## exec --no-startup-id "setxkbmap -layout fr,us -option grp:alt_shift_toggle"

site configuration examples

xrandr
xrandr --output DP-2  --mode "3840x2160" --left-of eDP-1
xrandr --output eDP-1 --mode "1920x1200"
xrandr
xrandr --output DP-2  --mode "2560x1440" --left-of eDP-1
xrandr --output DP-3  --mode "1920x1080" --left-of DP-2

screen mirroring

xrandr --output DP-2 --mode "1920x1200" --scale 1x1 --same-as eDP-1

brightness

xrandr --output eDP-1-1 --brightness 1.8

move workspace to another screen

i3-msg move workspace to output left

google chrome passwords management

Add in i3 configuration :

exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=secrets

And launch chrome as follow :

google-chrome --password-store=gnome

screenshots config

# For screenshots install :
# apt-get install maim xclip copyq

##  Screenshots in files
bindsym Print exec --no-startup-id maim --format=png "/home/$USER/Pictures/screenshot-$(date -u +'%Y%m%d-%H%M%SZ')-all.png"
bindsym $mod+Print exec --no-startup-id maim --format=png --window $(xdotool getactivewindow) "/home/$USER/Pictures/screenshot-$(date -u +'%Y%m%d-%H%M%SZ')-current.png"
bindsym Shift+Print exec --no-startup-id maim --format=png --select "/home/$USER/Pictures/screenshot-$(date -u +'%Y%m%d-%H%M%SZ')-selected.png"

## Screenshots in clipboards
bindsym Ctrl+Print exec --no-startup-id maim --format=png | xclip -selection clipboard -t image/png
bindsym Ctrl+$mod+Print exec --no-startup-id maim --format=png --window $(xdotool getactivewindow) | xclip -selection clipboard -t image/png
bindsym Ctrl+Shift+Print exec --no-startup-id maim --format=png --select | xclip -selection clipboard -t image/png

# start a clipboard manager
exec --no-startup-id copyq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment