Skip to content

Instantly share code, notes, and snippets.

@lightdiscord
Last active February 8, 2020 20:39
Show Gist options
  • Select an option

  • Save lightdiscord/7c0156702834f302f85c1df8c0f1d4fb to your computer and use it in GitHub Desktop.

Select an option

Save lightdiscord/7c0156702834f302f85c1df8c0f1d4fb to your computer and use it in GitHub Desktop.
i3 configuration
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $alt Mod1
set $super Mod4
set $mod Mod4
font pango: Source Code Pro 9
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
floating_modifier $mod
# Shortcut to open a terminal
bindsym $mod+Return exec alacritty
# Shortcut to kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+space exec rofi -show drun
bindsym $alt+Tab exec rofi -show window
bindsym $super+Tab workspace next_on_output
bindsym $super+Shift+Tab workspace prev_on_output
# Change focus
bindsym $mod+h focus left
bindsym $mod+Left focus left
bindsym $mod+j focus down
bindsym $mod+Down focus down
bindsym $mod+k focus up
bindsym $mod+Up focus up
bindsym $mod+l focus right
bindsym $mod+Right focus right
# Move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+l move right
bindsym $mod+Shift+Right move right
# # split in horizontal orientation
# bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# 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+z 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+q focus parent
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+ampersand workspace number $ws1
bindsym $mod+eacute workspace number $ws2
bindsym $mod+quotedbl workspace number $ws3
bindsym $mod+apostrophe workspace number $ws4
bindsym $mod+parenleft workspace number $ws5
bindsym $mod+minus workspace number $ws6
bindsym $mod+egrave workspace number $ws7
bindsym $mod+underscore workspace number $ws8
bindsym $mod+ccedilla workspace number $ws9
bindsym $mod+agrave workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+ampersand move container to workspace number $ws1
bindsym $mod+Shift+eacute move container to workspace number $ws2
bindsym $mod+Shift+quotedbl move container to workspace number $ws3
bindsym $mod+Shift+apostrophe move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+minus move container to workspace number $ws6
bindsym $mod+Shift+egrave move container to workspace number $ws7
bindsym $mod+Shift+underscore move container to workspace number $ws8
bindsym $mod+Shift+ccedilla move container to workspace number $ws9
bindsym $mod+Shift+agrave move container to workspace number $ws10
# 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
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# Resize mode for windows
mode "resize" {
# Pressing left will shrink the window’s width.
bindsym h resize shrink width 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt
# Pressing right will grow the window’s width.
bindsym j resize grow height 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
# Pressing up will shrink the window’s height.
bindsym k resize shrink height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
# Pressing down will grow the window’s height.
bindsym l resize grow width 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"
}
for_window [class="^.*"] border pixel 1
new_window 1pixel
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status
}
exec --no-startup-id "systemctl --user start randomize-background.service"
{
packages = import ./packages.nix;
files = import ./files.nix;
}
{
".config/i3/config" = ./config;
}
{ i3, i3status }@packages:
builtins.attrValues packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment