.config/sway/definitions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
### Variables
#
# Logo key. Use Mod1 for Alt and Mod4 for Super.
set $mod Mod4
# Direction keys
set $left Left
set $down Down
set $up Up
set $right Right
# Add --to-code to bindsym, support for non-latin layouts
set $bindsym bindsym --to-code
# For user's convenience, the same for unbindsym
set $unbindsym unbindsym --to-code
# background
#set $background /usr/share/backgrounds/manjaro-sway/gruvbox-dark-manjarosway-3840x2160.png
#set $background $HOME/Library/Images/Wallpapers/archer/archer-employee-desks.jpg
#set $background $HOME/Library/Images/Wallpapers/nature/Anolis_carolinensis_aggression.jpg
#set $background $HOME/Library/Images/Wallpapers/nature/Anolis_allisoni.jpg
set $background $HOME/Library/Images/Wallpapers/half-life/half-life-alyx-russels-lab-1440p.jpg
# Your preferred terminal emulator
set $term kitty
set $term_cwd $term
#set $term /usr/share/sway/scripts/foot.sh
#set $term_cwd $term -D "$(swaycwd 2>/dev/null || echo $HOME)"
#set $term_float footclient -a floating_shell
#set $term_float_portrait footclient -a floating_shell_portrait
# onscreen bar
set $onscreen_bar bash /usr/share/sway/scripts/wob.sh "$accent-colorFF" "$background-colorFF"
# brightness control
#set $brightness_step bash -c 'echo $(( $(light -Mr) / 100 * 5 < 1 ? 1 : $(( $(light -Mr) / 100 * 5 )) ))'
#set $brightness_up light -r -A $($brightness_step) && $onscreen_bar $(light -G | cut -d'.' -f1)
#set $brightness_down light -r -U $($brightness_step) && $onscreen_bar $(light -G | cut -d'.' -f1)
set $brightness_up xbacklight -inc 5
set $brightness_down xbacklight -dec 5
# audio control
set $sink_volume pactl get-sink-volume @DEFAULT_SINK@ | grep '^Volume:' | cut -d / -f 2 | tr -d ' ' | sed 's/%//'
set $source_volume pactl get-source-volume @DEFAULT_SOURCE@ | grep '^Volume:' | cut -d / -f 2 | tr -d ' ' | sed 's/%//'
set $volume_down $onscreen_bar $(pactl set-sink-volume @DEFAULT_SINK@ -5% && $sink_volume)
set $volume_up $onscreen_bar $(pactl set-sink-volume @DEFAULT_SINK@ +5% && $sink_volume)
set $volume_mute $onscreen_bar $(pactl set-sink-mute @DEFAULT_SINK@ toggle && pactl get-sink-mute @DEFAULT_SINK@ | sed -En "/no/ s/.*/$($sink_volume)/p; /yes/ s/.*/0/p")
set $mic_mute $onscreen_bar $(pactl set-source-mute @DEFAULT_SOURCE@ toggle && pactl get-source-mute @DEFAULT_SOURCE@ | sed -En "/no/ s/.*/$($source_volume)/p; /yes/ s/.*/0/p")
# rofi theme
set $rofi_theme "* {lightbg: $background-color; background: $background-color; lightfg: $accent-color; foreground: $text-color;}"
# clipboard history
set $clipboard cliphist list | rofi -dmenu -font "$gui-font" -p "Select item to copy" -lines 10 -width 35 -theme-str $rofi_theme | cliphist decode | wl-copy
set $clipboard-del cliphist list | rofi -dmenu -font "$gui-font" -p "Select item to delete" -lines 10 -width 35 -theme-str $rofi_theme | cliphist delete
# zeit tracking
set $zeit_list zeit list --only-projects-and-tasks --append-project-id-to-task | \
rofi -dmenu -font "$gui-font" -p "Select task to track" -lines 10 -width 35 -theme-str $rofi_theme | \
/usr/share/sway/scripts/zeit.sh track && \
pkill -RTMIN+10 waybar
# Your preferred application launcher
set $menu rofi -show combi -combi-modi "drun,run" -terminal $term -ssh-command "{terminal} {ssh-client} {host} [-p {port}]" -run-shell-command "{terminal} {cmd}" -show-icons -font "$gui-font" -lines 10 -width 35 -theme-str $rofi_theme
### Lockscreen configuration
set $locking swaylock --daemonize --color "$selection-color" --inside-color "$selection-color" --inside-clear-color "$text-color" --ring-color "$color2" --ring-clear-color "$color11" --ring-ver-color "$color13" --show-failed-attempts --fade-in 0.2 --grace 2 --effect-vignette 0.5:0.5 --effect-blur 7x5 --ignore-empty-password --screenshots --clock
###Notification daemon configuration
set $notifications mako --font "$term-font" --text-color "$text-color" --border-color "$accent-color" --background-color "$background-color" --border-size 3 --width 400 --height 200 --padding 20 --margin 20 --default-timeout 15000
### Idle configuration
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
#
#set $idle_timeout 240 #
set $idle_timeout 90
#set $locking_timeout 300
set $locking_timeout 120
#set $screen_timeout 600
set $screen_timeout 180
set $idle swayidle -w \
timeout $idle_timeout 'light -G > /tmp/brightness && light -S 10' resume 'light -S $([ -f /tmp/brightness ] && cat /tmp/brightness || echo 100%)' \
timeout $locking_timeout 'exec $locking' \
timeout $screen_timeout 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
before-sleep 'playerctl pause' \
before-sleep 'exec $locking'
# statusbar command
set $statusbar waybar
set $waybar_position top
# pulseaudio command
set $pulseaudio $term_float pulsemixer
# help command
#set $help /usr/share/sway/scripts/help.sh --toggle
# calendar application
set $calendar $term_float khal interactive
# workspace names
set $ws1 number 1
set $ws2 number 2
set $ws3 number 3
set $ws4 number 4
set $ws5 number 5
set $ws6 number 6
set $ws7 number 7
set $ws8 number 8
set $ws9 number 9
set $ws10 number 10
set $ws11 number 11
set $ws12 number 12
# screenshot
set $grimshot /usr/share/sway/scripts/grimshot
set $image_upload /usr/share/sway/scripts/upload-image.sh
set $screenshot_screen_clipboard $grimshot --notify copy output
set $screenshot_screen_file $grimshot --notify save output
set $screenshot_screen_upload $screenshot_screen_file | xargs $image_upload
set $screenshot_selection_clipboard $grimshot --notify copy window
set $screenshot_selection_file $grimshot --notify save window
set $screenshot_selection_upload $screenshot_selection_file | xargs $image_upload
|