├── .gitignore ├── docs ├── images │ ├── black.png │ └── screenshot.jpg └── keybindings.md ├── config.d ├── system │ ├── 96-waybar-config.conf │ ├── 50-systemd-user.conf │ ├── 90-enable-theme.conf │ ├── 99-autostart-applications.conf │ └── 98-application-defaults.conf ├── inputs │ ├── touchpad.conf │ └── keyboard.conf ├── outputs │ └── display.conf ├── modes │ ├── scratchpad.conf │ ├── recording.conf │ ├── screenshot.conf │ ├── shutdown.conf │ ├── resize.conf │ └── default.conf ├── user.conf ├── theme.conf └── definitions.conf ├── scripts ├── once.sh ├── mako.sh ├── foot.sh ├── keyboard.sh ├── help.sh ├── waybar.sh ├── focus_or_launch.sh ├── scale.sh ├── brightness.sh ├── wob.sh ├── recorder.sh ├── inactive-windows-transparency.py ├── first-empty-workspace.py ├── autoname-workspaces.py └── grimshot.sh ├── mako.ini ├── waybar ├── modules │ ├── ping.sh │ ├── scratchpad.sh │ ├── wluma.sh │ ├── uptime.sh │ ├── gpu.sh │ ├── zeit.sh │ ├── sunset.sh │ └── weather.sh ├── style.css └── config.jsonc ├── config ├── foot └── foot.ini ├── README.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | # Excluded files 2 | -------------------------------------------------------------------------------- /docs/images/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2KAbhishek/sway2k/HEAD/docs/images/black.png -------------------------------------------------------------------------------- /docs/images/screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2KAbhishek/sway2k/HEAD/docs/images/screenshot.jpg -------------------------------------------------------------------------------- /config.d/system/96-waybar-config.conf: -------------------------------------------------------------------------------- 1 | bar { 2 | id default 3 | swaybar_command /home/abhishek/.config/sway/scripts/waybar.sh 4 | position $waybar_position 5 | } 6 | -------------------------------------------------------------------------------- /scripts/once.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | HASH="$(echo "$@" | shasum | cut -f1 -d" " | cut -c1-7)" 3 | 4 | mkdir -p "$HOME/.local/state" 5 | 6 | flock --verbose -n "$HOME/.local/state/${HASH}.lock" "$@" 7 | -------------------------------------------------------------------------------- /mako.ini: -------------------------------------------------------------------------------- 1 | width=300 2 | height=200 3 | padding=10 4 | margin=10 5 | default-timeout=5000 6 | font=Roboto 10 7 | text-color=#cccccc 8 | background-color=#000000 9 | border-color=#1688f0 10 | border-radius=6 11 | border-size=2 12 | 13 | [mode=do-not-disturb] 14 | invisible=1 15 | 16 | -------------------------------------------------------------------------------- /scripts/mako.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # wrapper script for mako 3 | 4 | USER_CONFIG_PATH="${HOME}/.config/sway/mako.ini" 5 | 6 | if [ -f "$USER_CONFIG_PATH" ]; then 7 | USER_CONFIG=$USER_CONFIG_PATH 8 | fi 9 | 10 | mako -c "${USER_CONFIG:-"/usr/share/sway/templates/mako"}" "$@" 11 | -------------------------------------------------------------------------------- /scripts/foot.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # wrapper script for foot 3 | 4 | USER_CONFIG_PATH="${HOME}/.config/sway/foot/foot.ini" 5 | 6 | if [ -f "$USER_CONFIG_PATH" ]; then 7 | USER_CONFIG=$USER_CONFIG_PATH 8 | fi 9 | 10 | foot -c "${USER_CONFIG:-"/usr/share/sway/templates/foot.ini"}" "$@" & 11 | -------------------------------------------------------------------------------- /config.d/inputs/touchpad.conf: -------------------------------------------------------------------------------- 1 | ### Input configuration 2 | # 3 | # You can get the names of your inputs by running: swaymsg -t get_inputs 4 | # Read `man 5 sway-input` for more information about this section. 5 | input type:touchpad { 6 | dwt enabled 7 | tap enabled 8 | natural_scroll enabled 9 | } 10 | 11 | -------------------------------------------------------------------------------- /config.d/inputs/keyboard.conf: -------------------------------------------------------------------------------- 1 | ### Input configuration 2 | # 3 | # You can get the names of your inputs by running: swaymsg -t get_inputs 4 | # Read `man 5 sway-input` for more information about this section. 5 | input type:keyboard { 6 | xkb_layout "us" 7 | xkb_options caps:escape 8 | repeat_delay 250 9 | repeat_rate 70 10 | } 11 | 12 | # xkb_options caps:swapescape 13 | -------------------------------------------------------------------------------- /scripts/keyboard.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # script that sets the locale from current locale settings 3 | swaymsg input type:keyboard xkb_layout "$(localectl status | grep "X11 Layout" | sed -e "s/^.*X11 Layout://")" 4 | 5 | if localectl status | grep "X11 Variant" ; then 6 | swaymsg input type:keyboard xkb_variant "$(localectl status | grep "X11 Variant" | sed -e "s/^.*X11 Variant://")" 7 | fi 8 | -------------------------------------------------------------------------------- /config.d/outputs/display.conf: -------------------------------------------------------------------------------- 1 | ### Output configuration 2 | 3 | # You can get the names of your outputs by running: swaymsg -t get_outputs 4 | # Manually Enable/Diable outputs: swaymsg output eDP-1 disable 5 | # see man 5 sway-output for more 6 | 7 | # Default wallpaper 8 | output * bg $background fill 9 | 10 | # Main screens 11 | output DP-3 resolution 2560x1440 position 0,0 12 | output eDP-1 resolution 1920x1080 position 2560,0 scale 1.2 13 | 14 | -------------------------------------------------------------------------------- /config.d/system/50-systemd-user.conf: -------------------------------------------------------------------------------- 1 | # sway does not set DISPLAY/WAYLAND_DISPLAY in the systemd user environment 2 | # See FS#63021 3 | # Adapted from xorg's 50-systemd-user.sh, which achieves a similar goal. 4 | 5 | exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP 6 | exec hash dbus-update-activation-environment 2>/dev/null && \ 7 | dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP 8 | -------------------------------------------------------------------------------- /scripts/help.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -x 3 | # toggles the help wrapper state 4 | 5 | VISIBILITY_SIGNAL=30 6 | QUIT_SIGNAL=31 7 | 8 | if [ "$1" = "--toggle" ]; then 9 | pkill -f -${VISIBILITY_SIGNAL} nwg-wrapper 10 | else 11 | pkill -f -${QUIT_SIGNAL} nwg-wrapper 12 | for output in $(swaymsg -t get_outputs --raw | jq -r '.[].name'); do 13 | nwg-wrapper -o "$output" -sv ${VISIBILITY_SIGNAL} -sq ${QUIT_SIGNAL} -s help.sh -p left -a end & 14 | done 15 | fi 16 | -------------------------------------------------------------------------------- /config.d/modes/scratchpad.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Scratchpad: 3 | # 4 | # Sway has a "scratchpad", which is a bag of holding for windows. 5 | # You can send windows there and get them back later. 6 | 7 | ## Action // Move window to scratchpad ## 8 | $bindsym $mod+Shift+minus move scratchpad, exec "pkill -RTMIN+7 waybar" 9 | 10 | # If there are multiple scratchpad windows, this command cycles through them. 11 | ## Action // Toggle scratchpad ## 12 | $bindsym $mod+minus scratchpad show, exec "pkill -RTMIN+7 waybar" 13 | -------------------------------------------------------------------------------- /config.d/user.conf: -------------------------------------------------------------------------------- 1 | # definitions overrides for sway 2 | 3 | # refer to /etc/sway/definitions for global definitions that can be overridden here 4 | # 5 | # e.g.: 6 | # 7 | # * change modifier key from Win/Pine-Key to Alt: `set $mod Mod1` 8 | # * change the background image: `set $background $HOME/Pictures/wallpaper.png` 9 | # * make a foot client instance the default terminal for even faster terminal windows: `set $term footclient` 10 | # * follow windows after moving them: `set $focus_after_move true` 11 | -------------------------------------------------------------------------------- /waybar/modules/ping.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export LC_ALL=en_US.UTF-8 4 | 5 | pingserver=${WAYBAR_PING_SERVER:-"google.com"} 6 | 7 | ping_function() { 8 | case $(uname -s) in 9 | Linux | Darwin) 10 | pingtime=$(ping -c 1 "$pingserver" | tail -1 | awk '{split($4, times, "/"); printf "%.2f", times[2]}') 11 | echo "$pingtime ms" 12 | ;; 13 | 14 | CYGWIN* | MINGW32* | MSYS* | MINGW*) ;; 15 | esac 16 | } 17 | 18 | main() { 19 | echo "󱘖 $(ping_function)" 20 | } 21 | 22 | main 23 | -------------------------------------------------------------------------------- /config.d/modes/recording.conf: -------------------------------------------------------------------------------- 1 | set $mode_recording " r | 󰍮 + shift" 2 | 3 | set $recorder $HOME/.config/sway/scripts/recorder.sh 4 | 5 | mode $mode_recording { 6 | $bindsym r exec $recorder, mode "default" 7 | $bindsym Shift+r exec $recorder -a, mode "default" 8 | 9 | # Return to default mode. 10 | $bindsym Escape mode "default" 11 | } 12 | 13 | ## Launch // Recording Mode ## 14 | $bindsym $mod+Shift+r mode $mode_recording 15 | 16 | ## Launch // Stop Recording Mode ## 17 | $bindsym $mod+Escape exec killall -s SIGINT wf-recorder 18 | -------------------------------------------------------------------------------- /scripts/waybar.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # wrapper script for waybar with args, see https://github.com/swaywm/sway/issues/5724 3 | 4 | sleep 1 5 | 6 | USER_CONFIG_PATH="${HOME}/.config/sway/waybar/config.jsonc" 7 | USER_STYLE_PATH="${HOME}/.config/sway/waybar/style.css" 8 | 9 | if [ -f "$USER_CONFIG_PATH" ]; then 10 | USER_CONFIG=$USER_CONFIG_PATH 11 | fi 12 | 13 | if [ -f "$USER_STYLE_PATH" ]; then 14 | USER_STYLE=$USER_STYLE_PATH 15 | fi 16 | 17 | waybar -c "${USER_CONFIG:-"/usr/share/sway/templates/waybar/config.jsonc"}" -s "${USER_STYLE:-"/usr/share/sway/templates/waybar/style.css"}" & 18 | -------------------------------------------------------------------------------- /waybar/modules/scratchpad.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | tooltip=$(swaymsg -r -t get_tree | jq -r 'recurse(.nodes[]) | first(select(.name=="__i3_scratch")) | .floating_nodes | .[] | "\(.app_id) | \(.name)"') 3 | count=$(printf "%s" "$tooltip" | grep -c '^') 4 | 5 | if [ "$count" -eq 0 ]; then 6 | exit 1 7 | elif [ "$count" -eq 1 ]; then 8 | class="one" 9 | elif [ "$count" -gt 1 ]; then 10 | class="many" 11 | else 12 | class="unknown" 13 | fi 14 | 15 | printf '{"text":"%s", "class":"%s", "alt":"%s", "tooltip":"%s"}\n' "$count" "$class" "$class" "$(echo "${tooltip}" | sed -z 's/\n/\\n/g')" 16 | -------------------------------------------------------------------------------- /scripts/focus_or_launch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Usage: focus_or_launch.sh [app_id] 3 | # Example: focus_or_launch.sh foot 4 | # focus_or_launch.sh qutebrowser org.qutebrowser.qutebrowser 5 | 6 | CMD="$1" 7 | APP_ID="${2:-$1}" 8 | 9 | if [ -z "$CMD" ]; then 10 | echo "Usage: $0 [app_id]" 11 | exit 1 12 | fi 13 | 14 | # Find an existing window with the given app_id 15 | WIN_ID=$(swaymsg -t get_tree | jq -r '.. | select(.app_id? == "'"$APP_ID"'") | .id' | head -n1) 16 | 17 | if [ -n "$WIN_ID" ]; then 18 | swaymsg [con_id="$WIN_ID"] focus 19 | else 20 | "$CMD" & 21 | fi 22 | -------------------------------------------------------------------------------- /waybar/modules/wluma.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | status() { 4 | systemctl --user is-active wluma >/dev/null 2>&1 5 | } 6 | 7 | #Accepts managing parameter 8 | case $1'' in 9 | 'toggle') 10 | status && systemctl --user stop wluma || systemctl --user --now enable wluma 11 | ;; 12 | 'check') 13 | command -v wluma 14 | exit $? 15 | ;; 16 | esac 17 | 18 | #Returns data for Waybar 19 | if status; then 20 | class="on" 21 | text="adative brightness" 22 | else 23 | class="off" 24 | text="static brightness" 25 | fi 26 | 27 | printf '{"alt":"%s","tooltip":"%s"}\n' "$class" "$text" 28 | -------------------------------------------------------------------------------- /config.d/system/90-enable-theme.conf: -------------------------------------------------------------------------------- 1 | exec_always { 2 | gsettings set org.gnome.desktop.interface gtk-theme "$gtk-theme" 3 | gsettings set org.gnome.desktop.interface icon-theme "$icon-theme" 4 | gsettings set org.gnome.desktop.interface cursor-theme "$cursor-theme" 5 | gsettings set org.gnome.desktop.interface font-name "$gui-font" 6 | gsettings set org.gnome.desktop.interface color-scheme "$gtk-color-scheme" 7 | gsettings set org.gnome.desktop.input-sources show-all-sources true 8 | gsettings set org.gnome.desktop.interface monospace-font-name "$term-font" 9 | 10 | kvantummanager --set "$kvantum-theme" 11 | } 12 | -------------------------------------------------------------------------------- /config.d/system/99-autostart-applications.conf: -------------------------------------------------------------------------------- 1 | # autostart background applications 2 | exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 3 | 4 | # autostarts 5 | exec { 6 | $xdg-dirs 7 | $swayidle 8 | $mako 9 | $autostart_dex 10 | $flashfocus 11 | $wlsunset 12 | $autotiling 13 | $foot_server 14 | # $help_menu 15 | $cliphist_store 16 | $cliphist_watch 17 | $workspace_icons 18 | $mounting_daemon 19 | $dropbox_daemon 20 | } 21 | 22 | exec_always { 23 | $kanshi 24 | $auto_xdg_keyboard 25 | $poweralert 26 | $watch_playerctl 27 | $calendar_daemon 28 | $swayr_daemon 29 | } 30 | -------------------------------------------------------------------------------- /scripts/scale.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | current_screen=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused==true) | .name') 3 | increment=0.5 4 | 5 | current_scale() { 6 | swaymsg -t get_outputs | jq -r '.[] | select(.focused==true) | .scale' 7 | } 8 | 9 | next_scale=$(current_scale) 10 | 11 | scale() { 12 | swaymsg output "\"$current_screen\"" scale "$next_scale" 13 | } 14 | 15 | case $1'' in 16 | '') 17 | current_scale 18 | ;; 19 | 'up') 20 | next_scale=$(echo "$(current_scale) + $increment" | bc) 21 | scale 22 | ;; 23 | 'down') 24 | next_scale=$(echo "$(current_scale) - $increment" | bc) 25 | scale 26 | ;; 27 | esac 28 | 29 | -------------------------------------------------------------------------------- /waybar/modules/uptime.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | uptime_icon="󱎫" 4 | 5 | main() { 6 | uptime | awk ' 7 | { 8 | for(i=1;i<=NF;i++) { 9 | if($i=="up") { 10 | if($(i+1) ~ /^[0-9]+$/ && $(i+2) ~ /^day/) d=$(i+1) 11 | else if($(i+1) ~ /^[0-9]+:[0-9]+/) {split($(i+1),t,":"); h=t[1]; m=t[2]} 12 | } 13 | if($i ~ /^[0-9]+:[0-9]+/) {split($i,t,":"); h=t[1]; m=t[2]} 14 | } 15 | gsub(/,/,"",m) 16 | printf "%s %s%s%s\n", "'"$uptime_icon"'", \ 17 | (d?d"D ":""), \ 18 | (h?h"H ":""), \ 19 | (m?m"M":"") 20 | }' 21 | } 22 | 23 | main 24 | -------------------------------------------------------------------------------- /scripts/brightness.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | current_abs=$(light -Gr) 4 | current_rel() { 5 | echo "($(light -G) + 0.5) / 1" | bc 6 | } 7 | max=$(light -Mr) 8 | factor=3 9 | brightness_step=$((max * factor / 100 < 1 ? 1 : max * factor / 100)) 10 | 11 | case $1'' in 12 | '') ;; 13 | 'down') 14 | # if current value <= 3% and absolute value != 1, set brightness to absolute 1 15 | if [ "$(current_rel)" -le "$factor" ] && [ "$current_abs" -gt 0 ] && [ "$current_abs" -ne 1 ]; then 16 | light -rS 1 17 | else 18 | light -rU "$brightness_step" 19 | fi 20 | ;; 21 | 'up') 22 | light -rA "$brightness_step" 23 | ;; 24 | esac 25 | 26 | current_rel 27 | -------------------------------------------------------------------------------- /config.d/modes/screenshot.conf: -------------------------------------------------------------------------------- 1 | set $mode_screenshot "p  | o  | shift +  " 2 | 3 | mode $mode_screenshot { 4 | # output = currently active output 5 | $bindsym o mode "default", exec $screenshot_screen 6 | $bindsym Shift+o mode "default", exec $screenshot_screen_upload 7 | 8 | # pick the region to screenshot 9 | $bindsym p mode "default", exec $screenshot_selection 10 | $bindsym Shift+p mode "default", exec $screenshot_selection_upload 11 | 12 | # Return to default mode. 13 | $bindsym Escape mode "default" 14 | } 15 | 16 | ## Launch // Screenshot Mode ## 17 | $bindsym Print mode $mode_screenshot 18 | $bindsym $mod+Shift+s mode $mode_screenshot 19 | -------------------------------------------------------------------------------- /config: -------------------------------------------------------------------------------- 1 | # Read `man 5 sway` for a complete reference. 2 | # theme variables 3 | include $HOME/.config/sway/config.d/theme.conf 4 | 5 | # global variables 6 | include $HOME/.config/sway/config.d/definitions.conf 7 | 8 | # io configs 9 | include $HOME/.config/sway/config.d/inputs/* 10 | include $HOME/.config/sway/config.d/outputs/* 11 | 12 | # enable modes 13 | include $HOME/.config/sway/config.d/modes/* 14 | 15 | # include additional configs e.g. to autostart applications 16 | include $HOME/.config/sway/config.d/system/* 17 | 18 | # only enable this if every app you use is compatible with wayland 19 | # xwayland disable 20 | 21 | # user variables 22 | include $HOME/.config/sway/config.d/user.conf 23 | 24 | -------------------------------------------------------------------------------- /config.d/modes/shutdown.conf: -------------------------------------------------------------------------------- 1 | set $mode_shutdown "l  | u  | e 󰗼 | r  | s ⏻" 2 | 3 | set $purge_cliphist [ $purge_cliphist_logout == 'true' ] && rm -f $HOME/.cache/cliphist/db || exit 0 4 | 5 | mode $mode_shutdown { 6 | # lock 7 | $bindsym l mode "default", exec $locking 8 | 9 | # logout 10 | $bindsym e exec $purge_cliphist; exec loginctl terminate-user $USER 11 | 12 | # suspend 13 | $bindsym u mode "default", exec systemctl suspend 14 | 15 | # shutdown 16 | $bindsym s exec $purge_cliphist; exec systemctl poweroff 17 | 18 | # reboot 19 | $bindsym r exec $purge_cliphist; exec systemctl reboot 20 | 21 | # Return to default mode. 22 | $bindsym Escape mode "default" 23 | } 24 | 25 | ## Launch // Exit Menu ## 26 | $bindsym $mod+Shift+q mode $mode_shutdown 27 | -------------------------------------------------------------------------------- /waybar/modules/gpu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export LC_ALL=en_US.UTF-8 4 | 5 | get_platform() { 6 | case $(uname -s) in 7 | Linux) 8 | gpu=$(lspci -v | grep VGA | head -n 1 | awk '{print $5}') 9 | echo "$gpu" 10 | ;; 11 | Darwin) ;; # TODO - Darwin/Mac compatibility 12 | CYGWIN* | MINGW32* | MSYS* | MINGW*) ;; # TODO - windows compatibility 13 | esac 14 | } 15 | 16 | get_gpu() { 17 | gpu=$(get_platform) 18 | if [[ "$gpu" == NVIDIA ]]; then 19 | usage=$(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits | awk '{ sum += $0 } END { printf("%s%%\n", sum / NR) }') 20 | else 21 | usage='N/A' 22 | fi 23 | echo "$usage" 24 | } 25 | 26 | main() { 27 | gpu_usage=$(get_gpu) 28 | echo " $gpu_usage" 29 | } 30 | 31 | main 32 | -------------------------------------------------------------------------------- /waybar/modules/zeit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | tracking=$(zeit tracking --no-colors) 3 | 4 | case $1'' in 5 | 'status') 6 | text=$(echo "$tracking" | sed -z 's/\n/\\n/g' | grep -q 'tracking' && echo "tracking" || echo "stopped") 7 | tooltip=$tracking'\r(zeit time tracker)' 8 | echo "{\"text\":\"$text\",\"tooltip\":\"$tooltip\",\"class\":\"$text\",\"alt\":\"$text\"}" 9 | ;; 10 | 'click') 11 | if echo "$tracking" | grep -q 'tracking'; then 12 | zeit finish 13 | else 14 | swaymsg exec \$zeit_list 15 | fi 16 | ;; 17 | 'track') 18 | input=$(cat -) 19 | task=$(echo $input | pcregrep -io1 '└── (.+) \[.+') 20 | project=$(echo $input | pcregrep -io1 '.+\[(.+)\]') 21 | 22 | if [ "$task" = "" ] || [ "$project" = "" ]; then 23 | notify-send.sh "You did not select a task!" 24 | exit 1 25 | fi 26 | 27 | zeit track -p "$project" -t "$task" 28 | notify-send.sh "Tracking $task in $project" 29 | ;; 30 | esac 31 | -------------------------------------------------------------------------------- /scripts/wob.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # https://github.com/francma/wob/wiki/wob-wrapper-script 3 | #$1 - accent color. $2 - background color. $3 - new value 4 | # returns 0 (success) if $1 is running and is attached to this sway session; else 1 5 | is_running_on_this_screen() { 6 | pkill -0 "wob" || return 1 7 | for pid in $(pgrep "wob"); do 8 | WOB_SWAYSOCK="$(tr '\0' '\n' >$ini 30 | fi 31 | 32 | # wob does not appear in $(swaymsg -t get_msg), so: 33 | is_running_on_this_screen || { 34 | tail -f "$wob_pipe" | wob -c $ini & 35 | } 36 | 37 | if [ -n "$3" ]; then 38 | echo "$3" >"$wob_pipe" 39 | else 40 | cat >"$wob_pipe" 41 | fi 42 | -------------------------------------------------------------------------------- /scripts/recorder.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -x 3 | 4 | pgrep wf-recorder 5 | status=$? 6 | 7 | countdown() { 8 | notify "Recording in 3 seconds" -t 1000 9 | sleep 1 10 | notify "Recording in 2 seconds" -t 1000 11 | sleep 1 12 | notify "Recording in 1 seconds" -t 1000 13 | sleep 1 14 | } 15 | 16 | notify() { 17 | line=$1 18 | shift 19 | notify-send.sh "Recording" "${line}" -i /usr/share/icons/Papirus-Dark/32x32/devices/camera-video.svg $* 20 | } 21 | 22 | if [ $status != 0 ]; then 23 | target_path="$(xdg-user-dir VIDEOS)/Recordings" 24 | timestamp=$(date +'recording_%Y%m%d-%H%M%S') 25 | 26 | notify "Select a region to record" -t 1000 27 | area=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) 28 | 29 | countdown 30 | (sleep 0.5 && pkill -RTMIN+8 waybar) & 31 | 32 | if [ "$1" = "-a" ]; then 33 | file="$target_path/$timestamp.mp4" 34 | wf-recorder --audio -g "$area" --file="$file" 35 | else 36 | file="$target_path/$timestamp.webm" 37 | wf-recorder -g "$area" -c libvpx --codec-param="qmin=0" --codec-param="qmax=25" --codec-param="crf=4" --codec-param="b:v=1M" --file="$file" 38 | fi 39 | 40 | pkill -RTMIN+8 waybar && notify "Finished recording ${file}" 41 | else 42 | pkill --signal SIGINT wf-recorder 43 | pkill -RTMIN+8 waybar 44 | fi 45 | -------------------------------------------------------------------------------- /config.d/theme.conf: -------------------------------------------------------------------------------- 1 | # some global theme specific variables 2 | set $gtk-theme BWnB 3 | set $kvantum-theme BWnB 4 | set $icon-theme Reversal-blue-dark 5 | set $cursor-theme xcursor-breeze 6 | set $gui-font Roboto 10 7 | set $term-font FiraCode Nerd Font 10 8 | set $gtk-color-scheme prefer-dark 9 | 10 | set $color0 #000000 11 | set $color1 #282a2b 12 | set $color2 #3B758C 13 | set $color3 #41535B 14 | set $color4 #43a5d5 15 | set $color5 #d6d6d6 16 | set $color6 #eeeeee 17 | set $color7 #ffffff 18 | set $color8 #ff0043 19 | set $color9 #db7b55 20 | set $color10 #e6cd69 21 | set $color11 #9fca56 22 | set $color12 #1688f0 23 | set $color13 #55b5db 24 | set $color14 #a074c4 25 | set $color15 #8a553f 26 | 27 | #$color0 28 | set $background-color $color0 29 | #$color6 30 | set $text-color $color6 31 | #color1 32 | set $selection-color $color1 33 | #color12 34 | set $accent-color $color12 35 | 36 | # Basic color configuration using the Base16 variables for windows and borders. 37 | # Property Name Border BG Text Indicator Child Border 38 | client.focused $color12 $color12 $color0 $color6 $color12 39 | client.focused_inactive $color1 $color1 $color5 $color3 $color1 40 | client.unfocused $color1 $color0 $color5 $color6 $color1 41 | client.urgent $color8 $color8 $color0 $color9 $color8 42 | client.placeholder $color0 $color0 $color5 $color0 $color0 43 | client.background $color0 44 | -------------------------------------------------------------------------------- /config.d/modes/resize.conf: -------------------------------------------------------------------------------- 1 | set $mode_resize "↑ ↓ ← →  | +/-  " 2 | 3 | mode $mode_resize { 4 | # left will shrink the containers width 5 | # right will grow the containers width 6 | # up will shrink the containers height 7 | # down will grow the containers height 8 | $bindsym $left resize shrink width 10px 9 | $bindsym $down resize grow height 10px 10 | $bindsym $up resize shrink height 10px 11 | $bindsym $right resize grow width 10px 12 | 13 | $bindsym $left_alt resize shrink width 10px 14 | $bindsym $down_alt resize grow height 10px 15 | $bindsym $up_alt resize shrink height 10px 16 | $bindsym $right_alt resize grow width 10px 17 | 18 | $bindsym Shift+$left resize shrink width 50px 19 | $bindsym Shift+$down resize grow height 50px 20 | $bindsym Shift+$up resize shrink height 50px 21 | $bindsym Shift+$right resize grow width 50px 22 | 23 | $bindsym Shift+$left_alt resize shrink width 50px 24 | $bindsym Shift+$down_alt resize grow height 50px 25 | $bindsym Shift+$up_alt resize shrink height 50px 26 | $bindsym Shift+$right_alt resize grow width 50px 27 | 28 | ## Resize // Window Gaps // + - ## 29 | $bindsym minus gaps inner current minus 5px 30 | $bindsym plus gaps inner current plus 5px 31 | 32 | # Return to default mode 33 | $bindsym Return mode "default" 34 | $bindsym Escape mode "default" 35 | } 36 | ## Launch // Resize Mode ## 37 | $bindsym $mod+r mode $mode_resize 38 | gaps inner 5px 39 | gaps outer 5px 40 | -------------------------------------------------------------------------------- /waybar/modules/sunset.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | config="$HOME/.config/wlsunset/config" 4 | 5 | #Startup function 6 | start() { 7 | [ -f "$config" ] && . "$config" 8 | temp_low=${temp_low:-"4000"} 9 | temp_high=${temp_high:-"6500"} 10 | duration=${duration:-"900"} 11 | sunrise=${sunrise:-"07:00"} 12 | sunset=${sunset:-"19:00"} 13 | location=${location:-"on"} 14 | fallback_longitude=${fallback_longitude:-"8.7"} 15 | fallback_latitude=${fallback_latitude:-"50.1"} 16 | 17 | if [ "${location}" = "on" ]; then 18 | if [ -z ${longitude+x} ] || [ -z ${latitude+x} ]; then 19 | GEO_CONTENT=$(curl -sL http://ip-api.com/json/) 20 | fi 21 | longitude=${longitude:-$(echo "$GEO_CONTENT" | jq '.lon // empty')} 22 | longitude=${longitude:-$fallback_longitude} 23 | latitude=${latitude:-$(echo "$GEO_CONTENT" | jq '.lat // empty')} 24 | latitude=${latitude:-$fallback_latitude} 25 | 26 | echo longitude: "$longitude" latitude: "$latitude" 27 | 28 | wlsunset -l "$latitude" -L "$longitude" -t "$temp_low" -T "$temp_high" -d "$duration" & 29 | else 30 | wlsunset -t "$temp_low" -T "$temp_high" -d "$duration" -S "$sunrise" -s "$sunset" & 31 | fi 32 | } 33 | 34 | #Accepts managing parameter 35 | case $1'' in 36 | 'off') 37 | pkill wlsunset 38 | ;; 39 | 'on') 40 | start 41 | ;; 42 | 'toggle') 43 | if pkill -0 wlsunset; then 44 | pkill wlsunset 45 | else 46 | start 47 | fi 48 | ;; 49 | 'check') 50 | command -v wlsunset 51 | exit $? 52 | ;; 53 | esac 54 | 55 | #Returns a string for Waybar 56 | if pkill -0 wlsunset; then 57 | class="on" 58 | text="location-based gamma correction" 59 | else 60 | class="off" 61 | text="no gamma correction" 62 | fi 63 | 64 | printf '{"alt":"%s","tooltip":"%s"}\n' "$class" "$text" 65 | -------------------------------------------------------------------------------- /waybar/modules/weather.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export LC_ALL=en_US.UTF-8 4 | 5 | weather_scale=${WAYBAR_WEATHER_SCALE:-c} 6 | fixed_location=${WAYBAR_WEATHER_LOCATION:-""} 7 | display_location=${WAYBAR_SHOW_WEATHER_LOCATION:-false} 8 | 9 | declare -A weather_icons=( 10 | ["Clear"]="" 11 | ["Cloud"]="" 12 | ["Drizzle"]="󰖗" 13 | ["Fog"]="" 14 | ["Haze"]="󰼰" 15 | ["Mist"]="" 16 | ["Overcast"]="" 17 | ["Rain"]="" 18 | ["Sand"]="" 19 | ["Shower"]="" 20 | ["Smoke"]="" 21 | ["Snow"]="" 22 | ["Sunny"]="" 23 | ["Thunderstorm"]="" 24 | ["Tornado"]="󰼸" 25 | ["Windy"]="󰖝" 26 | ) 27 | 28 | fetch_weather_location() { 29 | if [[ -n "$fixed_location" ]]; then 30 | echo "$fixed_location" 31 | else 32 | city=$(curl -s https://ipinfo.io/city?token= 2>/dev/null) # alternative: ifconfig.co 33 | echo "$city" 34 | fi 35 | } 36 | 37 | fetch_weather_information() { 38 | case $weather_scale in 39 | f) scale='&u' ;; 40 | k) scale='&M' ;; 41 | *) scale='&m' ;; 42 | esac 43 | curl -sL "wttr.in/$1?format=%C+%t$scale" 44 | } 45 | 46 | forecast_unicode() { 47 | local condition=$1 48 | weather_icon="${weather_icons[$condition]}" 49 | if [[ -n $weather_icon ]]; then 50 | echo "$weather_icon " 51 | else 52 | echo ' ' 53 | fi 54 | } 55 | 56 | main() { 57 | location=$(fetch_weather_location) 58 | weather_information=$(fetch_weather_information "$location") 59 | 60 | condition=$(echo "$weather_information" | rev | cut -d ' ' -f2- | tr -d '[:space:]' | rev) 61 | temperature=$(echo "$weather_information" | rev | cut -d ' ' -f 1 | rev) 62 | unicode=$(forecast_unicode "$condition") 63 | 64 | if [[ $display_location == "true" ]]; then 65 | echo "$unicode${temperature/+/} $condition $location" 66 | else 67 | echo "$unicode${temperature/+/} $condition" 68 | fi 69 | } 70 | 71 | main 72 | -------------------------------------------------------------------------------- /scripts/inactive-windows-transparency.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # This script requires i3ipc-python package (system or pip) 4 | # It makes inactive windows transparent. Use `transparency_val` to control 5 | # transparency strength in range of 0…1 or use the command line argument -o. 6 | 7 | import argparse 8 | import i3ipc 9 | import signal 10 | import sys 11 | from functools import partial 12 | 13 | 14 | def on_window_focus(inactive_opacity, ipc, event): 15 | global prev_focused 16 | global prev_workspace 17 | 18 | focused_workspace = ipc.get_tree().find_focused() 19 | 20 | if focused_workspace is None: 21 | return 22 | 23 | focused = event.container 24 | workspace = focused_workspace.workspace().num 25 | 26 | # https://github.com/swaywm/sway/issues/2859 27 | if focused.id != prev_focused.id: 28 | focused.command("opacity 1") 29 | if workspace == prev_workspace: 30 | prev_focused.command("opacity " + inactive_opacity) 31 | prev_focused = focused 32 | prev_workspace = workspace 33 | 34 | 35 | def remove_opacity(ipc): 36 | for workspace in ipc.get_tree().workspaces(): 37 | for w in workspace: 38 | w.command("opacity 1") 39 | ipc.main_quit() 40 | sys.exit(0) 41 | 42 | 43 | if __name__ == "__main__": 44 | transparency_val = "0.80" 45 | 46 | parser = argparse.ArgumentParser( 47 | description="This script allows you to set the transparency of unfocused windows in sway." 48 | ) 49 | parser.add_argument( 50 | "--opacity", 51 | "-o", 52 | type=str, 53 | default=transparency_val, 54 | help="set opacity value in range 0...1", 55 | ) 56 | args = parser.parse_args() 57 | 58 | ipc = i3ipc.Connection() 59 | prev_focused = None 60 | prev_workspace = ipc.get_tree().find_focused().workspace().num 61 | 62 | for window in ipc.get_tree(): 63 | if window.focused: 64 | prev_focused = window 65 | else: 66 | window.command("opacity " + args.opacity) 67 | for sig in [signal.SIGINT, signal.SIGTERM]: 68 | signal.signal(sig, lambda signal, frame: remove_opacity(ipc)) 69 | ipc.on("window::focus", partial(on_window_focus, args.opacity)) 70 | ipc.main() 71 | -------------------------------------------------------------------------------- /config.d/system/98-application-defaults.conf: -------------------------------------------------------------------------------- 1 | # don't show gaps if there's only one window on the desktop 2 | smart_gaps on 3 | 4 | # set floating mode for generated windows 5 | for_window [title="(?:Open|Save) (?:File|Folder|As)"] floating enable; 6 | for_window [title="(?:Open|Save) (?:File|Folder|As)"] resize set 800 600 7 | for_window [window_role="pop-up"] floating enable 8 | for_window [window_role="bubble"] floating enable 9 | for_window [window_role="task_dialog"] floating enable 10 | for_window [window_role="Preferences"] floating enable 11 | for_window [window_type="dialog"] floating enable 12 | for_window [window_type="menu"] floating enable 13 | 14 | # set floating mode for specific applications 15 | for_window [instance="lxappearance"] floating enable 16 | for_window [app_id="pamac-manager"] floating enable 17 | for_window [app_id="blueberry.py"] floating enable 18 | for_window [app_id="dragon-drop"] floating enable, sticky enable 19 | for_window [app_id="firefox" title="^Library$"] floating enable, border pixel 1, sticky enable 20 | for_window [app_id="thunderbird" title=".*Reminder"] floating enable 21 | for_window [app_id="floating_shell"] floating enable, border pixel 1, sticky enable 22 | for_window [app_id="Manjaro.manjaro-settings-manager"] floating enable 23 | for_window [app_id="" title="Picture in picture"] floating enable, sticky enable 24 | for_window [app_id="" title="Picture-in-Picture"] floating enable, sticky enable 25 | for_window [instance="around"] floating enable, sticky enable 26 | for_window [app_id="xsensors"] floating enable 27 | for_window [title="Save File"] floating enable 28 | for_window [title="Firefox .*— Sharing Indicator"] floating enable, sticky enable, move to scratchpad 29 | for_window [app_id="" title=".* is sharing your screen."] floating enable 30 | for_window [title="^wlay$"] floating enable 31 | 32 | # inhibit idle 33 | for_window [app_id="microsoft teams - preview"] inhibit_idle fullscreen 34 | for_window [app_id="google-chrome"] inhibit_idle fullscreen 35 | for_window [app_id="google-chrome-beta"] inhibit_idle fullscreen 36 | for_window [app_id="google-chrome-unstable"] inhibit_idle fullscreen 37 | 38 | # Don't allow applications to inhibit shortcuts, i.e. grab total control of the 39 | # keyboard. Chrome currently abuses this by enabling it for all "--app=..." 40 | # shortcuts. 41 | seat * shortcuts_inhibitor disable 42 | -------------------------------------------------------------------------------- /scripts/first-empty-workspace.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import i3ipc 4 | from argparse import ArgumentParser 5 | 6 | # Assumption: it exists 10 workspaces (otherwise, change this value) 7 | NUM_WORKSPACES = 10 8 | 9 | if __name__ == "__main__": 10 | arguments_parser = ArgumentParser() 11 | arguments_parser.add_argument( 12 | "-s", 13 | "--switch", 14 | action="store_true", 15 | help="switch to the first empty workspace", 16 | ) 17 | arguments_parser.add_argument( 18 | "-m", 19 | "--move", 20 | action="store_true", 21 | help="move the currently focused container to the first empty workspace", 22 | ) 23 | arguments = arguments_parser.parse_args() 24 | # at least one of the flags must be specified 25 | assert arguments.switch or arguments.move 26 | 27 | ipc = i3ipc.Connection() 28 | tree = ipc.get_tree() 29 | current_workspace = tree.find_focused().workspace() 30 | workspaces = tree.workspaces() # includes current_workspace 31 | 32 | workspace_numbers = [workspace.num for workspace in workspaces] 33 | empty_workspace_numbers = set( 34 | [number for number in range(1, NUM_WORKSPACES + 1)] 35 | ) - set(workspace_numbers) 36 | # Take into consideration that the current workspace exists but might be empty 37 | if len(current_workspace.nodes) == 0: 38 | empty_workspace_numbers.add(current_workspace.num) 39 | 40 | # Get the minor empty workspace's number (or set it as the current workspace's number if all are busy) 41 | first_empty_workspace_number = current_workspace.num 42 | if empty_workspace_numbers: 43 | first_empty_workspace_number = min(empty_workspace_numbers) 44 | 45 | # Use the value of first_empty_workspace_number to make the requested actions 46 | if arguments.move and arguments.switch: 47 | # Avoid wallpaper flickering when moving and switching by specifying both actions in the same Sway's command 48 | reply = ipc.command( 49 | "move container to workspace number {}, workspace number {}".format( 50 | first_empty_workspace_number, first_empty_workspace_number 51 | ) 52 | ) 53 | # exit with non-zero status if the assertion fails 54 | assert reply[0].success 55 | elif arguments.switch: 56 | reply = ipc.command("workspace number {}".format(first_empty_workspace_number)) 57 | # exit with non-zero status if the assertion fails 58 | assert reply[0].success 59 | elif arguments.move: 60 | reply = ipc.command( 61 | "move container to workspace number {}".format(first_empty_workspace_number) 62 | ) 63 | # exit with non-zero status if the assertion fails 64 | assert reply[0].success 65 | -------------------------------------------------------------------------------- /waybar/style.css: -------------------------------------------------------------------------------- 1 | /* Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration */ 2 | 3 | @keyframes blink-warning { 4 | 70% { 5 | color: @wm_icon_bg; 6 | } 7 | 8 | to { 9 | color: @wm_icon_bg; 10 | background-color: @warning_color; 11 | } 12 | } 13 | 14 | @keyframes blink-critical { 15 | 70% { 16 | color: @wm_icon_bg; 17 | } 18 | 19 | to { 20 | color: @wm_icon_bg; 21 | background-color: @error_color; 22 | } 23 | } 24 | 25 | /* Use theme variables with @theme_bg_color, @theme_selected_bg_color 26 | background: @theme_bg_color; */ 27 | 28 | /* Reset all styles */ 29 | * { 30 | border: none; 31 | border-radius: 6px; 32 | min-height: 0; 33 | margin: 0; 34 | padding: 0; 35 | font-family: 'FiraCode Nerd Font', 'Roboto Mono', sans-serif; 36 | font-size: 11px; 37 | } 38 | 39 | window#waybar { 40 | background: alpha(#000, 0.75); 41 | color: @wm_icon_bg; 42 | } 43 | 44 | /* Modules */ 45 | 46 | #custom-pacman, 47 | #custom-menu, 48 | #custom-help, 49 | #custom-scratchpad, 50 | #custom-github, 51 | #custom-clipboard, 52 | #custom-zeit, 53 | #custom-dnd, 54 | #bluetooth, 55 | #battery, 56 | #clock, 57 | #cpu, 58 | #memory, 59 | #mode, 60 | #network, 61 | #pulseaudio, 62 | #temperature, 63 | #idle_inhibitor, 64 | #backlight, 65 | #language, 66 | #custom-adaptive-light, 67 | #custom-sunset, 68 | #custom-playerctl, 69 | #tray { 70 | padding-left: 5px; 71 | padding-right: 5px; 72 | } 73 | 74 | #workspaces button { 75 | padding-left: 4px; 76 | padding-right: 4px; 77 | } 78 | 79 | #workspaces button.focused { 80 | color: #000; 81 | background: alpha(#1688f0, 0.75); 82 | } 83 | 84 | #workspaces button.urgent { 85 | border-color: @error_color; 86 | color: @error_color; 87 | } 88 | 89 | #custom-zeit.tracking { 90 | background-color: @warning_color; 91 | } 92 | 93 | #battery { 94 | animation-timing-function: linear; 95 | animation-iteration-count: infinite; 96 | animation-direction: alternate; 97 | } 98 | 99 | #battery.warning { 100 | color: @warning_color; 101 | } 102 | 103 | #battery.critical { 104 | color: @error_color; 105 | } 106 | 107 | #battery.warning.discharging { 108 | animation-name: blink-warning; 109 | animation-duration: 3s; 110 | } 111 | 112 | #battery.critical.discharging { 113 | animation-name: blink-critical; 114 | animation-duration: 2s; 115 | } 116 | 117 | #cpu.warning { 118 | color: @warning_color; 119 | } 120 | 121 | #cpu.critical { 122 | color: @error_color; 123 | } 124 | 125 | #custom-menu { 126 | padding-left: 8px; 127 | padding-right: 8px; 128 | } 129 | 130 | #memory { 131 | animation-timing-function: linear; 132 | animation-iteration-count: infinite; 133 | animation-direction: alternate; 134 | } 135 | 136 | #memory.warning { 137 | color: @warning_color; 138 | } 139 | 140 | #memory.critical { 141 | color: @error_color; 142 | animation-name: blink-critical; 143 | animation-duration: 2s; 144 | } 145 | 146 | #network.disconnected { 147 | color: @warning_color; 148 | } 149 | 150 | #pulseaudio.muted { 151 | color: @warning_color; 152 | } 153 | 154 | #temperature.critical { 155 | color: @error_color; 156 | } 157 | 158 | #custom-pacman { 159 | color: @warning_color; 160 | } 161 | 162 | #bluetooth.disabled { 163 | color: @warning_color; 164 | } 165 | 166 | #custom-wf-recorder { 167 | color: @error_color; 168 | padding-right: 8px; 169 | } 170 | -------------------------------------------------------------------------------- /scripts/autoname-workspaces.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # This script requires i3ipc-python package (install it from a system package manager 4 | # or pip). 5 | # It adds icons to the workspace name for each open window. 6 | # Set your keybindings like this: set $workspace1 workspace number 1 7 | # Add your icons to WINDOW_ICONS. 8 | # Based on https://github.com/maximbaz/dotfiles/blob/master/bin/i3-autoname-workspaces 9 | 10 | import argparse 11 | import i3ipc 12 | import logging 13 | import re 14 | import signal 15 | import sys 16 | 17 | WINDOW_ICONS = { 18 | "firefox": "", 19 | } 20 | 21 | DEFAULT_ICON = "󰀏" 22 | 23 | 24 | def icon_for_window(window): 25 | name = None 26 | if window.app_id is not None and len(window.app_id) > 0: 27 | name = window.app_id.lower() 28 | elif window.window_class is not None and len(window.window_class) > 0: 29 | name = window.window_class.lower() 30 | 31 | if name in WINDOW_ICONS: 32 | return WINDOW_ICONS[name] 33 | 34 | logging.info("No icon available for window with name: %s" % str(name)) 35 | return DEFAULT_ICON 36 | 37 | 38 | def rename_workspaces(ipc): 39 | for workspace in ipc.get_tree().workspaces(): 40 | name_parts = parse_workspace_name(workspace.name) 41 | icon_tuple = () 42 | for w in workspace: 43 | if w.app_id is not None or w.window_class is not None: 44 | icon = icon_for_window(w) 45 | if not ARGUMENTS.duplicates and icon in icon_tuple: 46 | continue 47 | icon_tuple += (icon,) 48 | name_parts["icons"] = " ".join(icon_tuple) + " " 49 | new_name = construct_workspace_name(name_parts) 50 | ipc.command('rename workspace "%s" to "%s"' % 51 | (workspace.name, new_name)) 52 | 53 | 54 | def undo_window_renaming(ipc): 55 | for workspace in ipc.get_tree().workspaces(): 56 | name_parts = parse_workspace_name(workspace.name) 57 | name_parts["icons"] = None 58 | new_name = construct_workspace_name(name_parts) 59 | ipc.command('rename workspace "%s" to "%s"' % 60 | (workspace.name, new_name)) 61 | ipc.main_quit() 62 | sys.exit(0) 63 | 64 | 65 | def parse_workspace_name(name): 66 | return re.match( 67 | "(?P[0-9]+):?(?P\w+)? ?(?P.+)?", name 68 | ).groupdict() 69 | 70 | 71 | def construct_workspace_name(parts): 72 | new_name = str(parts["num"]) 73 | if parts["shortname"] or parts["icons"]: 74 | new_name += ":" 75 | 76 | if parts["shortname"]: 77 | new_name += parts["shortname"] 78 | 79 | if parts["icons"]: 80 | new_name += " " + parts["icons"] 81 | 82 | return new_name 83 | 84 | 85 | if __name__ == "__main__": 86 | parser = argparse.ArgumentParser( 87 | description="This script automatically changes the workspace name in sway depending on your open applications." 88 | ) 89 | parser.add_argument( 90 | "--duplicates", 91 | "-d", 92 | action="store_true", 93 | help="Set it when you want an icon for each instance of the same application per workspace.", 94 | ) 95 | parser.add_argument( 96 | "--logfile", 97 | "-l", 98 | type=str, 99 | default="/tmp/sway-autoname-workspaces.log", 100 | help="Path for the logfile.", 101 | ) 102 | args = parser.parse_args() 103 | global ARGUMENTS 104 | ARGUMENTS = args 105 | 106 | logging.basicConfig( 107 | level=logging.INFO, 108 | filename=ARGUMENTS.logfile, 109 | filemode="w", 110 | format="%(message)s", 111 | ) 112 | 113 | ipc = i3ipc.Connection() 114 | 115 | for sig in [signal.SIGINT, signal.SIGTERM]: 116 | signal.signal(sig, lambda signal, frame: undo_window_renaming(ipc)) 117 | 118 | def window_event_handler(ipc, e): 119 | if e.change in ["new", "close", "move"]: 120 | rename_workspaces(ipc) 121 | 122 | ipc.on("window", window_event_handler) 123 | 124 | rename_workspaces(ipc) 125 | 126 | ipc.main() 127 | -------------------------------------------------------------------------------- /foot/foot.ini: -------------------------------------------------------------------------------- 1 | # -*- conf -*- 2 | 3 | # shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) 4 | term=xterm-256color #(or foot-extra) 5 | # login-shell=no 6 | 7 | font=FiraCode Nerd Font:size=9 8 | # font-bold= 9 | # font-italic= 10 | # font-bold-italic= 11 | # line-height= 12 | # letter-spacing=0 13 | # horizontal-letter-offset=0 14 | # vertical-letter-offset=0 15 | # underline-offset= 16 | # box-drawings-uses-font-glyphs=no 17 | # dpi-aware=yes 18 | 19 | # initial-window-size-pixels=700x500 # Or, 20 | # initial-window-size-chars= 21 | # initial-window-mode=windowed 22 | # pad=2x2 # optionally append 'center' 23 | resize-delay-ms=50 24 | 25 | # notify=notify-send.sh -a ${app-id} -i ${app-id} ${title} ${body} 26 | 27 | # bold-text-in-bright=no 28 | # bell=none 29 | # word-delimiters=,│`|:"'()[]{}<> 30 | # selection-target=primary 31 | # workers= 32 | 33 | [bell] 34 | # urgent=no 35 | # notify=no 36 | # command= 37 | # command-focused=no 38 | 39 | [scrollback] 40 | lines=10000 41 | # multiplier=3.0 42 | # indicator-position=relative 43 | # indicator-format= 44 | 45 | [url] 46 | launch=xdg-open ${url} 47 | label-letters=sadfjklewcmpgh 48 | osc8-underline=url-mode 49 | 50 | [cursor] 51 | style=block 52 | blink=yes 53 | beam-thickness=1 54 | # underline-thickness= 55 | 56 | [mouse] 57 | hide-when-typing=yes 58 | # alternate-scroll-mode=yes 59 | 60 | [colors] 61 | alpha=1 62 | foreground=eeeeee 63 | background=000000 64 | cursor=eeeeee 1688f0 65 | # background=141a1b 66 | regular0=000000 # black 67 | regular1=e00606 # red 68 | regular2=3ed50a # green 69 | regular3=f1c200 # yellow 70 | regular4=0d73cc # blue 71 | regular5=cb1ed1 # magenta 72 | regular6=0dcdcd # cyan 73 | regular7=dddddd # white 74 | bright0=767676 # bright black 75 | bright1=ff0043 # red 76 | bright2=00f955 # green 77 | bright3=fffd00 # yellow 78 | bright4=1688f0 # blue 79 | bright5=fd28ff # magenta 80 | bright6=14ffff # cyan 81 | bright7=ffffff # bright white 82 | # 16 = <256-color palette #16> 83 | # ... 84 | # 255 = <256-color palette #255> 85 | # selection-foreground= 86 | # selection-background= 87 | jump-labels=000000 1688f0 88 | urls=fd28ff 89 | 90 | [csd] 91 | # preferred=server 92 | # size=26 93 | # color= 94 | # button-width=26 95 | # button-color= 96 | # button-minimize-color= 97 | # button-maximize-color= 98 | # button-close-color= 99 | 100 | [key-bindings] 101 | # scrollback-up-page=Shift+Page_Up 102 | # scrollback-up-half-page=none 103 | # scrollback-up-line=none 104 | # scrollback-down-page=Shift+Page_Down 105 | # scrollback-down-half-page=none 106 | # scrollback-down-line=none 107 | # clipboard-copy=Control+Shift+c 108 | # clipboard-paste=Control+Shift+v 109 | # primary-paste=Shift+Insert 110 | search-start=Control+Shift+f 111 | # font-increase=Control+plus Control+equal Control+KP_Add 112 | # font-decrease=Control+minus Control+KP_Subtract 113 | # font-reset=Control+0 Control+KP_0 114 | # spawn-terminal=Control+Shift+n 115 | # minimize=none 116 | # maximize=none 117 | # fullscreen=none 118 | # pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none 119 | # pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none 120 | # pipe-selected=[xargs -r firefox] none 121 | # show-urls-launch=Control+Shift+u 122 | # show-urls-copy=none 123 | 124 | [search-bindings] 125 | # cancel=Control+g Escape 126 | # commit=Return 127 | # find-prev=Control+r 128 | # find-next=Control+s 129 | # cursor-left=Left Control+b 130 | # cursor-left-word=Control+Left Mod1+b 131 | # cursor-right=Right Control+f 132 | # cursor-right-word=Control+Right Mod1+f 133 | # cursor-home=Home Control+a 134 | # cursor-end=End Control+e 135 | # delete-prev=BackSpace 136 | # delete-prev-word=Mod1+BackSpace Control+BackSpace 137 | # delete-next=Delete 138 | # delete-next-word=Mod1+d Control+Delete 139 | # extend-to-word-boundary=Control+w 140 | # extend-to-next-whitespace=Control+Shift+w 141 | # clipboard-paste=Control+v Control+y 142 | # primary-paste=Shift+Insert 143 | 144 | [url-bindings] 145 | # cancel=Control+g Control+d Escape 146 | # toggle-url-visible=t 147 | 148 | [mouse-bindings] 149 | # primary-paste=BTN_MIDDLE 150 | # select-begin=BTN_LEFT 151 | # select-begin-block=Control+BTN_LEFT 152 | # select-extend=BTN_RIGHT 153 | # select-extend-character-wise=Control+BTN_RIGHT 154 | # select-word=BTN_LEFT-2 155 | # select-word-whitespace=Control+BTN_LEFT-2 156 | # select-row=BTN_LEFT-3 157 | -------------------------------------------------------------------------------- /scripts/grimshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## Grimshot: a helper for screenshots within sway 4 | ## Requirements: 5 | ## - `grim`: screenshot utility for wayland 6 | ## - `slurp`: to select an area 7 | ## - `swaymsg`: to read properties of current window 8 | ## - `wl-copy`: clipboard utility 9 | ## - `jq`: json utility to parse swaymsg output 10 | ## - `notify-send.sh`: to show notifications 11 | ## Those are needed to be installed, if unsure, run `grimshot check` 12 | ## 13 | ## See `man 1 grimshot` or `grimshot usage` for further details. 14 | 15 | getTargetDirectory() { 16 | echo "$HOME/Pictures/Screenshots/" 17 | } 18 | 19 | NOTIFY=no 20 | CURSOR= 21 | 22 | while [ $# -gt 0 ]; do 23 | key="$1" 24 | 25 | case $key in 26 | -n | --notify) 27 | NOTIFY=yes 28 | shift # past argument 29 | ;; 30 | -c | --cursor) 31 | CURSOR=yes 32 | shift # past argument 33 | ;; 34 | *) # unknown option 35 | break # done with parsing --flags 36 | ;; 37 | esac 38 | done 39 | 40 | ACTION=${1:-usage} 41 | SUBJECT=${2:-screen} 42 | FILE=${3:-$(getTargetDirectory)/$(date -Ins).png} 43 | 44 | if [ "$ACTION" != "save" ] && [ "$ACTION" != "copy" ] && [ "$ACTION" != "check" ]; then 45 | echo "Usage:" 46 | echo " grimshot [--notify] [--cursor] (copy|save) [active|screen|output|area|window] [FILE|-]" 47 | echo " grimshot check" 48 | echo " grimshot usage" 49 | echo "" 50 | echo "Commands:" 51 | echo " copy: Copy the screenshot data into the clipboard." 52 | echo " save: Save the screenshot to a regular file or '-' to pipe to STDOUT." 53 | echo " check: Verify if required tools are installed and exit." 54 | echo " usage: Show this message and exit." 55 | echo "" 56 | echo "Targets:" 57 | echo " active: Currently active window." 58 | echo " screen: All visible outputs." 59 | echo " output: Currently active output." 60 | echo " area: Manually select a region." 61 | echo " window: Manually select a window." 62 | exit 63 | fi 64 | 65 | notify() { 66 | notify-send.sh -t 3000 -a grimshot "$@" 67 | } 68 | 69 | notifyOk() { 70 | [ "$NOTIFY" = "no" ] && return 71 | 72 | TITLE=${2:-"Screenshot"} 73 | MESSAGE=${1:-"OK"} 74 | notify "$TITLE" "$MESSAGE" 75 | } 76 | 77 | notifyError() { 78 | if [ $NOTIFY = "yes" ]; then 79 | TITLE=${2:-"Screenshot"} 80 | MESSAGE=${1:-"Error taking screenshot with grim"} 81 | notify -u critical "$TITLE" "$MESSAGE" 82 | else 83 | echo "$1" 84 | fi 85 | } 86 | 87 | die() { 88 | MSG=${1:-Bye} 89 | notifyError "Error: $MSG" 90 | exit 2 91 | } 92 | 93 | check() { 94 | COMMAND=$1 95 | if command -v "$COMMAND" >/dev/null 2>&1; then 96 | RESULT="OK" 97 | else 98 | RESULT="NOT FOUND" 99 | fi 100 | echo " $COMMAND: $RESULT" 101 | } 102 | 103 | takeScreenshot() { 104 | FILE=$1 105 | GEOM=$2 106 | OUTPUT=$3 107 | if [ -n "$OUTPUT" ]; then 108 | grim ${CURSOR:+-c} -o "$OUTPUT" "$FILE" || die "Unable to invoke grim" 109 | elif [ -z "$GEOM" ]; then 110 | grim ${CURSOR:+-c} "$FILE" || die "Unable to invoke grim" 111 | else 112 | grim ${CURSOR:+-c} -g "$GEOM" "$FILE" || die "Unable to invoke grim" 113 | fi 114 | } 115 | 116 | if [ "$ACTION" = "check" ]; then 117 | echo "Checking if required tools are installed. If something is missing, install it to your system and make it available in PATH..." 118 | check grim 119 | check slurp 120 | check swaymsg 121 | check wl-copy 122 | check jq 123 | check notify-send.sh 124 | check swappy 125 | exit 126 | elif [ "$SUBJECT" = "area" ]; then 127 | GEOM=$(slurp -d) 128 | # Check if user exited slurp without selecting the area 129 | if [ -z "$GEOM" ]; then 130 | exit 1 131 | fi 132 | WHAT="Area" 133 | elif [ "$SUBJECT" = "active" ]; then 134 | FOCUSED=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?, .floating_nodes[]?) | select(.focused)') 135 | GEOM=$(echo "$FOCUSED" | jq -r '.rect | "\(.x),\(.y) \(.width)x\(.height)"') 136 | APP_ID=$(echo "$FOCUSED" | jq -r '.app_id') 137 | WHAT="$APP_ID window" 138 | elif [ "$SUBJECT" = "screen" ]; then 139 | GEOM="" 140 | WHAT="Screen" 141 | elif [ "$SUBJECT" = "output" ]; then 142 | GEOM="" 143 | OUTPUT=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused)' | jq -r '.name') 144 | WHAT="$OUTPUT" 145 | elif [ "$SUBJECT" = "window" ]; then 146 | GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) 147 | # Check if user exited slurp without selecting the area 148 | if [ -z "$GEOM" ]; then 149 | exit 1 150 | fi 151 | WHAT="Window" 152 | else 153 | die "Unknown subject to take a screen shot from" "$SUBJECT" 154 | fi 155 | 156 | if [ "$ACTION" = "copy" ]; then 157 | takeScreenshot - "$GEOM" "$OUTPUT" | wl-copy --type image/png || die "Clipboard error" 158 | notifyOk "$WHAT copied to buffer" 159 | else 160 | if takeScreenshot "$FILE" "$GEOM" "$OUTPUT"; then 161 | TITLE="Screenshot Saved" 162 | MESSAGE="Saved $SUBJECT to $FILE" 163 | notifyOk "$MESSAGE" "$TITLE" 164 | echo "$FILE" 165 | else 166 | notifyError "Error taking screenshot with grim" 167 | fi 168 | fi 169 | -------------------------------------------------------------------------------- /docs/keybindings.md: -------------------------------------------------------------------------------- 1 | # [sway2k](https://github.com/2kabhishek/sway2k) [Keybindings](https://github.com/2KAbhishek/sway2k/blob/main/docs/keybindings.md) 2 | 3 | You can find keybindings for modes in the [modes dir](config.d/modes/) 4 | 5 | Default keybindings are similar to [i3 keybindings](https://i3wm.org/docs/userguide.html#_default_keybindings) 6 | 7 | > Mod is the Super or Windows key. 8 | 9 | | Keybinding | Action | 10 | | ---------------------------------------------------------- | -------------------------------------- | 11 | | Esc | Close floatin terminal, exit modes | 12 | | Alt + Tab | Most recent / urgent window | 13 | | Alt + Shift + +/- | Zoom in / Zoom out | 14 | | Mod + Enter | Open Terminal | 15 | | Mod + Shift + Enter / F12 | Open Floating terminal | 16 | | Mod + Space | Open app launcher | 17 | | Mod + Tab | Most recent workspace | 18 | | Mod + ←/→ | Move between workspaces | 19 | | Mod + ↑/↓ | Resize focused workspace | 20 | | Mod + . | Open emoji panel | 21 | | Mod + 0-9 | Switch focused workspace | 22 | | Mod + Shift + 0-9 | Move focused window to workspace | 23 | | Mod + a | Open app switcher | 24 | | Mod + Shift + B | Toggle waybar | 25 | | Mod + Shift + C | Reload config | 26 | | Mod + d | Open app launcher in empty workspace | 27 | | Mod + f / F11 | Full screen focused window | 28 | | Mod + Shift + F | Toggle floating | 29 | | Mod + h/j/k/l | Switch focused window | 30 | | Mod + Alt + h/j/k/l/arrows | Move focused window between screens | 31 | | Mod + Shift + H/J/K/L/arrows | Move focused window within workspace | 32 | | Mod + Shift + M | Move focused window to empty workspace | 33 | | Mod + n | Move to empty workspace | 34 | | Mod + Shift + N | Move focused window away | 35 | | Mod + Shift + P | Open default camera app | 36 | | Mod + q | Close focused window | 37 | | Mod + v | Open clipboard history | 38 | | Mod + ] | Open Qutebrowser | 39 | | Mod + [ | Open Terminal | 40 | | Mod + ; | Open Camera (guvcview) | 41 | 42 | ## Resize Mode 43 | 44 | | Keybinding | Action | 45 | | -------------------------------------------- | ------------------------ | 46 | | Mod + r | Open resize mode | 47 | | h/j/k/l/arrows | Resize windows by 10px | 48 | | Shift + H/J/K/L/Arrows | Resize windows by 50px | 49 | | Shift + =/+ / - | Increase / Decrease gaps | 50 | | Esc / Enter | Exit mode | 51 | 52 | ## Screenshot Mode 53 | 54 | | Keybinding | Action | 55 | | ------------------------------------- | ------------------------ | 56 | | Mod + Shift + P | Open screenshot mode | 57 | | p | Select region to capture | 58 | | o | Capture full screen | 59 | | Shift + P / O | Capture with upload | 60 | | Esc | Exit mode | 61 | 62 | ## Record Mode 63 | 64 | | Keybinding | Action | 65 | | ------------------------------------- | ----------------- | 66 | | Mod + Shift + R | Open record mode | 67 | | r | Start recording | 68 | | Shift + R | Record with audio | 69 | | Esc | Exit mode | 70 | 71 | ## Shutdown Mode 72 | 73 | | Keybinding | Action | 74 | | ------------------------------------- | ------------------ | 75 | | Mod + Shift + Q | Open shutdown mode | 76 | | l | Lock | 77 | | s | Shutdown | 78 | | r | Reboot | 79 | | u | Sleep | 80 | | e | Logout | 81 | | Esc | Exit mode | 82 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 |

