tileos-settings-sway/etc/sway/variables
Alexander Oakman d36e203e98 Fix the screensaver running hotkey
The screensaver running hotkey didn't work because the appropriate
command was not defined.
2024-08-23 21:59:49 +03:00

132 lines
4.8 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
# flock wrapper for running only one process
set $flock /usr/share/sway/scripts/flock.sh
# Your preferred terminal emulator
set $term alacritty
set $term_cwd $term --working-directory "$(/usr/share/sway/scripts/swaycwd.sh 2>/dev/null || echo $HOME)"
set $term_float $term --class floating_shell -e
# Rofi theme
set $rofi_theme "* {lightbg: $base; background: $base; lightfg: $blue; foreground: $text; border-color: $blue;} window {border: 2;}"
# Your preferred application launcher
set $menu rofi -show combi -modes combi -combi-modes "drun,run" -terminal "$term" -show-icons -font "$gui-font"
# Add --to-code to bindsym, support for non-latin layouts
set $bindsym bindsym --to-code
# Bluetooth menu
set $bluetooth $flock $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 | rofi -dmenu -font "$gui-font" -p "Select item to copy:" -lines 10 -width 35 | cliphist decode | wl-copy
set $clipboard-del cliphist list | rofi -dmenu -font "$gui-font" -p "Select item to delete:" -lines 10 -width 35 | cliphist delete
# Pulseaudo command
set $pulseaudio $term_float pulsemixer
# Calendar application
set $calendar $term_float calcurse
# Help overlay
set $help_menu '[ -x "$(command -v nwg-wrapper)" ] && [ -f $HOME/.config/nwg-wrapper/help.sh ] && /usr/share/sway/scripts/help.sh'
# Help overlay command
set $help /usr/share/sway/scripts/help.sh --toggle
# 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'
# switch between top-level containers (windows) in a workspace
set $switch_toplevel '[ -f /usr/share/sway/scripts/switch-top-level.py ] && /usr/share/sway/scripts/switch-top-level.py'
# restart kanshi https://github.com/emersion/kanshi/issues/43#issuecomment-531679213
set $kanshi '[ -x "$(command -v kanshi)" ] && pkill kanshi; exec kanshi'
# Start PCmanFM-Qt as a daemon
set $pcmanfm_daemon '[ -x "$(command -v pcmanfm-qt)" ] && pcmanfm-qt -d'
# 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 -term "$term"'
# 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'
# Update Rofi theme based on $rofi_theme colors
set $update_rofi_theme mkdir -p $HOME/.config/rofi/ && echo $rofi_theme > $HOME/.config/rofi/config.rasi
# 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'
# Start a screensaver
set $lock '/usr/share/sway/scripts/lock.sh'
# Toggle shortcuts inhibition mode for the current focused window
set $toggle_shorcuts_inhibitor 'swaymsg "seat - shortcuts_inhibitor toggle"'