DevOps Buzz
Search…
Bash / Shell
Bitbucket
Distros
Elasticsearch
General
Guidelines / Standards
microk8s
Prometheus
RabbitMQ
VirtualBox
Cheat Sheet
i3 tips and tricks

Audio

Keyboard keys

Install pactland playerctl.
~/.config/i3/config
1
# Pulse Audio controls
2
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume
3
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume
4
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
5
6
# Sreen brightness controls
7
bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness
8
bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness
9
10
# Touchpad controls
11
bindsym XF86TouchpadToggle exec /some/path/toggletouchpad.sh # toggle touchpad
12
13
# Media player controls
14
bindsym XF86AudioPlay exec playerctl play
15
bindsym XF86AudioPause exec playerctl pause
16
bindsym XF86AudioNext exec playerctl next
17
bindsym XF86AudioPrev exec playerctl previous
Copied!
toggletouchpad.sh
1
#!/bin/bash
2
if synclient -l | grep "TouchpadOff .*=.*0" ; then
3
synclient TouchpadOff=1 ;
4
else
5
synclient TouchpadOff=0 ;
6
fi
Copied!

References

Tray

Install pasystray.
1
sudo apt install pasystray
Copied!
Then edit your config file.
~/.config/i3/config
1
exec_always /usr/bin/pasystray
Copied!

Autoload application

On login

~/.config/i3/config
1
exec firefox
Copied!

On i3 reload

~/.config/i3/config
1
exec_always firefox
Copied!

bindsym

1
bindsym $mod+g exec "rofi -show run"
2
bindsym $mod+x exec "xdg-open ."
Copied!

Multiple monitors

Install arandr.
1
sudo apt install arandr
Copied!
Then, press $mod+d and run arandr.
Make your changes, click on "Save as" then save your config file at `~/.screenlayout/dual.sh` and change permissions.
1
chmod +rx ~/.screenlayout/dual.sh
Copied!
Open the file saved, copy its content and paste it in your ~/.config/i3/config with exec_always option.
~/.config/i3/config
1
exec --no-startup-id ~/.screenlayout/dual.sh
Copied!
Restart i3 pressing $mod+Shift+r.

Theme

Wallpaper

Install feh.
1
sudo apt install feh
Copied!
Test it.
1
feh --bg-scale $HOME/Pictures/wallpaper.jpg
Copied!
Always use it.
~/.config/i3/config
1
exec_always feh --bg-scale $HOME/Pictures/wallpaper.jpg
Copied!

Workspaces

Workspace icons

Downlado the latest Font-Awesome release: https://github.com/FortAwesome/Font-Awesome/releases
Extract the file downloaded.
Create a font directory and copy the font file.
1
mkdir ~/.fonts
2
cp webfonts/*.ttf ~/.fonts
Copied!
Find your icon and copy th icon itself.
Paste the icon in the workspace string
~/.config/i3/config
1
set $workspace1 "1: Terminals "
Copied!
Logout: $mod+shift+e.

Open application in a specific workspace

First, you need to find the window class.
To do so, open the application you want, open a termianal and run xprop.
The cursos will become a cross , click on your application window.
Get the second value of " WM_CLASS(STRING).
For example: WM_CLASS(STRING) = "x-terminal-emulator", "X-terminal-emulator"
Edit your config file as follows.
~/.config/i3/config
1
assign [class="X-terminal-emulator"] 1
2
# Or, if you have a workspace variable...
3
# assign [class="PUT-YOUR-CLASS-HERE"] $workspace1
Copied!

Rename workspace

Rename workspace 1 to Terminals.
~/.config/i3/config
1
set $workspace1 "1: Terminals"
2
bindsym $mod+1 workspace $workspace1
3
bindsym $mod+Shift+1 move container to workspace $workspace1
Copied!
Logout: $cmd+shift+e.