sway2k

4 | 5 | 6 | License 7 | 8 | 9 | People 10 | 11 | 12 | Stars 13 | 14 | 15 | Forks 16 | 17 | 18 | Watches 19 | 20 | 21 | Last Updated 22 | 23 |

Swaying Windows in Wayland 🎏🛣

24 | 25 |
26 | sway2k in action 27 |
28 |
sway2k in action
29 |
30 | 31 |
32 | 33 | My personalized configs for [sway window manager](https://swaywm.org/), minimalistic in design and optimized for developer productivity. 34 | 35 | ## ✨ Features 36 | 37 | - Optimized for the CLI 38 | - Comes with integrations for `foot`, `mako`, `waybar` and more 39 | - Minimalistic UI 40 | - Optimized for AMOLED displays 41 | 42 | ## Setup 43 | 44 | ### ⚡ Requirements 45 | 46 | #### Packages 47 | 48 | All the mentioned packages may not be available in your package manager, you might have to install them manually. 49 | 50 | - `sway`: the window manager 51 | - `foot`: wayland terminal emulator 52 | - `waybar`: adds toolbar support 53 | - `rofi`: app launcher 54 | - `qutebrowser`: keyboard driven browser 55 | - `mako`: notification daemon 56 | - `grim`: screenshot support 57 | - `swappy`: for screenshot editing 58 | - `slurp`: for screenshot area selection 59 | - `wf-recorder`: screen recorder support 60 | - `cliphist`: for clipboard management 61 | - `wluma`: adaptive brightness support 62 | - `wlsunset`: sunset timing support 63 | - `light`: for display brightness 64 | - `python`: for scripts support 65 | - `nmtui`: network manager 66 | - `bluetuith`: bluetooth manager 67 | - `pulsemixer`: audio manager 68 | - `calcurse`: calendar 69 | - `notify-send.sh`: notify-send alternative for notifications 70 | - `kvantum`/`lxappearance`/`themix`: qt / gtk theme manager - themix can be removed after BWnB gtk theme export 71 | - [BWnb](https://github.com/2kabhishek/BWnb) as the theme for qt and gtk 72 | - Note: You have to manually install `BWnB` using Kvantum Manager, or it will always open the manager after restart 73 | - `btop`: system monitor 74 | - FiraCode Nerd Font 75 | 76 | ```bash 77 | # Arch 78 | sudo pacman -S sway foot rofi waybar mako calcurse grim jq pulsemixer wf-recorder cliphist wluma wlsunset light swappy python \ 79 | xdg-user-dirs kvantum lxappearance ttf-firacode-nerd qutebrowser btop 80 | yay notify-send.sh themix-full-git 81 | 82 | # Debian 83 | sudo apt install sway foot rofi waybar mako grim calcurse jq pulsemixer wf-recorder cliphist wluma wlsunset light notify-send.sh swappy python 84 | 85 | # Fedora 86 | sudo dnf install kvantum lxappearance kanshi calcurse 87 | ``` 88 | 89 | #### Recommended Configurations 90 | 91 | Highly recommended to use this alongside the following configurations: 92 | 93 | - [rofi2k](https://github.com/2kabhishek/rofi2k) as rofi config 94 | - [qute2k](https://github.com/2kabhishek/qute2k) as quetbrowser config 95 | - [dots2k](https://github.com/2kabhishek/dots2k) CLI Dev Environment 96 | - [nvim2k](https://github.com/2kabhishek/nvim2k) Personalized Editor 97 | 98 | ### 🚀 Installation 99 | 100 | ```bash 101 | git clone https://github.com/2kabhishek/sway2k 102 | ln -sfnv "$PWD/sway2k" ~/.config/sway 103 | ``` 104 | 105 | ## 💻 Usage 106 | 107 | ### Keybindings 108 | 109 | All the configured keybindings can be found in the [keybinding manual here](./docs/keybindings.md). 110 | 111 | ### Customization 112 | 113 | - Customize colors, icons, fonts, and more in [theme.conf](./config.d/theme.conf). 114 | - Customize Default apps and other definitions in [definitions.conf](config.d/definitions.conf) 115 | 116 | ### Waybar Modules 117 | 118 | Comes with a bunch of customized [waybar modules](./waybar/config.jsonc) 119 | 120 | - `menu`: app launcher 121 | - `clock`: with calendar integration 122 | - `mode`: sway modes 123 | - `wf-recorder`: screen recorder integration 124 | - `pacman`: package manager integration 125 | - `github`: GitHub notifications with gh cli 126 | - `zeit`: task tracker integration 127 | - `clipboard`: powered by cliphist 128 | - `temperature`: cpu temperatures with sensors 129 | - `cpu`: cpu usage in percentage 130 | - `memory`: shows used ram 131 | - `idle-inhibitor`: controls idle screen turning off 132 | - `battery`: shows battery usages and warnings 133 | - `sunset`: location based gamma correction 134 | - `adaptive-light`: brightness control powered by wluma 135 | - `backlight`: brightness control 136 | - `playerctl`: controls media playback 137 | - `pulseaudio`: controls audio devices 138 | - `network`: network connections powered by nmtui 139 | - `bluetooth`: bluetooth adapter controls 140 | - `dnd`: mako dnd integrations 141 | - `tray`: system tray integration 142 | 143 | These modules share their behaviour with [tmux2k plugins](https://github.com/2kabhishek/tmux2k#-available-plugins) 144 | 145 | - `weather`: powered by wttr.in 146 | - `ping`: shows ping status of a server 147 | - `gpu`: shows GPU usage 148 | - `uptime`: shows system uptime 149 | 150 | If you want to use the waybar config by itself, you can do so by running: 151 | 152 | ```bash 153 | # To setup waybar separately 154 | ln -sfnv "$PWD/sway2k/waybar" ~/.config/waybar 155 | ``` 156 | 157 | ## Behind The Code 158 | 159 | ### 🌈 Inspiration 160 | 161 | A spiritual successor to [awesome2k](https://github.com/2KAbhishek/awesome2k). 162 | 163 | I have been using awesome wm for a while and wanted to try out wayland, so I jumped in to sway! 164 | 165 | ### 💡 Challenges/Learnings 166 | 167 | - Learned about wayland and sway APIs 168 | 169 | ### 🔍 More Info 170 | 171 | - [awesome2k](https://github.com/2kabhishek/awesome2k) — Xorg based tiling wm configs 172 | 173 |
174 | 175 |
176 | 177 | ⭐ hit the star button if you found this useful ⭐
178 | 179 | Source 180 | | Blog 181 | | Twitter 182 | | LinkedIn 183 | | More Links 184 | | Other Projects 185 | 186 |
187 | -------------------------------------------------------------------------------- /config.d/modes/default.conf: -------------------------------------------------------------------------------- 1 | ### Key bindings 2 | # 3 | # Basics: 4 | # 5 | ## Launch // Terminal ## 6 | $bindsym $mod+Return exec $term_cwd 7 | $bindsym $mod+Shift+Return exec $term_float_large 8 | $bindsym F12 exec $term_float_large 9 | 10 | # allow to kill focused floating shell windows using Esc 11 | $bindsym --release Escape [app_id="floating_shell" con_id=__focused__] kill 12 | 13 | # Launch apps 14 | # bind mod + [ to exec term_cmd 15 | $bindsym $mod+bracketleft exec "$HOME/.config/sway/scripts/focus_or_launch.sh $term foot" 16 | $bindsym $mod+bracketright exec "$HOME/.config/sway/scripts/focus_or_launch.sh $browser $browser_id" 17 | bindcode $mod+47 exec $camera 18 | 19 | ## Action // Kill focused window ## 20 | $bindsym $mod+q kill 21 | 22 | ## Launch // Open launcher ## 23 | $bindsym $mod+space exec $menu 24 | 25 | ## Launch // Open clipboard ## 26 | $bindsym $mod+v exec $clipboard 27 | 28 | # emoji search 29 | $bindsym $mod+period exec "rofi -show emoji" 30 | 31 | # Drag floating windows by holding down $mod and left mouse button. 32 | # Resize them with right mouse button + $mod. 33 | # Despite the name, also works for non-floating windows. 34 | # Change normal to inverse to use left mouse button for resizing and right 35 | # mouse button for dragging. 36 | floating_modifier $mod normal 37 | 38 | ## Action // Reload Sway Configuration ## 39 | $bindsym $mod+Shift+c reload 40 | 41 | ## Action // Toggle Waybar ## 42 | $bindsym $mod+Shift+b exec pkill -SIGUSR1 waybar 43 | 44 | # --locked flags allow the buttons to be used whilst the screen is locked. 45 | $bindsym --locked XF86AudioRaiseVolume exec $volume_up 46 | 47 | $bindsym --locked XF86AudioLowerVolume exec $volume_down 48 | 49 | $bindsym --locked XF86AudioMute exec $volume_mute 50 | 51 | $bindsym XF86AudioMicMute exec $mic_mute 52 | 53 | $bindsym --locked XF86MonBrightnessUp exec $brightness_up 54 | 55 | $bindsym --locked XF86MonBrightnessDown exec $brightness_down 56 | 57 | $bindsym --locked XF86AudioPlay exec playerctl play-pause 58 | 59 | $bindsym XF86AudioNext exec playerctl next 60 | 61 | $bindsym XF86AudioPrev exec playerctl previous 62 | 63 | $bindsym XF86Search exec $menu 64 | 65 | $bindsym XF86PowerOff exec $shutdown 66 | 67 | $bindsym XF86TouchpadToggle input type:touchpad events toggle enabled disabled 68 | 69 | # Moving around: 70 | # 71 | # Move your focus around 72 | ## Navigation // Move focus // $mod + ↑ ↓ ← → ## 73 | $bindsym $mod+$left_alt focus left 74 | $bindsym $mod+$down_alt focus down 75 | $bindsym $mod+$up_alt focus up 76 | $bindsym $mod+$right_alt focus right 77 | 78 | ## Navigation // Move focused window // $mod + Shift + ↑ ↓ ← → ## 79 | $bindsym $mod+Shift+$left move left 80 | $bindsym $mod+Shift+$down move down 81 | $bindsym $mod+Shift+$up move up 82 | $bindsym $mod+Shift+$right move right 83 | 84 | $bindsym $mod+Shift+$left_alt move left 85 | $bindsym $mod+Shift+$down_alt move down 86 | $bindsym $mod+Shift+$up_alt move up 87 | $bindsym $mod+Shift+$right_alt move right 88 | 89 | ## Navigation // Move focused workspace // $mod + Alt + ↑ ↓ ← → ## 90 | $bindsym $mod+Alt+$right move workspace to output right 91 | $bindsym $mod+Alt+$left move workspace to output left 92 | $bindsym $mod+Alt+$down move workspace to output down 93 | $bindsym $mod+Alt+$up move workspace to output up 94 | 95 | $bindsym $mod+Alt+$right_alt move workspace to output right 96 | $bindsym $mod+Alt+$left_alt move workspace to output left 97 | $bindsym $mod+Alt+$down_alt move workspace to output down 98 | $bindsym $mod+Alt+$up_alt move workspace to output up 99 | 100 | ## Navigation // List all open windows in last-recently-used order ## 101 | $bindsym $mod+a exec env RUST_BACKTRACE=1 swayr switch-window &>> /tmp/swayr.log 102 | 103 | ## Navigation // Switch to the last recently used window ## 104 | $bindsym Mod1+Tab exec env RUST_BACKTRACE=1 swayr switch-to-urgent-or-lru-window &>> /tmp/swayr.log 105 | 106 | ## Navigation // Switch to the last recently used workspace ## 107 | $bindsym $mod+Tab workspace back_and_forth 108 | 109 | # Resize your windows 110 | $bindsym $mod+$up resize grow width 10 px or 10 ppt 111 | $bindsym $mod+$down resize shrink width 10 px or 10 ppt 112 | 113 | # 114 | # Workspaces: 115 | # 116 | # Move between workspaces 117 | $bindsym $mod+$left workspace prev 118 | $bindsym $mod+$right workspace next 119 | 120 | ## Navigation // Switch workspace // $mod + [number] ## 121 | $bindsym $mod+1 workspace $ws1 122 | $bindsym $mod+2 workspace $ws2 123 | $bindsym $mod+3 workspace $ws3 124 | $bindsym $mod+4 workspace $ws4 125 | $bindsym $mod+5 workspace $ws5 126 | $bindsym $mod+6 workspace $ws6 127 | $bindsym $mod+7 workspace $ws7 128 | $bindsym $mod+8 workspace $ws8 129 | $bindsym $mod+9 workspace $ws9 130 | $bindsym $mod+0 workspace $ws10 131 | 132 | set $focus_ws [ "$focus_after_move" == 'true' ] && swaymsg workspace 133 | 134 | ## Action // Move focused window to workspace // $mod + Shift + [number] ## 135 | $bindsym $mod+Shift+1 move container to workspace $ws1, exec $focus_ws $ws1 136 | $bindsym $mod+Shift+2 move container to workspace $ws2, exec $focus_ws $ws2 137 | $bindsym $mod+Shift+3 move container to workspace $ws3, exec $focus_ws $ws3 138 | $bindsym $mod+Shift+4 move container to workspace $ws4, exec $focus_ws $ws4 139 | $bindsym $mod+Shift+5 move container to workspace $ws5, exec $focus_ws $ws5 140 | $bindsym $mod+Shift+6 move container to workspace $ws6, exec $focus_ws $ws6 141 | $bindsym $mod+Shift+7 move container to workspace $ws7, exec $focus_ws $ws7 142 | $bindsym $mod+Shift+8 move container to workspace $ws8, exec $focus_ws $ws8 143 | $bindsym $mod+Shift+9 move container to workspace $ws9, exec $focus_ws $ws9 144 | $bindsym $mod+Shift+0 move container to workspace $ws10, exec $focus_ws $ws10 145 | 146 | ## Launch // Open launcher in a new workspace ## 147 | $bindsym $mod+d exec $HOME/.config/sway/scripts/first-empty-workspace.py --switch, exec $menu 148 | 149 | ## Navigation // Switch to a new workspace ## 150 | $bindsym $mod+n exec $HOME/.config/sway/scripts/first-empty-workspace.py --switch 151 | 152 | ## Action // Move focused window to a new workspace ## 153 | $bindsym $mod+Shift+n exec $HOME/.config/sway/scripts/first-empty-workspace.py --move 154 | 155 | ## Action // Move focused window to a new workspace and switch there ## 156 | $bindsym $mod+Shift+m exec $HOME/.config/sway/scripts/first-empty-workspace.py --move --switch 157 | 158 | # 159 | # Layout stuff: 160 | # 161 | ## Setting // Split windows horizontally ## 162 | $bindsym $mod+b splith 163 | ## Setting // Split windows vertically ## 164 | $bindsym $mod+Shift+v splitv 165 | 166 | ## Action // Switch to window stacking ## 167 | $bindsym $mod+s layout stacking 168 | ## Action // Switch to window tabbing ## 169 | $bindsym $mod+w layout tabbed 170 | ## Action // Toggle window splitting ## 171 | $bindsym $mod+e layout toggle split 172 | 173 | ## Action // Toggle fullscreen ## 174 | $bindsym $mod+f fullscreen 175 | $bindsym F11 fullscreen 176 | # $bindsym $mod+Shift+f fullscreen global 177 | 178 | ## Action // Scale up  ## 179 | $bindsym $alt_mod+plus exec $scale_up 180 | 181 | ## Action // Scale down  ## 182 | $bindsym $alt_mod+Shift+minus exec $scale_down 183 | 184 | ## Action // Toggle floating ## 185 | $bindsym $mod+Shift+f floating toggle 186 | 187 | ## Navigation // Toggle focus between tiling and floating ## 188 | $bindsym $alt_mod+space focus mode_toggle 189 | 190 | ## Navigation // Swap focus to the parent window ## 191 | $bindsym $mod+p focus parent 192 | 193 | ## Launch // Toggle Help ## 194 | $bindsym $mod+question exec $help 195 | # $bindsym $mod+Shift+s exec xdg-open https://github.com/Manjaro-Sway/manjaro-sway/blob/main/SUPPORT.md 196 | 197 | default_border pixel 1 198 | hide_edge_borders smart 199 | 200 | -------------------------------------------------------------------------------- /config.d/definitions.conf: -------------------------------------------------------------------------------- 1 | ### Variables 2 | # 3 | # Logo key. Use Mod1 for Alt and Mod4 for Super. 4 | set $mod Mod4 5 | set $alt_mod Mod1 6 | 7 | # Direction keys 8 | set $left Left 9 | set $down Down 10 | set $up Up 11 | set $right Right 12 | 13 | # Alternative direction keys 14 | set $left_alt h 15 | set $down_alt j 16 | set $up_alt k 17 | set $right_alt l 18 | 19 | # Add --to-code to bindsym, support for non-latin layouts 20 | set $bindsym bindsym --to-code 21 | 22 | # For user's convenience, the same for unbindsym 23 | set $unbindsym unbindsym --to-code 24 | 25 | # background 26 | set $background $HOME/.config/sway/docs/images/black.png 27 | 28 | # once-script 29 | set $once $HOME/.config/sway/scripts/once.sh 30 | 31 | # Your preferred terminal emulator 32 | set $term $HOME/.config/sway/scripts/foot.sh 33 | set $term_cwd $term -D "$(swaycwd 2>/dev/null || echo $HOME)" 34 | set $term_float footclient --app-id floating_shell --window-size-chars 120x40 35 | set $term_float_large footclient --app-id floating_shell --window-size-chars 165x55 36 | 37 | # Your preferred apps 38 | set $browser qutebrowser 39 | set $browser_id org.qutebrowser.qutebrowser 40 | set $camera guvcview 41 | 42 | # onscreen bar 43 | set $onscreen_bar $HOME/.config/sway/scripts/wob.sh "$accent-color" "$background-color" 44 | 45 | # brightness control 46 | set $brightness $HOME/.config/sway/scripts/brightness.sh 47 | set $brightness_up $brightness up | $onscreen_bar 48 | set $brightness_down $brightness down | $onscreen_bar 49 | 50 | # scaling 51 | set $scale_up $HOME/.config/sway/scripts/scale.sh up 52 | set $scale_down $HOME/.config/sway/scripts/scale.sh down 53 | 54 | # audio control 55 | set $sink_volume pactl get-sink-volume @DEFAULT_SINK@ | grep '^Volume:' | cut -d / -f 2 | tr -d ' ' | sed 's/%//' 56 | set $source_volume pactl get-source-volume @DEFAULT_SOURCE@ | grep '^Volume:' | cut -d / -f 2 | tr -d ' ' | sed 's/%//' 57 | set $volume_down $onscreen_bar $(pactl set-sink-volume @DEFAULT_SINK@ -5% && $sink_volume) 58 | set $volume_up $onscreen_bar $(pactl set-sink-volume @DEFAULT_SINK@ +5% && $sink_volume) 59 | 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") 60 | 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") 61 | 62 | # clipboard history 63 | set $clipboard cliphist list | rofi -dmenu -font "$gui-font" -p "Select item to copy" -lines 10 -width 35 | cliphist decode | wl-copy 64 | set $clipboard-del cliphist list | rofi -dmenu -font "$gui-font" -p "Select item to delete" -lines 10 -width 35 | cliphist delete 65 | 66 | # zeit tracking 67 | set $zeit_list zeit list --only-projects-and-tasks --append-project-id-to-task | \ 68 | rofi -dmenu -font "$gui-font" -p "Select task to track" -lines 10 -width 35 | \ 69 | $HOME/.config/sway/scripts/zeit.sh track && \ 70 | pkill -RTMIN+10 waybar 71 | 72 | # Your preferred application launcher 73 | 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 74 | 75 | ### Lockscreen configuration 76 | 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 77 | 78 | # bluetooth menu 79 | set $bluetooth $once $term_float bluetuith 80 | 81 | ### Idle configuration 82 | # This will lock your screen after 300 seconds of inactivity, then turn off 83 | # your displays after another 300 seconds, and turn your screens back on when 84 | # resumed. It will also lock your screen before your computer goes to sleep. 85 | # 86 | set $idle_timeout 240 87 | set $locking_timeout 300 88 | set $screen_timeout 600 89 | set $sleep_timeout 900 90 | set $sleep_delay 2 91 | 92 | set $swayidle swayidle -w \ 93 | timeout $idle_timeout 'light -G > /tmp/brightness && light -S 10' resume 'light -S $([ -f /tmp/brightness ] && cat /tmp/brightness || echo 100%)' \ 94 | timeout $locking_timeout 'exec $locking' \ 95 | timeout $screen_timeout 'swaymsg "output * dpms off"' \ 96 | resume 'swaymsg "output * dpms on"' \ 97 | timeout $sleep_timeout 'swaymsg "output * dpms on"; sleep $sleep_delay; systemctl suspend' \ 98 | before-sleep 'playerctl pause' \ 99 | before-sleep 'exec $locking & sleep $sleep_delay' 100 | 101 | # statusbar command 102 | set $statusbar waybar 103 | set $waybar_position top 104 | 105 | # pulseaudio command 106 | set $pulseaudio $term_float pulsemixer 107 | 108 | # help command 109 | set $help $HOME/.config/sway/scripts/help.sh --toggle 110 | 111 | # calendar application 112 | set $calendar $term_float calcurse 113 | 114 | # workspace names 115 | set $ws1 number 1 116 | set $ws2 number 2 117 | set $ws3 number 3 118 | set $ws4 number 4 119 | set $ws5 number 5 120 | set $ws6 number 6 121 | set $ws7 number 7 122 | set $ws8 number 8 123 | set $ws9 number 9 124 | set $ws10 number 10 125 | 126 | # screenshot 127 | set $grimshot $HOME/.config/sway/scripts/grimshot.sh 128 | set $pipe_output $grimshot save output - 129 | set $pipe_selection $grimshot save window - 130 | set $notify_paste [[ $(wl-paste -l) == "image/png" ]] && notify-send.sh "Screenshot copied to clipboard" 131 | set $swappy swappy -f - 132 | set $swappy_pipe swappy -f - -o - 133 | set $upload_pipe curl -s -F "file=@-;filename=.png" https://x0.at/ | tee >(wl-copy) >(xargs notify-send.sh) 134 | 135 | set $screenshot_screen $pipe_output | $swappy && $notify_paste 136 | set $screenshot_screen_upload $pipe_output | $swappy_pipe | $upload_pipe 137 | 138 | set $screenshot_selection $pipe_selection | $swappy && $notify_paste 139 | set $screenshot_selection_upload $pipe_selection | $swappy_pipe | $upload_pipe 140 | 141 | # autostarts 142 | set $autostart_dex '[ -x "$(command -v dex)" ] && gdbus wait --session org.kde.StatusNotifierWatcher && dex --autostart' 143 | set $flashfocus '[ -x "$(command -v flashfocus)" ] && flashfocus' 144 | set $wlsunset '[ -x "$(command -v wlsunset)" ] && $HOME/.config/sway/scripts/sunset.sh "on"' 145 | set $autotiling '[ -x "$(command -v autotiling-rs)" ] && autotiling-rs' 146 | set $foot_server '[ -x "$(command -v foot)" ] && $HOME/.config/sway/scripts/foot.sh --server' 147 | set $help_menu '[ -x "$(command -v nwg-wrapper)" ] && [ -f $HOME/.config/nwg-wrapper/help.sh ] && $HOME/.config/sway/scripts/help.sh' 148 | set $workspace_icons '[ -x "$(command -v sworkstyle)" ] && sworkstyle -d -l info &> /tmp/sworkstyle.log' 149 | set $mounting_daemon '[ -x "$(command -v pcmanfm)" ] && pcmanfm -d' 150 | # restart kanshi https://github.com/emersion/kanshi/issues/43#issuecomment-531679213 151 | set $kanshi '[ -x "$(command -v kanshi)" ] && pkill kanshi; exec kanshi' 152 | set $xdg-dirs '[ -x "$(command -v xdg-user-dirs-update)" ] && exec xdg-user-dirs-update' 153 | # apply the keyboard layout from localectl if no keyboard layout has been set via config.d 154 | set $auto_xdg_keyboard 'grep -q xkb_layout ~/.config/sway/config.d/*.conf || $HOME/.config/sway/scripts/keyboard.sh' 155 | 156 | # daemons 157 | set $mako '$HOME/.config/sway/scripts/mako.sh' 158 | set $poweralert '[ -x "$(command -v poweralertd)" ] && pkill poweralertd; poweralertd -s -i "line power" &' 159 | set $swayr_daemon '[ -x "$(command -v swayrd)" ] && pkill swayrd; RUST_BACKTRACE=1 RUST_LOG=swayr=debug swayrd &> /tmp/swayrd.log' 160 | set $cliphist_watch '[ -x "$(command -v wl-paste)" ] && [ -x "$(command -v cliphist)" ] && wl-paste --watch pkill -RTMIN+9 waybar' 161 | set $cliphist_store '[ -x "$(command -v wl-paste)" ] && [ -x "$(command -v cliphist)" ] && wl-paste --watch cliphist store' 162 | set $calendar_daemon 'calcurse --daemon' 163 | set $dropbox_daemon '[ -x "$(command -v dropbox)" ] && dropbox start' 164 | set $nm_applet '[ -x "$(command -v nm-applet)" ] && nm-applet' 165 | 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' 166 | -------------------------------------------------------------------------------- /waybar/config.jsonc: -------------------------------------------------------------------------------- 1 | // Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration 2 | { 3 | // Global 4 | "layer": "top", 5 | "height": 24, 6 | "position": "top", 7 | "modules-left": [ 8 | "custom/menu", 9 | "sway/workspaces", 10 | "custom/scratchpad", 11 | "sway/mode", 12 | "sway/window" 13 | ], 14 | "modules-center": ["clock"], 15 | "modules-right": [ 16 | "custom/wf-recorder", 17 | "custom/pacman", 18 | "custom/github", 19 | // "custom/uptime", 20 | // "custom/weather", 21 | "cpu", 22 | "memory", 23 | // "custom/gpu", 24 | "disk", 25 | "backlight", 26 | "battery", 27 | // "custom/ping", 28 | "network", 29 | "custom/playerctl", 30 | "pulseaudio", 31 | "custom/clipboard", 32 | "idle_inhibitor", 33 | "bluetooth", 34 | "custom/sunset", 35 | "custom/dnd", 36 | "tray" 37 | ], 38 | // Modules 39 | "sway/language": { 40 | "format": " {}", 41 | "min-length": 5, 42 | "tooltip": false, 43 | "on-click": "swaymsg input $(swaymsg -t get_inputs --raw | jq '[.[] | select(.type == \"keyboard\")][0] | .identifier') xkb_switch_layout next" 44 | }, 45 | "sway/mode": { 46 | "format": " {}", 47 | "max-length": 50, 48 | "tooltip": false 49 | }, 50 | "sway/workspaces": { 51 | "disable-scroll": true, 52 | "all-outputs": true, 53 | "format": "{icon}", 54 | "format-icons": { 55 | "1": "1  :", 56 | "2": "2  :", 57 | "3": "3  :", 58 | "4": "4  :", 59 | "5": "5  :" 60 | } 61 | }, 62 | "sway/window": { 63 | "format": " {}", 64 | "all-outputs": true, 65 | "offscreen-css": true, 66 | "offscreen-css-text": " ", 67 | "rewrite": { 68 | "(.*) - Mozilla Firefox": " $1", 69 | "(.*) - foot": " $1", 70 | "(.*) - fish": "> [$1]" 71 | } 72 | }, 73 | "backlight": { 74 | "format": "{icon} {percent}%", 75 | "format-icons": ["󰃞", "󰃟", "󰃠"], 76 | "on-scroll-up": "swaymsg exec \\$brightness_up", 77 | "on-scroll-down": "swaymsg exec \\$brightness_down" 78 | }, 79 | "battery": { 80 | "interval": 180, 81 | "states": { 82 | "warning": 30, 83 | "critical": 15 84 | }, 85 | "format-charging": "󰂄{capacity}%", 86 | "format": "{icon}{capacity}%", 87 | "format-icons": ["󱃍", "󰁺", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"], 88 | "tooltip": true 89 | }, 90 | "bluetooth": { 91 | "format": "", 92 | "format-disabled": "󰂲", 93 | "on-click": "swaymsg exec \\$bluetooth", 94 | "on-click-right": "rfkill toggle bluetooth", 95 | "tooltip-format": "{}" 96 | }, 97 | "clock": { 98 | "interval": 60, 99 | "format": " {:%I:%M %p}", 100 | "format-alt": " {:%a, %b %d -  %I:%M %p}", 101 | "timezones": ["Asia/Kolkata", "America/New_York"], 102 | "tooltip-format": "{calendar}", 103 | "calendar": { 104 | "mode": "month", 105 | "mode-mon-col": 2, 106 | "weeks-pos": "left", 107 | "on-scroll": 1, 108 | "on-click-right": "mode", 109 | "format": { 110 | "months": "{}", 111 | "days": "{}", 112 | "weeks": "W{}", 113 | "weekdays": "{}", 114 | "today": "{}" 115 | } 116 | }, 117 | "actions": { 118 | "on-click-right": "mode", 119 | "on-click-forward": "tz_up", 120 | "on-click-backward": "tz_down", 121 | "on-scroll-up": "tz_up", 122 | "on-scroll-down": "tz_down" 123 | }, 124 | "on-click": "swaymsg exec \\$calendar" 125 | }, 126 | "cpu": { 127 | "interval": 10, 128 | "format": " {usage}%", 129 | "states": { 130 | "warning": 70, 131 | "critical": 90 132 | }, 133 | "on-click": "swaymsg exec \\$once \\$term_float btop", 134 | "tooltip": true 135 | }, 136 | "disk": { 137 | "interval": 30, 138 | "format": " {percentage_used}%", 139 | "path": "/", 140 | "on-click": "swaymsg exec \\$once \\$term_float ranger", 141 | "on-click-middle": "swaymsg exec \\$once \\$term_float ncdu /" 142 | }, 143 | "idle_inhibitor": { 144 | "format": "{icon}", 145 | "format-icons": { 146 | "deactivated": "󰾪", 147 | "activated": "" 148 | }, 149 | "tooltip": true, 150 | "tooltip-format-activated": "power-saving disabled", 151 | "tooltip-format-deactivated": "power-saving enabled" 152 | }, 153 | "keyboard-state": { 154 | "numlock": true, 155 | "capslock": true, 156 | "format": { 157 | "numlock": " {icon}", 158 | "capslock": "󰪛 {icon}" 159 | }, 160 | "format-icons": { 161 | "locked": "", 162 | "unlocked": "" 163 | } 164 | }, 165 | "memory": { 166 | "interval": 180, 167 | "format": " {}%", 168 | "states": { 169 | "warning": 70, 170 | "critical": 90 171 | }, 172 | "on-click": "swaymsg exec \\$once \\$term_float htop", 173 | "tooltip": true 174 | }, 175 | "network": { 176 | "interval": 10, 177 | "format-wifi": "  {bandwidthDownBytes}", 178 | "format-ethernet": "󰈀  {bandwidthDownBytes}", 179 | "format-disconnected": "󰖪", 180 | "tooltip-format-ethernet": "{icon} {ifname}: {ipaddr}  {bandwidthDownBytes}  {bandwidthUpBytes}", 181 | "tooltip-format-wifi": "{icon} {ifname} ({essid}): {ipaddr}  {bandwidthDownBytes}  {bandwidthUpBytes}", 182 | "tooltip-format-disconnected": "{icon} disconnected", 183 | "tooltip-format-disabled": "{icon} disabled", 184 | "on-click": "swaymsg exec \\$once \\$term_float nmtui connect" 185 | }, 186 | "pulseaudio": { 187 | "scroll-step": 5, 188 | "format": "{icon} {volume}%{format_source}", 189 | "format-muted": "󰖁 {format_source}", 190 | "format-source": "", 191 | "format-source-muted": " 󰍭", 192 | "format-icons": { 193 | "headphone": "󰋋", 194 | "headset": "󰋎", 195 | "default": ["", "󰖀", "", "", "", ""] 196 | }, 197 | "tooltip-format": "{icon}  {volume}% {format_source}", 198 | "on-click": "swaymsg exec \\$pulseaudio", 199 | "on-click-middle": "swaymsg exec \\$volume_mute", 200 | "on-scroll-up": "swaymsg exec \\$volume_up", 201 | "on-scroll-down": "swaymsg exec \\$volume_down" 202 | }, 203 | "temperature": { 204 | "critical-threshold": 90, 205 | "interval": 60, 206 | "format": "{icon} {}°C", 207 | "tooltip-format": "{temperatureC}°C", 208 | "format-icons": ["", "", "", "", ""], 209 | "tooltip": true, 210 | "on-click": "swaymsg exec \"\\$once \\$term_float watch sensors\"" 211 | }, 212 | "tray": { 213 | "icon-size": 18, 214 | "spacing": 6 215 | }, 216 | "custom/menu": { 217 | "format": "", 218 | "on-click": "swaymsg exec \\$menu", 219 | "tooltip": false 220 | }, 221 | "custom/wf-recorder": { 222 | "interval": "once", 223 | "return-type": "json", 224 | "format": "{}", 225 | "tooltip-format": "{tooltip}", 226 | "exec": "echo '{\"class\": \"recording\",\"text\":\"󰑊\",\"tooltip\":\"press $mod+Esc to stop recording\"}'", 227 | "exec-if": "pgrep wf-recorder", 228 | "on-click": "killall -s SIGINT wf-recorder", 229 | "signal": 8 230 | }, 231 | "custom/pacman": { 232 | "format": "󰮯 {}", 233 | "interval": 5, 234 | "exec-if": "[ $(pacman -Qu | wc -l) -gt 0 ]", 235 | "exec": "pacman -Qu | wc -l", 236 | "on-click": "swaymsg exec \\$once \\$term_float 'sudo pacman -Syu'", 237 | "signal": 4 238 | }, 239 | "custom/github": { 240 | "interval": 3600, 241 | "tooltip": false, 242 | "return-type": "json", 243 | "format": " {}", 244 | "exec": "gh api '/notifications' -q '{ text: length }' | cat -", 245 | "exec-if": "[ -x \"$(command -v gh)\" ] && gh auth status 2>&1 | grep -q -m 1 'Logged in' && test $(gh api '/notifications' -q 'length') -ne 0", 246 | "on-click": "swaymsg exec \\$once \\$term_float gh dash", 247 | "on-click-middle": "xdg-open https://github.com/notifications && sleep 30 && pkill -RTMIN+4 waybar", 248 | "signal": 4 249 | }, 250 | "custom/playerctl": { 251 | "interval": "once", 252 | "tooltip": true, 253 | "return-type": "json", 254 | "format": "{icon}", 255 | "format-icons": { 256 | "Playing": "", 257 | "Paused": "" 258 | }, 259 | "exec": "playerctl metadata --format '{\"alt\": \"{{status}}\", \"tooltip\": \"{{playerName}}: {{markup_escape(title)}} - {{markup_escape(artist)}}\" }'", 260 | "on-click": "playerctl play-pause; pkill -RTMIN+5 waybar", 261 | "on-click-right": "playerctl next; pkill -RTMIN+5 waybar", 262 | "on-click-middle": "playerctl previous; pkill -RTMIN+5 waybar", 263 | "on-scroll-up": "playerctl position 10+; pkill -RTMIN+5 waybar", 264 | "on-scroll-down": "playerctl position 10-; pkill -RTMIN+5 waybar", 265 | "signal": 5 266 | }, 267 | "custom/dnd": { 268 | "interval": "once", 269 | "return-type": "json", 270 | "format": "{}{icon}", 271 | "format-icons": { 272 | "default": "", 273 | "dnd": "" 274 | }, 275 | "on-click": "makoctl mode | grep 'do-not-disturb' && makoctl mode -r do-not-disturb || makoctl mode -a do-not-disturb; pkill -RTMIN+11 waybar", 276 | "on-click-right": "makoctl restore", 277 | "exec": "printf '{\"alt\":\"%s\",\"tooltip\":\"mode: %s\"}' $(makoctl mode | grep -q 'do-not-disturb' && echo dnd || echo default) $(makoctl mode | tail -1)", 278 | "signal": 11 279 | }, 280 | "custom/clipboard": { 281 | "format": "", 282 | "interval": "once", 283 | "return-type": "json", 284 | "on-click": "swaymsg -q exec '$clipboard'; pkill -RTMIN+9 waybar", 285 | "on-click-right": "swaymsg -q exec '$clipboard-del'; pkill -RTMIN+9 waybar", 286 | "on-click-middle": "rm -f ~/.cache/cliphist/db; pkill -RTMIN+9 waybar", 287 | "exec": "printf '{\"tooltip\":\"%s\"}' $(cliphist list | wc -l)' item(s) in the clipboard\r(Mid click to clear)'", 288 | "exec-if": "[ -x \"$(command -v cliphist)\" ] && [ $(cliphist list | wc -l) -gt 0 ]", 289 | "signal": 9 290 | }, 291 | "custom/scratchpad": { 292 | "interval": "once", 293 | "return-type": "json", 294 | "format": "{icon}", 295 | "format-icons": { 296 | "one": "", 297 | "many": "" 298 | }, 299 | "exec": "$HOME/.config/sway/waybar/modules/scratchpad.sh", 300 | "on-click": "swaymsg 'scratchpad show'", 301 | "signal": 7 302 | }, 303 | "custom/zeit": { 304 | "return-type": "json", 305 | "interval": "once", 306 | "format": "{icon}", 307 | "format-icons": { 308 | "tracking": "󰖷", 309 | "stopped": "" 310 | }, 311 | "exec": "/bin/sh $HOME/.config/sway/waybar/modules/zeit.sh status", 312 | "on-click": "/bin/sh $HOME/.config/sway/waybar/modules/zeit.sh click; pkill -RTMIN+10 waybar", 313 | "exec-if": "[ -x \"$(command -v zeit)\" ]", 314 | "signal": 10 315 | }, 316 | "custom/sunset": { 317 | "interval": "once", 318 | "tooltip": true, 319 | "return-type": "json", 320 | "format": "{icon}", 321 | "format-icons": { 322 | "on": "", 323 | "off": "" 324 | }, 325 | "exec": "fallback_latitude=50.1 fallback_longitude=8.7 latitude= longitude= $HOME/.config/sway/waybar/modules/sunset.sh", 326 | "on-click": "$HOME/.config/sway/waybar/modules/sunset.sh toggle; pkill -RTMIN+6 waybar", 327 | "exec-if": "$HOME/.config/sway/waybar/modules/sunset.sh check", 328 | "signal": 6 329 | }, 330 | "custom/adaptive-light": { 331 | "interval": "once", 332 | "tooltip": true, 333 | "return-type": "json", 334 | "format": "{icon}", 335 | "format-icons": { 336 | "on": "󰃡", 337 | "off": "󰃠" 338 | }, 339 | "exec": "$HOME/.config/sway/waybar/modules/wluma.sh", 340 | "on-click": "$HOME/.config/sway/waybar/modules/wluma.sh toggle; pkill -RTMIN+12 waybar", 341 | "exec-if": "$HOME/.config/sway/waybar/modules/wluma.sh check", 342 | "signal": 12 343 | }, 344 | "custom/weather": { 345 | "format": "{}", 346 | "tooltip": true, 347 | "interval": 3600, 348 | "exec": "$HOME/.config/sway/waybar/modules/weather.sh" 349 | }, 350 | "custom/uptime": { 351 | "format": "{} ", 352 | "tooltip": true, 353 | "interval": 180, 354 | "exec": "$HOME/.config/sway/waybar/modules/uptime.sh" 355 | }, 356 | "custom/gpu": { 357 | "format": "{} ", 358 | "tooltip": true, 359 | "interval": 10, 360 | "exec": "$HOME/.config/sway/waybar/modules/gpu.sh" 361 | }, 362 | "custom/ping": { 363 | "format": " {}", 364 | "tooltip": true, 365 | "interval": 10, 366 | "exec": "$HOME/.config/sway/waybar/modules/ping.sh" 367 | } 368 | } 369 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------