Skip to content

Instantly share code, notes, and snippets.

@kafran
Created October 12, 2017 12:20
Show Gist options
  • Save kafran/a30c579090938b1d8980cc605b3596e9 to your computer and use it in GitHub Desktop.
Save kafran/a30c579090938b1d8980cc605b3596e9 to your computer and use it in GitHub Desktop.
Ubuntu Mate + i3 configuration files
# .config/i3/config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
#font pango:monospace 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
font pango:Ubuntu Regular 10
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
focus_follows_mouse no
# start a terminal
bindsym $mod+Return exec mate-terminal
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
# bindsym $mod+d exec dmenu_run
bindsym $mod+d exec rofi -show drun
#bindcode --release 133 exec rofi -show drun
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# change focus
#bindsym $mod+j focus left
#bindsym $mod+k focus down
#bindsym $mod+l focus up
#bindsym $mod+ccedilla focus right
# alternatively, you can use the cursor 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+j move left
#bindsym $mod+Shift+k move down
#bindsym $mod+Shift+l move up
#bindsym $mod+Shift+ccedilla move right
# alternatively, you can use the cursor 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 in horizontal orientation
bindsym $mod+h split h;exec notify-send 'tile horizontally'
# split in vertical orientation
bindsym $mod+v split v;exec notify-send 'tile vertically'
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
set $wsp1 "1: "
set $wsp2 "2: "
set $wsp3 "3: "
set $wsp4 "4: "
set $wsp5 "5: "
set $wsp6 "6: "
set $wsp7 "7: "
set $wsp8 "8: "
set $wsp9 "9: "
# switch to workspace
bindsym $mod+1 workspace $wsp1
bindsym $mod+2 workspace $wsp2
bindsym $mod+3 workspace $wsp3
bindsym $mod+4 workspace $wsp4
bindsym $mod+5 workspace $wsp5
bindsym $mod+6 workspace $wsp6
bindsym $mod+7 workspace $wsp7
bindsym $mod+8 workspace $wsp8
bindsym $mod+9 workspace $wsp9
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $wsp1
bindsym $mod+Shift+2 move container to workspace $wsp2
bindsym $mod+Shift+3 move container to workspace $wsp3
bindsym $mod+Shift+4 move container to workspace $wsp4
bindsym $mod+Shift+5 move container to workspace $wsp5
bindsym $mod+Shift+6 move container to workspace $wsp6
bindsym $mod+Shift+7 move container to workspace $wsp7
bindsym $mod+Shift+8 move container to workspace $wsp8
bindsym $mod+Shift+9 move container to workspace $wsp9
# lock screen
bindsym $mod+l exec --no-startup-id mate-screensaver-command -l
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# Set shut down, restart and locking features
bindsym $mod+0 mode "$mode_system"
set $mode_system (l)ock, (e)xit, switch_(u)ser, (s)uspend, (r)eboot, ( +s)hutdown
mode "$mode_system" {
bindsym l exec --no-startup-id $HOME/.config/i3/i3exit lock, mode "default"
bindsym s exec --no-startup-id $HOME/.config/i3/i3exit suspend, mode "default"
bindsym u exec --no-startup-id $HOME/.config/i3/i3exit switch_user, mode "default"
bindsym e exec --no-startup-id $HOME/.config/i3/i3exit logout, mode "default"
bindsym r exec --no-startup-id $HOME/.config/i3/i3exit reboot, mode "default"
bindsym Shift+s exec --no-startup-id $HOME/.config/i3/i3exit shutdown, mode "default"
# exit system mode: "Enter" or "Escape"
bindsym Return mode "default"
bindsym Escape mode "default"
}
# resize window (you can also use the mouse for that)
mode "resize" {
bindsym Left resize shrink width 10 px or 1 ppt
bindsym Down resize grow height 10 px or 1 ppt
bindsym Up resize shrink height 10 px or 1 ppt
bindsym Right resize grow width 10 px or 1 ppt
bindsym Shift+Left resize shrink width 20 px or 5 ppt
bindsym Shift+Down resize grow height 20 px or 5 ppt
bindsym Shift+Up resize shrink height 20 px or 5 ppt
bindsym Shift+Right resize grow width 20 px or 5 ppt
bindsym 1 mode "default", resize set 800 600
#bindsym 2 mode "default", resize set 1500 600
#bindsym 3 mode "default", resize set 1200 1000
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# Open applications on specific workspaces
assign [class="Firefox"] $wsp1
assign [class="^Spotify$" instance="^spotify$"] $wsp9
assign [class="Thunar"] $wsp4
assign [class="Caja"] $wsp4
assign [class="vlc"] $wsp7
assign [class="keepassxc"] $wsp8
assign [class="^Chromium-browser$" instance="^crx_hecfofbbdfadifpemejbbdcjmfmboohj$"] $wsp7
assign [class="Geany"] $wsp3
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_role="About"] floating enable
#for_window [class="(?i)virtualbox"] floating enable border normal
for_window [class="Nitrogen"] floating enable sticky enable
for_window [class="Mate-appearance-properties"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
for_window [window_type="dropdown_menu"] floating enable
#for_window [window_type="popup_menu] floating enable
#for_window [window_type="tooltip"] floating enable
for_window [class="^Spotify$" instance="^spotify$"] move to workspace $wsp9
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status -c $HOME/.config/i3/i3status
separator_symbol ⦁
position top
colors {
background #2C001E
separator #E95420
statusline #E95420
# State Border BG Text
focused_workspace #E95420 #2C001E #E95420
active_workspace #F4AA90 #2C001E #F4AA90
inactive_workspace #6B4C61 #333333 #AEA79F
urgent_workspace #6B4C61 #E95420 #2C001E
}
}
new_window pixel 5
new_float pixel 5
# Property Name Border BG Text Indicator Child Border
client.focused #E95420 #E95420 #2C001E #F08763 #E95420
client.focused_inactive #2C001E #2C001E #E95420 #202020 #202020
client.unfocused #2C001E #2C001E #D0D0D0 #151515 #202020
client.urgent #FF0086 #FF0086 #151515 #FF0086 #77216F
client.placeholder #151515 #151515 #D0D0D0 #151515 #151515
client.background #2C001E
# Pulse Audio controls (Not needed any more. Now controlled by Mate)
#bindsym XF86AudioRaiseVolume exec --no-startup-id "pactl set-sink-volume 1 +5%; notify-send 'volume up'"
#bindsym XF86AudioLowerVolume exec --no-startup-id "pactl set-sink-volume 1 -5%; notify-send 'volume down'"
#bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 1 toggle # mute sound
# Sreen brightness controls (Not needed any more. Now controlled by Mate)
#bindsym XF86MonBrightnessUp exec "xbacklight -inc 20; notify-send 'brightness up'"
#bindsym XF86MonBrightnessDown exec "xbacklight -dec 10; notify-send 'brightness down'"
# Autostart .desktop applications
exec dex -ae i3
#!/usr/bin/env bash
# .config/i3/i3exit
# with openrc use loginctl
[[ $(cat /proc/1/comm) == "systemd" ]] && logind=systemctl || logind=loginctl
case "$1" in
lock)
mate-screensaver-command -l
;;
logout)
i3-msg exit
;;
switch_user)
dm-tool switch-to-greeter
;;
suspend)
mate-screensaver-command -l && $logind suspend
;;
reboot)
$logind reboot
;;
shutdown)
$logind poweroff
;;
*)
echo "== ! i3exit: missing or invalid argument ! =="
echo "Try again with: lock | logout | switch_user | suspend | hibernate | reboot | shutdown"
exit 2
esac
exit 0
# .config/i3/i3status
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
output_format = "i3bar"
#separator = "•"
colors = true
interval = 1
color_good = "#E95420"
color_degraded = "#EB6536"
color_bad = "#AEA79F"
}
order += "disk /"
order += "disk /home"
order += "battery 1"
#order += "load"
order += "cpu_usage"
order += "cpu_temperature 0"
order += "ethernet _first_"
order += "wireless _first_"
order += "tztime local"
wireless _first_ {
format_up = " %quality (%essid)"
format_down = ""
}
ethernet _first_ {
# if you use %speed, i3status requires root privileges
format_up = " %ip"
format_down = ""
}
battery 1 {
format = "%status %percentage %remaining"
status_full = ""
status_chr = ""
status_bat = ""
low_threshold = "15"
threshold_type = "percentage"
integer_battery_capacity = "true"
hide_seconds = "true"
}
tztime local {
format = " %a. %d/%m %H:%M:%S"
}
#load {
# format = " %1min %5min %15min"
#}
cpu_usage {
format = " %usage"
max_threshold = "75"
degraded_threshold = "50"
}
cpu_temperature 0 {
format = " %degrees ºC"
max_threshold = "50"
}
disk / {
format = " %avail"
threshold_type = "percentage_avail"
low_threshold = "10"
}
disk /home {
format = " %avail"
threshold_type = "percentage_avail"
low_threshold = "10"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment