Skip to content

Instantly share code, notes, and snippets.

@core1024
Created March 8, 2019 09:26
Show Gist options
  • Save core1024/dadf5eb78097f57dde4e7ddae2f00c17 to your computer and use it in GitHub Desktop.
Save core1024/dadf5eb78097f57dde4e7ddae2f00c17 to your computer and use it in GitHub Desktop.
# The sway way
#output VGA-2 pos 0 0 res 1920 1080
#output DVI-D-1 pos 1920 0 res 1920 1080
#input * {
# xkb_layout us,bg
# xkb_variant ,phonetic
# xkb_options grp:win_space_toggle,grp_led:scroll,ctrl:nocaps
#}
#exec --no-startup-id xautolock -detectsleep -time 5 -locker 'swaylock -efc 000000'
set $Locker xautolock -locknow
# Monitors alignment
# TODO: make a script that handles this
#exec --no-startup-id xrandr --output HDMI-1 --primary --auto --output VGA-1 --auto --right-of HDMI-1
# Default mouse cursor
exec --no-startup-id xsetroot -cursor_name left_ptr
# Window compositor
#exec --no-startup-id compton -b
# Wallpaper
exec --no-startup-id ~/.fehbg
# Keep track ot the last selected window
exec --no-startup-id bash -c 'xprop -root -spy _NET_ACTIVE_WINDOW | while read -a words; do [[ -z "$last" ]] || i3-msg "[id=$last] mark _last"; last="${words[4]}"; done'
# Some apps
exec_always --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec --no-startup-id /usr/lib/gsd-xsettings
exec --no-startup-id nm-applet
exec --no-startup-id udiskie -Cant -0
exec --no-startup-id mocp -S
set $mod Mod4
set $terminal i3-sensible-terminal
set $mode_system System (l) lock, (e) logout, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
bindsym l exec --no-startup-id $Locker, mode "default"
bindsym e exec --no-startup-id i3-msg exit, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Escape mode "$mode_system"
# Mouse
bindsym button2 kill
bindsym button3 floating toggle
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec $terminal
# Start music
bindsym $mod+p exec $terminal -- sh -c mocp
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
# bindsym $mod+d exec dmenu_run
# 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 --dmenu='dmenu -i -nb #201F32 -sb #B174D7'
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l 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+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l 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
# move workspace
bindsym $mod+Control+Shift+h move workspace to output left
bindsym $mod+Control+Shift+j move workspace to output down
bindsym $mod+Control+Shift+k move workspace to output up
bindsym $mod+Control+Shift+l move workspace to output right
# alternatively, you can use the cursor keys:
bindsym $mod+Control+Shift+Left move workspace to output left
bindsym $mod+Control+Shift+Down move workspace to output down
bindsym $mod+Control+Shift+Up move workspace to output up
bindsym $mod+Control+Shift+Right move workspace to output right
# Make use of the last focused window
bindsym $mod+Tab [con_mark=_last] focus
# SWAP windows
bindsym $mod+x swap with mark "_last"; [con_mark=_last] focus
bindsym $mod+Control+h mark _last; focus left; swap with mark "_last"; focus left
bindsym $mod+Control+j mark _last; focus down; swap with mark "_last"; focus down
bindsym $mod+Control+k mark _last; focus up; swap with mark "_last"; focus up
bindsym $mod+Control+l mark _last; focus right; swap with mark "_last"; focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Control+Left mark _last; focus left; swap with mark "_last"; focus left
bindsym $mod+Control+Down mark _last; focus down; swap with mark "_last"; focus down
bindsym $mod+Control+Up mark _last; focus up; swap with mark "_last"; focus up
bindsym $mod+Control+Right mark _last; focus right; swap with mark "_last"; focus right
# split in vertical orientation
bindsym $mod+v split v
# split in horizontal orientation
bindsym $mod+Shift+v split h
# 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+grave floating toggle
# change focus between tiling / floating windows
bindsym $mod+grave focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# open empty container, IDK why
bindsym $mod+o open
# focus the child container
#bindsym $mod+d focus child
# switch to workspace
bindsym mod1+Shift+Tab workspace prev
bindsym mod1+Tab workspace next
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# 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 exit
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
bindsym h resize shrink width 6 px or 6 ppt
bindsym j resize grow height 6 px or 6 ppt
bindsym k resize shrink height 6 px or 6 ppt
bindsym l resize grow width 6 px or 6 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 6 px or 6 ppt
bindsym Down resize grow height 6 px or 6 ppt
bindsym Up resize shrink height 6 px or 6 ppt
bindsym Right resize grow width 6 px or 6 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -q sset 'Master' 5%+
bindsym XF86AudioLowerVolume exec --no-startup-id amixer -q sset 'Master' 5%-
bindsym XF86AudioMute exec --no-startup-id amixer -q sset 'Master' toggle
# Sreen brightness controls
bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness
# Touchpad controls
#bindsym XF86TouchpadToggle exec /some/path/toggletouchpad.sh # toggle touchpad
# Media player controls
#bindsym XF86AudioPlay exec mocp -G
#bindsym XF86AudioStop exec mocp -s
#bindsym XF86AudioNext exec mocp -f
#bindsym XF86AudioPrev exec mocp -r
# Styles
default_border normal 3
font pango:Hack 9
# colors
client.focused #633f7e #633f7e #ffffff #b174d7 #633f7e
client.focused_inactive #3a497d #3a497d #ffffff #4c5e9b #000000
client.unfocused #181726 #181726 #dcdccc #3c3b37 #000000
client.urgent #dca3a3 #fb5e19 #dcdccc #3c3b37 #000000
# Window rules
for_window [class="Yad"] floating enable border pixel 0
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
position bottom
binding_mode_indicator yes
font pango:Hack 9
separator_symbol "⋆"
#tray_output primary
#tray_output all
status_command SCRIPT_DIR=~/.config/i3blocks i3blocks -v
colors {
#background #181726
#statusline #dcdccc
background #201f32
statusline #dcdccc
focused_workspace #b174d7 #b174d7 #ffffff
active_workspace #b174d7 #633F7E #dcdccc
inactive_workspace #3a497d #3a497d #dcdccc
urgent_workspace #fb5e19 #fb5e19 #ffffff
binding_mode #fb5e19 #fb5e19 #ffffff
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment