Skip to content

Instantly share code, notes, and snippets.

@j1ah0ng
Created November 29, 2019 08:25
Show Gist options
  • Save j1ah0ng/2a76c80ff21e33a21f7b101eddb837ca to your computer and use it in GitHub Desktop.
Save j1ah0ng/2a76c80ff21e33a21f7b101eddb837ca to your computer and use it in GitHub Desktop.
Dotfiles!
# x env vars
exec --no-startup-id "/home/sushisharkjl/.config/i3/save_dbus.sh"
# mod keys
set $mod Mod4
set $alt Mod1
# Background and HDMI monitor
exec --no-startup-id "xrandr --output HDMI1 --pos 2560x0"
exec --no-startup-id "nitrogen --set-zoom-fill /home/sushisharkjl/Pictures/Wallpapers/wallpaper &"
exec --no-startup-id "compton -b -f -D 3 --respect-prop-shadow &"
exec --no-startup-id "xsettingsd &"
# Misc
exec --no-startup-id wicd-client -t
exec --no-startup-id dunst
# exec_always --no-startup-id flashfocus
# Auto workspaces
workspace 1 output eDP1
workspace 3 output eDP1
workspace 5 output eDP1
workspace 7 output eDP1
workspace 9 output eDP1
workspace 2 output HDMI1
workspace 4 output HDMI1
workspace 6 output HDMI1
workspace 8 output HDMI1
workspace 10 output HDMI1
# Scratchpad
bindsym $mod+minus move scratchpad
bindsym $mod+Shift+minus scratchpad show
# wicd
bindsym $mod+Shift+n exec wicd-gtk
# Screenshotting
bindsym Print exec --no-startup-id "maim | xclip -selection clipboard -t image/png"
bindsym Control+Print exec --no-startup-id "maim -s | xclip -selection clipboard -t image/png"
bindsym Shift+Print exec --no-startup-id "maim > ~/Pictures/$(date -I'seconds').png"
bindsym Shift+Control+Print exec --no-startup-id "maim -s > ~/Pictures/$(date -I'seconds').png"
# notification muting
bindsym $mod+m exec "killall -SIGUSR1 dunst"
bindsym $mod+Shift+m exec "killall -SIGUSR2 dunst"
# Set lock
# bindsym $alt+Shift+l exec "i3lock -i /home/sushisharkjl/Pictures/blur.png -f -t; systemctl suspend"
# bindsym $alt+l exec "i3lock -i /home/sushisharkjl/Pictures/blur.png -f -t; ./home/sushisharkjl/.config/i3/mute_dunst.sh &"
bindsym $alt+Shift+l exec "/home/sushisharkjl/.config/i3/blur_lock.sh && systemctl suspend"
bindsym $alt+l exec "/home/sushisharkjl/.config/i3/blur_lock.sh"
# Undock
bindsym $alt+Shift+Escape exec xrandr --output HDMI1 --off
# Dock
bindsym $alt+Shift+Control+Escape exec "xrandr --output HDMI1 --auto && xrandr --output HDMI1 --pos 2560x0 && nitrogen --set-zoom-fill /home/sushisharkjl/Pictures/Wallpapers/wallpaper &"
# Bind brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 2.5
bindsym XF86MonBrightnessUp exec xbacklight -inc 2.5
bindsym $alt+XF86MonBrightnessDown exec xbacklight -dec 10
bindsym $alt+XF86MonBrightnessUp exec xbacklight -inc 10
# bind volume
bindsym XF86AudioLowerVolume exec amixer set Master 5%-
bindsym XF86AudioRaiseVolume exec amixer set Master 5%+
bindsym XF86AudioMute exec amixer set Master toggle
bindsym XF86AudioMicMute exec amixer set Capture toggle
# bind media
bindsym $alt+period exec --no-startup-id playerctl next
bindsym $alt+comma exec --no-startup-id playerctl play-pause
bindsym $alt+m exec --no-startup-id playerctl previous
bindsym XF86AudioNext exec --no-startup-id playerctl next
bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause
bindsym XF86AudioPrev exec --no-startup-id playerctl previous
# launch shortcuts
bindsym $mod+n exec --no-startup-id nautilus &
bindsym $mod+Shift+f exec --no-startup-id firefox-esr &
bindsym $mod+Shift+Return exec --no-startup-id kitty --class kitty-float
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:IBM Plex Sans 14
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec kitty
# kill focused window
bindsym $mod+Shift+q kill
bindsym $alt+F4 kill
# killall
bindsym $mod+Shift+Control+q [class=".*"] kill
# use rofi as the launcher
bindsym --release $mod+space exec --no-startup-id rofi -lines 12 -padding 18 -width 60 -location 0 -show drun -sidebar-mode -columns 3 -font 'DejaVu Sans Mono for Powerline 14'
# alt-tab behaviour
bindsym $alt+Tab focus left
# mod-tab behaviour
bindsym $mod+Tab workspace next
bindsym $mod+Shift+Tab workspace prev
# emulate Windows workspace switching
bindsym $mod+Control+Left workspace prev
bindsym $mod+Control+Right workspace next
# 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
# split in horizontal orientation
bindsym $mod+b 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+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+d floating toggle
# floating defaults
for_window [class="Nautilus"] floating enable
for_window [class="Gnome-calculator"] floating enable
for_window [class="Wicd-client.py"] floating enable
for_window [class="feh"] floating enable
for_window [class="mpv"] floating enable
for_window [class="kitty-float"] floating enable
for_window [class="jetbrains-toolbox"] floating enable
for_window [class="jetbrains-toolbox"] bindsym Escape kill
# change focus between tiling / floating windows
bindsym $mod+d focus mode_toggle
# focus the parent container
bindsym $mod+a 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+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 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
# 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 'System shutdown?' -B 'Shutdown' 'i3-msg exit; systemctl poweroff' -B 'Reboot' 'i3-msg exit; systemctl reboot' -f "
# 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 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 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"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
# bar {
# wheel_up_cmd nop
# wheel_down_cmd nop
# status_command i3status
# i3bar_command i3bar -t
# colors {
# background #2e344000
# statusline #d8dee9ff
# separator #d8dee9ff
# focused_workspace #88c0d0ff #88c0d0ff #2e3440ff
# active_workspacee #88c0d0ff #88c0d0ff #2e3440ff
# inactive_workspace #2e3440cc #2e3440cc #d8dee9ff
# urgent_workspace #ebcb8bff #ebeb8bff #2e340ff
# }
# }
# Use polybar
exec_always --no-startup-id ~/.config/i3/polybar.sh &
### i3-gaps stuff ###
# Necessary for i3-gaps to work properly (pixel can be any value)
for_window [class="^.*"] border pixel 0
# Smart Gaps
# smart_gaps inverse_outer
# Smart Borders
# smart_borders on
# smart_borders no_gaps
# Set inner/outer gaps
gaps inner 15
gaps outer 0
# Gaps mode
set $mode_gaps Gaps: (o) outer, (i) inner
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
bindsym $mod+Shift+g mode "$mode_gaps"
mode "$mode_gaps" {
bindsym o mode "$mode_gaps_outer"
bindsym i mode "$mode_gaps_inner"
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_inner" {
bindsym plus gaps inner current plus 5
bindsym minus gaps inner current minus 5
bindsym 0 gaps inner current set 0
bindsym Shift+plus gaps inner all plus 5
bindsym Shift+minus gaps inner all minus 5
bindsym Shift+0 gaps inner all set 0
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_outer" {
bindsym plus gaps outer current plus 5
bindsym minus gaps outer current minus 5
bindsym 0 gaps outer current set 0
bindsym Shift+plus gaps outer all plus 5
bindsym Shift+minus gaps outer all minus 5
bindsym Shift+0 gaps outer all set 0
bindsym Return mode "default"
bindsym Escape mode "default"
}
exec --no-startup-id dbus-send \
--session \
--print-reply=literal \
--dest=org.gnome.SessionManager \
"/org/gnome/SessionManager" \
org.gnome.SessionManager.RegisterClient \
"string:i3" \
"string:$DESKTOP_AUTOSTART_ID"
[bar/low-effort#!/usr/bin/env bash
killall -q polybar;
while pgrep -u $UID -x polybar >/dev/null; do
sleep 1;
done
echo "---" | tee -a /tmp/polybar1.log;
polybar white;
]
;------------;
; DIMENSIONS ;
;------------;
width = 100%
height = 20
offset-y = 0
offset-x = 0
border-top-size = 12
border-bottom-size = 0
border-right-size = 15
border-left-size = 15
;----------;
; LOCATION ;
;----------;
bottom = false
override-redirect = false
;-------;
; FONTS ;
;-------;
font-0 = "IBM Plex Sans Text:style=Text:pixelsize=12;3"
font-1 = "Font Awesome 5 Free:style=Solid:pixelsize=12;3"
font-2 = "Font Awesome 5 Free:style=Regular:pixelsize=12;3"
font-3 = "Font Awesome 5 Brands:style=Regular:pixelsize=12;3"
;--------;
; COLORS ;
;--------;
background = 0
foreground = #d8dee9
border-color = 0
;---------------;
; MISCELLANEOUS ;
;---------------;
fixed-center = true
padding-left = 2
padding-right = 2
module-margin = 1.5
modules-left = volume backlight battery
modules-center = i3
modules-right = cpu disk wlan ethlocal ethdock date time
tray-position = none
tray-detached = true
enable-ipc = true
;--------------------------------------------------
;---------;
; MODULES ;
;---------;
[module/i3]
type = internal/i3
pin-workspaces = true
strip-wsnumbers = true
enable-scroll = false
label-unfocused-foreground = #afafaf
label-focused-foreground = #88d0c0
label-urgent-foreground = #bf616a
[module/time]
type = internal/date
interval = 1.0
date =  %H:%M:%S
[module/date]
type = internal/date
date =  %A %Y.%m.%d
label = %date%
[module/disk]
type = internal/fs
mount-0 = /
interval = 1
fixed-values = true
label-mounted =  %free%
format-mounted = <label-mounted>
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
time-format = %H:%M
poll-interval = 1
full-at = 93
label-muted-foreground = #bf616a
label-discharging = %percentage%% %time% %consumption%W
label-charging = %percentage%% %time% %consumption%W
label-full = %percentage%% %time% %consumption%W
format-discharging = <ramp-capacity> <label-discharging>
format-full = <ramp-capacity> <label-full>
format-charging =  <label-charging>
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
[module/volume]
type = internal/alsa
format-volume = <ramp-volume> <label-volume>
format-muted =  0%
ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 
[module/backlight]
type = internal/backlight
; Use the following command to list available cards:
; $ ls -1 /sys/class/backlight/
card = intel_backlight
format = <ramp> <label>
label = %percentage%%
ramp-0 = 
ramp-1 = 
ramp-2 = 
[module/cpu]
type = internal/cpu
label =  %percentage%%
[module/memory]
type = internal/memory
label =  %gb_used%
[module/wlan]
type = internal/network
interface = wlp2s0
label-connected =  %ifname%: %essid% (%local_ip%, %signal%)
label-connected-foreground = #a3be8c
label-disconnected =  %ifname%: n/a
label-disconnected-foreground = #bf616a
[module/ethlocal]
type = internal/network
interface = enp0s31f6
label-connected =  %ifname%: (%local_ip%)
label-connected-foreground = #a3be8c
label-disconnected =  %ifname%: n/a
label-disconnected-foreground = #bf616a
[module/ethdock]
type = internal/network
interface = enx0
label-connected =  %ifname%: (%local_ip%)
label-connected-foreground = #a3be8c
label-disconnected =
label-disconnected-foreground = #bf616a
; vim:ft=dosini
#!/usr/bin/env bash
killall -q polybar;
while pgrep -u $UID -x polybar >/dev/null; do
sleep 1;
done
echo "---" | tee -a /tmp/polybar1.log;
polybar low-effort;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment