Skip to content

Instantly share code, notes, and snippets.

@ghostface
Last active August 6, 2021 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghostface/4aba085bf575b0b9cd3d04ff5e5f1732 to your computer and use it in GitHub Desktop.
Save ghostface/4aba085bf575b0b9cd3d04ff5e5f1732 to your computer and use it in GitHub Desktop.
~/.config/sway/config
###########################################################
# Christophs sway config
###########################################################
set $mod Mod4
mouse_warping container
# Font
font pango:Monospace 12
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec alacritty
# kill focused window
bindsym $mod+F4 kill
bindsym $mod+w kill
# super kill
bindsym $mod+k exec kill $(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | .pid')
# focus urgent window
bindsym $mod+u exec i3-msg '[urgent=latest] focus'
# start dmenu (a program launcher)
#bindsym $mod+space exec dmenu_run -fn 'Monospace-14'
bindsym $mod+shift+space exec wofi --show drun -I
bindsym $mod+space exec rofi -show run
## Clipboard
# copy from clipboard manager
bindsym $mod+shift+c exec clipman pick -t wofi
exec wl-paste -t text --watch clipman store --no-persist
exec wl-paste -p -t text --watch clipman store --no-persist -P --histpath="~/.local/share/clipman-primary.json"
# for logging
#exec wl-paste -t text --watch clipman store 1>> PATH/TO/LOGFILE 2>&1 &
exec clipman restore
# change focus
#bindsym $mod+j focus left
#bindsym $mod+k focus down
#bindsym $mod+l focus up
bindsym $mod+odiaeresis focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Right focus right
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Prior exec i3-switch-tabs left;
bindsym $mod+Next exec i3-switch-tabs 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+odiaeresis 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
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+y layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+plus floating toggle
# change focus between tiling / floating windows
bindsym Control+$mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+c focus child
#Workspace setup
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"
workspace $WS1 output eDP1
workspace $WS2 output eDP1
workspace $WS3 output HDMI-A-1
workspace $WS4 output eDP1
workspace $WS5 output eDP1
workspace $WS6 output eDP1
workspace $WS7 output HDMI-A-1
# 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
bindsym $mod+q workspace next_on_output
bindsym $mod+Shift+q workspace prev_on_output
# 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
# move workspace to output
bindsym Control+$mod+Right move workspace to output right
bindsym Control+$mod+Left move workspace to output left
bindsym Control+$mod+Up move workspace to output up
bindsym Control+$mod+Down move workspace to output down
# Automatic back-and-forth when switching to the current workspace
workspace_auto_back_and_forth yes
# Delay removal of urgency by 0.5s
force_display_urgency_hint 500 ms
# reload the configuration file
bindsym $mod+Shift+r reload
# 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'"
#########
##RESIZE
#########
# 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 j resize shrink width 5 px or 5 ppt
bindsym k resize grow height 5 px or 5 ppt
bindsym l resize shrink height 5 px or 5 ppt
bindsym odiaeresis resize grow width 5 px or 5 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 5 px or 5 ppt
bindsym Down resize grow height 5 px or 5 ppt
bindsym Up resize shrink height 5 px or 5 ppt
bindsym Right resize grow width 5 px or 5 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#########
#SCRATCHPAD
#########
#exec --no-startup-id i3-sensible-terminal -T "Scratch Terminal"
#for_window [title="Scratch Terminal"] mark "scratch_terminal"; move scratchpad
#bindsym $mod+grave [con_mnnark="scratch_terminal"] scratchpad show
# Dash Scratchpad (Gedit)
bindsym $mod+Shift+minus mark "scratch_minus", move scratchpad
bindsym $mod+minus [con_mark="scratch_minus"] scratchpad show
# Period Scratchpad (terminal)
bindsym $mod+Shift+period mark "scratch_dot", move scratchpad
bindsym $mod+period [con_mark="scratch_dot"] scratchpad show
# Comma Scratchpad (whatever)
bindsym $mod+Shift+comma mark "scratch_comma", move scratchpad
bindsym $mod+comma [con_mark="scratch_comma"] scratchpad show
# Show the sup-mail scratchpad window, if any.
#bindsym mod4+s [title="^Sup ::"] scratchpad show
#########
# SWAYBAR
#########
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
colors {
background #00000000
# border background text
focused_workspace #B1222B #B1222B #FFFFFF
#active_workspace #333333 #333333 #888888
#inactive_workspace #CECECE #333333 #f1f1f1
#focused_workspace #eb709b #eb709b #ffffff
}
#mode hide
modifier Mod4
#status_command i3status
position bottom
#status_command i3blocks
#status_command bumblebee-status
swaybar_command waybar
# -a battery-upower
#status_command conky -c /home/christoph/.conky/custom/.conkyi3
#font -*-montecarlo-*-*-*-*-*-*-*-*-*-*-*-*
font pango:Monospace 12, FontAwesome 12
tray_output *
#strip_workspace_numbers yes
}
##############
#COLORS (RED)
##############
# class border backgr. text indicator
client.focused #C7424B #B1222B #ffffff #C7424B
client.focused_inactive #333333 #5f676a #ffffff #484e50
client.unfocused #333333 #222222 #888888 #292d2e
client.urgent #2f343a #900000 #CA9700 #900000
###############################
#FLOATING NOTIFICATION WINDOWS
###############################
for_window [class="Xfce4-notifyd"] floating enable; border none; focus mode_toggle
#teams notification fix
for_window [title="Microsoft Teams Notification" class="microsoft teams - preview"] floating enable
for_window [title="Microsoft Teams Notification" class="Microsoft Teams - Preview"] floating enable
###############################
# MISC KEYBOARD SHORTCUTS
###############################
#############
# Media Keys
#############
#### G14 Keys
#XF86AudioMicMute
#XF86Launch1 - Armourycrate
#XF86Launch3 - Aura
#XF86Launch4 - Fan
#XF86RFKill - Airplane (kills wifi?
# Audio Keys
bindsym XF86AudioRaiseVolume exec /home/christoph/bin/pulsevol up
bindsym XF86AudioLowerVolume exec /home/christoph/bin/pulsevol down
bindsym XF86AudioMute exec amixer pulseaudio-ctl mute
bindsym XF86AudioStop exec playerctl stop
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
# Display Brightness
bindsym XF86KbdBrightnessDown exec light -s sysfs/leds/asus::kbd_backlight -r -U 1
bindsym XF86KbdBrightnessUp exec light -s sysfs/leds/asus::kbd_backlight -r -A 1
# Fan
bindsym XF86Launch4 exec asusctl profile -n
# Aura Button
bindsym XF86Launch3 exec asusctl led-mode -n
################
#LOCK SCREEN
################
exec swayidle -w \
timeout 300 'swaylock-fancy' \
timeout 600 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock-fancy'
bindsym Control+$mod+l exec killall -USR1 swayidle
#autolock see xautolock @autostart
######################
# EXIT/Logout Screen
######################
bindsym $mod+x exec wlogout
########
# Misc
########
# Screnshots
bindsym Print exec sway-interactive-screenshot
# direct i3wm input box
bindsym $mod+i exec i3-input
# window selector
bindsym $mod+Tab exec /home/christoph/bin/swaywinswitch
###################
#AUTOSTART/Systray
###################
# Network applet
exec nm-applet --indicator
# Bluetooth
exec blueman-applet
#exec wlsunset -l 47.8 -L 16.2
# Redshift/Screen tint
exec gammastep-indicator
# Asus Control
exec asusctltray
# Notifications
exec --no-startup-id dunst
###############
# Window Rules
###############
for_window [class=".*"] border pixel 1
gaps inner 10
gaps outer 5
gaps bottom 0
smart_gaps on
# Fix cursor size
seat seat0 xcursor_theme default 32
########################
# Monitor/Output Setup
########################
output eDP-1 adaptive_sync on scale 1 position 0 0 subpixel none
output HDMI-A-1 scale 1 position 2560 0 scale 1 subpixel none
focus_follows_mouse yes
############
# Keyboard
############
input * {
#xkb_layout "de"
# Use custom layout which remaps capslock as special modifier
xkb_layout "caps_remap"
}
input <identifier> xkb_model "pc101"
#################
# Touchpad Setup
#################
input type:touchpad {
tap enabled
natural_scroll disabled
accel_profile adaptive
pointer_accel 0.5
}
# Wallpaper
output "*" bg /home/christoph/media/images/wallpapers/Ghosts-nine-inch-nails-23374265-1920-1440.jpg fill
# Fix GTK3
exec_always /home/christoph/scripts/import-gsettings
# Dunst shortcut in sway to hide notifications
bindsym ctrl+space exec dunstctl close
# Opacity Rules
set $opacity 0.9
for_window [class=".*"] opacity $opacity
for_window [class="firefox"] opacity 1.0
for_window [class="Microsoft Teams - Preview"] opacity 1.0
for_window [class="smplayer"] opacity 1.0
for_window [class="Chromium"] opacity 1.0
for_window [class="Google-chrome"] opacity 1.0
for_window [class="Unity"] opacity 1.0
for_window [class="com-eteks-sweethome3d-SweetHome3D"] opacity 1.0
##############
# Misc stuff
##############
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
exec xrdb ~/.Xresources
# Start sway output manager
exec_always pkill kanshi; exec kanshi
# Touchpad mult-touch gestures
exec_always pkill fusuma; exec fusuma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment