Skip to content

Instantly share code, notes, and snippets.

@iambrj
Created October 31, 2021 09:51
Show Gist options
  • Save iambrj/b5eb84196349cd72bed68b03d4a2f9ef to your computer and use it in GitHub Desktop.
Save iambrj/b5eb84196349cd72bed68b03d4a2f9ef to your computer and use it in GitHub Desktop.
# vim: filetype=i3
# export BROWSER="chromium"
# export TERMINAL="xfce4-terminal"
# #---Basic Definitions---# #
# reload config
bindsym $mod+Shift+r reload
# exit i3
bind sym $mod+Shift+e "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'"
# Needed for i3-gaps
for_window [class="^.*"] border pixel 3
gaps inner 15
gaps outer 15
set $term --no-startup-id terminator
set $mod Mod4
floating_modifier Mod4
set $shutdown sudo -A shutdown -h now
set $reboot sudo -A reboot
set $hibernate sudo -A systemctl suspend
bindsym $mod+apostrophe split horizontal;;exec $term
bindsym $mod+slash split vertical;;exec $term
# #---Starting External Scripts---# #
# Setting the background and colorscheme:
exec --no-startup-id feh --bg-fill ~/wall/rivendell.png
# Unclutter daemon
exec --no-startup-id unclutter -idle 0.01 -root
# Torrent daemon:
#exec --no-startup-id transmission-daemon
# Unclutter makes the mouse invisible after a brief period
exec --no-startup-id unclutter
# Run the script to update the mpd i3block on change.
exec --no-startup-id i3mpdupdate
# Run np-applet
exec --no-startup-id nm-applet
# Set Xresources colors:
set_from_resource $darkblack color0 #000000
set_from_resource $black color8 #000000
set_from_resource $darkred color1 #000000
set_from_resource $red color9 #000000
set_from_resource $darkgreen color2 #000000
set_from_resource $green color10 #000000
set_from_resource $darkyellow color3 #000000
set_from_resource $yellow color11 #000000
set_from_resource $darkblue color4 #000000
set_from_resource $blue color12 #000000
set_from_resource $darkmagenta color5 #000000
set_from_resource $magenta color13 #000000
set_from_resource $darkcyan color6 #000000
set_from_resource $cyan color14 #000000
set_from_resource $darkwhite color7 #000000
set_from_resource $white color15 #000000
set $transparent #00000000
font pango:DejaVu Sans Mono, Terminus Bold Semi-Condensed 9
# BORDER BACKGROUND TEXT INDICATOR CHILD_BORDER
client.focused #090069 #5600ff #1c1c1c $darkmagenta #6e19ff
client.unfocused #076678 #458588 #1c1c1c $darkblue $darkblack
client.focused_inactive #6314ff #5600ff #1c1c1c $darkblue $darkblack
client.urgent $darkred $darkred $black $darkred $darkred
client.background $black
bar {
i3bar_command i3bar --transparency
status_command i3blocks -c ~/.config/i3/i3blocks.conf
position top
font pango:mono 9
colors {
background #1c1c1cff
statusline $darkwhite
separator $cyan
focused_workspace $blue $blue $darkblack
active_workspace $blue $blue $darkwhite
inactive_workspace $darkblack $darkblack $white
urgent_workspace $darkblack $darkblack $white
}
mode dock
modifier None
}
# #---Basic Bindings---# #
bindsym $mod+Return exec $term
bindsym $mod+Shift+Return exec --no-startup-id samedir
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
bindsym $mod+Shift+Escape exec --no-startup-id prompt "Are you sure you want to leave i3?" "i3-msg exit"
# bindsym $mod+BackSpace
bindsym $mod+Shift+BackSpace exec --no-startup-id prompt "Are you sure you want to reboot?" "$reboot"
##bindsym $mod+grave
##bindsym $mod+asciitilde
#STOP/HIDE EVERYTHING:
bindsym $mod+Shift+Delete exec --no-startup-id lmc truemute ; exec $truepause ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e ranger
# #---Letter Key Bindings---# #
bindsym $mod+q [con_id="__focused__" instance="^(?!math|dropdown).*$"] kill
bindsym $mod+Shift+q [con_id="__focused__" instance="^(?!math|dropdown).*$"] kill
bindsym $mod+r exec $term -e ranger
bindsym $mod+v exec $term -e nvim
bindsym $mod+Shift+v exec $term -e sudo nvim
bindsym $mod+e exec emacs
bindsym $mod+Shift+t gaps inner current set 0; gaps outer current set 0
bindsym $mod+i exec $term -e htop
bindsym $mod+Shift+i exec --no-startup-id "bash ~/.scripts/i3resize up"
bindsym $mod+Shift+o exec --no-startup-id "bash ~/.scripts/i3resize right"
bindsym $mod+d exec --no-startup-id rofi -mode "run#window#drun" -show\
drun -matching regex -show-icons -theme softsidebar\
bindsym $mod+f fullscreen toggle
bindsym $mod+Shift+f exec --no-startup-id chromium
bindsym $mod+t layout tabbed
bindsym $mod+s layout toggle split
bindsym $mod+o layout stacking
bindsym $mod+m exec --no-startup-id vlc
bindsym $mod+h focus left
bindsym $mod+Shift+h move left 30
bindsym $mod+j focus down
bindsym $mod+Shift+j move down 30
bindsym $mod+k focus up
bindsym $mod+Shift+k move up 30
bindsym $mod+l focus right
bindsym $mod+Shift+l move right 30
bindsym $mod+z gaps outer current plus 5
bindsym $mod+Shift+z gaps outer current minus 5
bindsym $mod+x gaps inner current plus 5
bindsym $mod+Shift+x gaps inner current minus 5
bindsym $mod+b bar mode toggle
bindsym $mod+Shift+b floating toggle; sticky toggle; exec --no-startup-id bottomleft
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+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
# move between adjacent workspaces
bindsym $mod+plus workspace next
bindsym $mod+minus workspace prev
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
for_window [class="Pinentry"] sticky enable
for_window [class="sent"] border pixel 0px
for_window [class="Blender"] move to workspace $ws6
for_window [class="marble"] move to workspace $ws7
for_window [title="GIMP Startup"] move workspace $ws5
for_window [class="Gimp"] move workspace $ws5
for_window [window_role="GtkFileChooserDialog"] resize shrink height 10 px
for_window [title="Default - Wine desktop"] floating enable
# #---Arrow Keys---# #
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# #---Media Keys---# #
# Volume keys
bindsym $mod+less exec --no-startup-id lmc prev
bindsym $mod+Shift+less exec --no-startup-id lmc replay
bindsym $mod+greater exec --no-startup-id lmc next
bindsym $mod+Shift+greater exec --no-startup-id lmc next
# For advancing forward/backward in an mpd song
bindsym $mod+bracketleft exec --no-startup-id lmc back 10
bindsym $mod+Shift+bracketleft exec --no-startup-id lmc back 120
bindsym $mod+bracketright exec --no-startup-id lmc forward 10
bindsym $mod+Shift+bracketright exec --no-startup-id lmc forward 120
# For screenshots and recording
bindsym $mod+Shift+a exec --no-startup-id gnome-screenshot -i
bindsym $mod+Shift+s exec --no-startup-id gnome-screenshot
bindsym $mod+Print exec --no-startup-id dmenurecord
bindsym $mod+Scroll_Lock exec --no-startup-id "killall screenkey || screenkey"
bindsym $mod+Delete exec $stoprec
bindsym XF86Launch1 exec $stoprec & xset dpms force off
# Screen brightness controls
bindsym $mod+n exec xbacklight -inc 20 # increase screen brightness
bindsym $mod+Shift+n exec xbacklight -inc 1 # increase screen brightness
bindsym $mod+p exec xbacklight -dec 20 # decrease screen brightness
bindsym $mod+Shift+p exec xbacklight -dec 1 # increase screen brightness
# Volume controls
bindysm XF86AudioRaiseVolume exec --no-startup-id pactl -- set-sink-volume 0 +5%
bindysm XF86AudioRaiseVolume exec --no-startup-id pactl -- set-sink-volume 0 +5%
bindysm XF86AudioLowerVolume exec --no-startup-id pactl -- set-sink-volume 0 -5%
bindysm XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle
# Lock the screen
bindsym $mod+F9 exec --no-startup-id i3lock --ringcolor=5d52ffaa \\
--keyhlcolor=5d52ffbb --insidevercolor=5d52ffaa --ringvercolor=5d52ffaa \\
--timestr="%H:%M:%S" --time-align=0 --timecolor=000000aa -n \\
-i ~/wall/eval.png -k --ring-width=1.0; exec --no-startup-id xset dpms force off
# Turn off screen
bindsym $mod+F8 exec --no-startup-id xset dpms force off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment