i3 Settings
i3bar
i3bar displays your status bar, i3status just outputs a string with some info, which i3bar will display.
Edit config file
To change the configuration of i3, copy /etc/i3/config to ~/.i3/config (or ~/.config/i3/config if you like the XDG directory scheme) and edit it with a text editor. One of those will be created if you run the i3-config-wizard
.
i3status
Edit config file
Create config file.
mkdir ~/.config/i3status
cp /etc/i3status.conf ~/.config/i3status/config
Appearance
Wallpaper
sudo apt install nitrogen
You should set this into your i3 config, so your wallpaper is persistent:
exec nitrogen -restore
dmenu replacement
Rofi is a dmenu replacement, with a better look and more features.
sudo apt install rofi
Just replace the dmenu launch command with this:
bindsym $mod+Shift+d exec rofi -show run
Functionality
Audio
add exec --no-startup-id volumeicon
to i3 config
sudo apt install volumeicon-alsa
Add to i3 config
# Volume controls
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +2%;
bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -2%;
bindsym XF86AudioMute exec amixer -q set Master toggle;exec amixer -q set Speaker unmute;exec amixer -q set Headphone unmute
Media controls
In order to use mediacontrols we will use playerctl, which you can install under Ubuntu with this command:
sudo apt install playerctl
Now just add those lines to your i3 config
# Media player controls
bindsym $mod+k exec playerctl play-pause
bindsym $mod+l exec playerctl next
bindsym $mod+j exec playerctl previous
Screenshots
sudo apt install scrot
Add this to your i3 config
bindsym --release Print exec scrot $HOME/Pictures/screenshot-$(date +%Y-%m-%d_%H-%M-%S).png
bindsym --release Shift+Print exec scrot -s $HOME/Pictures/screenshot-$(date +%Y-%m-%d_%H-%M-%S).png
Keyboard backlight
Set read and write permissions for the keyboard brightness
sudo chmod a+rw /sys/class/leds/tpacpi::kbd_backlight/brightness
Make this script and store it under /usr/local/bin/kbd_brightness.sh
#!/bin/sh
file=/sys/class/leds/tpacpi::kbd_backlight/brightness
current=$(cat "$file")
new="$current"
if [ "$current" = "2" ]
then
new=0
else
new=$((current + 1))
fi
#if [ "$1" = "-inc" ]
#then
# if [ "$current" \< 2 ]
# then
# new=$((current + 1))
# fi
#fi
#
#if [ "$1" = "-dec" ]
#then
# if [ "$new" \> 0 ]
# then
# new=$((current - 1))
# fi
#fi
echo "$new" | tee "$file"
Save this to your i3 config
# Keyboard brightness controls
bindsym XF86Favorites exec notify-send -t 1000 'Keyboard brightness' "$(kbd_backlight.sh)"
Backlight
Set read and write permissions for the backlight brightness
sudo chmod a+rw /sys/class/backlight/intel_backlight/brightness
Make this script and store it under /usr/local/bin/kbd_brightness.sh
#!/bin/sh
file=/sys/class/backlight/intel_backlight/brightness
current=$(cat "$file")
new="$current"
max_brightness=6818
if [ "$1" = "-inc" ]
then
if [ "$current" -lt $((max_brightness - $2 + 1)) ]
then
new=$((current + $2))
else
new=$max_brightness
fi
fi
if [ "$1" = "-dec" ]
then
if [ "$current" -gt "$2" ]
then
new=$((current - $2))
else
new=1
fi
fi
echo "$new" | tee "$file"
Save this to your i3 config
# Screen brightness controls
bindsym XF86MonBrightnessUp exec notify-send -t 1000 'brightness up' "$(backlight.sh -inc 800)"
bindsym XF86MonBrightnessDown exec notify-send -t 1000 'brightness down' "$(backlight.sh -dec 800)"
i3lock-fancy
git clone https://github.com/meskarune/i3lock-fancy.git
cd i3lock-fancy
sudo make install
Autolock screen
To autolock the screen after 10mins, install xautolock and add it to the i3 config
sudo apt install xautolock
exec --no-startup-id xautolock -time 10 -locker i3lock-fancy
Display
Set the second monitor right of the integrated display. You can see all displays with the command xrandr
xrandr --output HDMI-2 --auto --right-of eDP-1
Connectivity
Bluetooth
blueman will do the job. Don't forget to add exec --no-startup-id blueman-applet
to your i3 config.
sudo apt install blueman
WLAN
NetworkManager will do the job. Don't forget to add exec --no-startup-id nm-applet
to your i3 config.
sudo apt install network-manager