tileos-settings-sway/etc/sway/variables

118 lines
4.1 KiB
Text

### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term foot
set $term_cwd $term -D "$(/usr/share/sway/scripts/swaycwd.sh 2>/dev/null || echo $HOME)"
set $term_server foot --server
set $term_float footclient -a floating_shell
# Your preferred application launcher
set $menu wofi --show drun --allow-images --hide-scroll --no-actions
# Add --to-code to bindsym, support for non-latin layouts
set $bindsym bindsym --to-code
# Bluetooth menu
set $bluetooth $term_float bluetuith
# Volume notification
set $volume_bar /usr/share/sway/scripts/volume-notify.sh
# Brightness notification
set $brightness_bar /usr/share/sway/scripts/brightness-notify.sh
# 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) && $brightness_bar
set $brightness_down light -r -U $($brightness_step) && $brightness_bar
# Volume control
set $volume_down pulsemixer --change-volume -5 && $volume_bar
set $volume_up pulsemixer --change-volume +5 && $volume_bar
set $volume_mute pulsemixer --toggle-mute && $volume_bar
# clipboard history
set $clipboard cliphist list | wofi --dmenu -p "Select item to copy:" --lines 10 | cliphist decode | wl-copy
set $clipboard-del cliphist list | wofi --dmenu -p "Select item to delete:" --lines 10 | cliphist delete
# Pulseaudo command
set $pulseaudio $term_float pulsemixer
# calendar application
set $calendar $term_float calcurse
# 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
# screenshot
set $grimshot /usr/bin/grimshot
set $pipe_output $grimshot save output -
set $pipe_selection $grimshot save window -
set $pipe_active $grimshot save active -
set $notify_paste bash -c '[[ $(wl-paste -l) == "image/png" ]] && notify-send "Screenshot copied to clipboard"'
set $swappy swappy -f -
set $screenshot_screen $pipe_output | $swappy && $notify_paste
set $screenshot_selection $pipe_selection | $swappy && $notify_paste
set $screenshot_active $pipe_active | $swappy && $notify_paste
# PolicyKit agent
set $polkit_agent /usr/bin/mate-polkit &
# Night Light
set $wlsunset '[ -x "$(command -v wlsunset)" ] && /usr/share/sway/scripts/sunset.sh "on"'
# Autotiling script
set $autotiling '[ -x "$(command -v autotiling)" ] && autotiling -w 1 3 5 7 9'
# Automatic workspace names
set $autoname_workspaces '[ -f /usr/share/sway/scripts/autoname-workspaces.py ] && /usr/share/sway/scripts/autoname-workspaces.py'
# restart kanshi https://github.com/emersion/kanshi/issues/43#issuecomment-531679213
set $kanshi '[ -x "$(command -v kanshi)" ] && pkill kanshi; exec kanshi'
# Workaround for applying GTK theme
set $import_gsettings '[ -f /usr/share/sway/scripts/import-gsettings.sh ] && /usr/share/sway/scripts/import-gsettings.sh'
# Start PCmanFM as a daemon
set $pcmanfm_daemon '[ -x "$(command -v pcmanfm)" ] && pcmanfm -d'
# Power notifications daemon
set $poweralertd '[ -x "$(command -v poweralertd)" ] && pkill poweralertd; poweralertd -s -i "line power" &'
# Clipboard manager
set $cliphist_store '[ -x "$(command -v wl-paste)" ] && [ -x "$(command -v cliphist)" ] && wl-paste --watch cliphist store'
set $cliphist_watch '[ -x "$(command -v wl-paste)" ] && [ -x "$(command -v cliphist)" ] && wl-paste --watch pkill -RTMIN+9 waybar'
# Start nwg-drawer as a daemon
set $nwg_drawer_daemon '[ -x "$(command -v nwg-drawer)" ] && nwg-drawer -r'
# SPICE agent
set $spice_vdagent '[ -x "$(command -v spice-vdagent)" ] && spice-vdagent'
# Start playerctl as daemon
set $watch_playerctl '[ -x "$(command -v playerctl)" ] && pkill playerctl; playerctl -a metadata --format \'{{status}} {{title}}\' --follow | while read line; do pkill -RTMIN+5 waybar; done'
# Start Calcurse calendar as a daemon
set $calendar_daemon 'calcurse --daemon'
# Notifications from Swappy
set $swappy_notify '[ -x "$(command -v swappy)" ] && /usr/share/sway/scripts/screenshot-notify.sh'