Add sway stuff

This commit is contained in:
2025-09-27 01:49:16 +04:00
parent 4dc5660e60
commit 972ba6c251
7 changed files with 1415 additions and 0 deletions

367
config/waybar/config.jsonc Normal file
View File

@@ -0,0 +1,367 @@
// =============================================================================
//
// Waybar configuration
//
// Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration
//
// =============================================================================
{
// -------------------------------------------------------------------------
// Global configuration
// -------------------------------------------------------------------------
"layer": "top",
// If height property would be not present, it'd be calculated dynamically
"height": 24,
"position": "bottom",
"modules-left": [
// "custom/menu",
"sway/workspaces",
"custom/scratchpad"
],
"modules-center": [
"custom/wf-recorder",
"sway/mode",
"custom/weather"
],
"modules-right": [
"custom/taskwarrior",
// informational
"sway/language",
"custom/clipboard",
"cpu",
"temperature",
"memory",
"battery",
// connecting
"network",
"bluetooth",
"custom/valent",
// media
"custom/playerctl",
"custom/idle_inhibitor",
"custom/dnd",
"pulseaudio",
"backlight",
// system
"custom/theme",
"custom/adaptive-light",
"custom/sunset",
"tray",
"clock"
],
// -------------------------------------------------------------------------
// Modules
// -------------------------------------------------------------------------
"battery": {
"interval": 30,
"states": {
"warning": 30,
"critical": 15
},
"format-charging": "󰂄 {capacity}%",
"format": "{icon} {capacity}%",
"format-icons": [
"󱃍",
"󰁺",
"󰁼",
"󰁽",
"󰁾",
"󰁿",
"󰂀",
"󰂁",
"󰂂",
"󰁹"
],
"tooltip": true
},
"clock": {
"interval": 60,
"format": "{:%e %b %H:%M}",
"tooltip": true,
"tooltip-format": "<big>{:%B %Y}</big>\n<tt>{calendar}</tt>",
"on-click": "swaymsg exec \\$calendar"
},
"cpu": {
"interval": 5,
"format": "cpu {usage}% {avg_frequency}GHz",
"states": {
"warning": 70,
"critical": 90
},
"on-click": "swaymsg exec \\$task_manager",
"tooltip": true
},
"memory": {
"interval": 10,
"format": "ram {}%",
"states": {
"warning": 70,
"critical": 90
},
"on-click": "swaymsg exec \\$task_manager",
"tooltip": true
},
"network": {
"interval": 5,
"format-wifi": "{icon}",
"format-ethernet": "󰈀",
"format-disconnected": "󰖪",
"format-disabled": "󰀝",
"format-icons": [
"󰤯",
"󰤟",
"󰤢",
"󰤥",
"󰤨"
],
"tooltip-format": "{icon} {ifname}: {ipaddr}",
"tooltip-format-ethernet": "{icon} {ifname}: {ipaddr}",
"tooltip-format-wifi": "{icon} {ifname} ({essid}): {ipaddr}",
"tooltip-format-disconnected": "{icon} disconnected",
"tooltip-format-disabled": "{icon} disabled",
"on-click": "swaymsg exec \\$once \\$term_float nmtui connect"
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>",
"tooltip": false
},
"sway/workspaces": {
"active-only": false,
"all-outputs": false,
"disable-scroll": true,
},
"backlight": {
"format": "{icon} {percent}%",
"format-icons": [
"󰃞",
"󰃟",
"󰃠"
],
"on-scroll-up": "swaymsg exec \\$brightness_up",
"on-scroll-down": "swaymsg exec \\$brightness_down"
},
"pulseaudio": {
"scroll-step": 5,
"format": "{icon} {volume}%{format_source}",
"format-muted": "󰖁 {format_source}",
"format-source": "",
"format-source-muted": " 󰍭",
"format-icons": {
"headphone": "󰋋",
"headset": "󰋎",
"default": [
"󰕿",
"󰖀",
"󰕾"
]
},
"tooltip-format": "{icon} {volume}% {format_source}",
"on-click": "swaymsg exec \\$pulseaudio",
"on-click-middle": "swaymsg exec \\$volume_mute",
"on-scroll-up": "swaymsg exec \\$volume_up",
"on-scroll-down": "swaymsg exec \\$volume_down"
},
"temperature": {
"critical-threshold": 90,
"interval": 5,
"format": "{icon}",
"tooltip-format": "{temperatureC}°C",
"format-icons": [
"",
"",
""
],
"tooltip": true,
"on-click": "swaymsg exec \"\\$once \\$term_float watch sensors\""
},
"tray": {
"icon-size": 14,
"spacing": 5
},
// "custom/pacman": {
// "format": "󰀼 {}",
// "interval": 3600,
// "return-type": "json",
// "exec-if": "$HOME/.local/share/sway/scripts/checkupdates.sh check",
// "exec": "$HOME/.local/share/sway/scripts/checkupdates.sh status",
// "on-click": "$HOME/.local/share/sway/scripts/checkupdates.sh check && swaymsg exec \\$update_manager",
// "on-click-middle": "waybar-signal pacman",
// "signal": 14
// },
// "custom/menu": {
// "format": "",
// "on-click": "swaymsg exec \\$menu",
// "tooltip": false
// },
"bluetooth": {
"format": "󰂯",
"format-disabled": "󰂲",
// "on-click": "swaymsg exec \\$bluetooth",
"on-click": "blueman-manager",
"on-click-right": "rfkill toggle bluetooth",
"tooltip-format": "{}"
},
"sway/language": {
"format": " {}",
"min-length": 5,
"tooltip": false,
"on-click": "swaymsg input type:keyboard xkb_switch_layout next"
},
"custom/scratchpad": {
"interval": "once",
"return-type": "json",
"format": "{icon}",
"format-icons": {
"one": "󰖯",
"many": "󰖲"
},
"exec": "/bin/sh $HOME/.local/share/sway/scripts/scratchpad.sh",
"on-click": "swaymsg 'scratchpad show'",
"signal": 7
},
"custom/sunset": {
"interval": "once",
"tooltip": true,
"return-type": "json",
"format": "{icon}",
"format-icons": {
"on": "󰌵",
"off": "󰌶"
},
"exec": "fallback_latitude=50.1 fallback_longitude=8.7 latitude= longitude= $HOME/.local/share/sway/scripts/sunset.sh",
"on-click": "$HOME/.local/share/sway/scripts/sunset.sh toggle",
"exec-if": "$HOME/.local/share/sway/scripts/sunset.sh check",
"signal": 6
},
"custom/theme": {
"format": "{icon}",
"interval": 300,
"tooltip": true,
"format-icons": {
"light": "",
"dark": "",
"auto_light": "󱩷",
"auto_dark": "󱩸"
},
"return-type": "json",
"exec-if": "$HOME/.local/share/sway/scripts/theme-toggle.sh check",
"exec": "$HOME/.local/share/sway/scripts/theme-toggle.sh status",
"on-click": "$HOME/.local/share/sway/scripts/theme-toggle.sh toggle",
"on-click-right": "$HOME/.local/share/sway/scripts/theme-toggle.sh auto-toggle",
"signal": 17
},
"custom/wf-recorder": {
"interval": "once",
"return-type": "json",
"format": "{}",
"exec": "echo '{\"class\": \"recording\",\"text\":\"󰑊\",\"tooltip\":\"press $mod+Esc to stop recording\"}'",
"exec-if": "pgrep wf-recorder",
"on-click": "waybar-signal recorder",
"signal": 8
},
"custom/playerctl": {
"interval": "once",
"tooltip": true,
"return-type": "json",
"format": "{icon}",
"format-icons": {
"Playing": "󰏦",
"Paused": "󰐍"
},
"exec": "playerctl metadata --format '{\"alt\": \"{{status}}\", \"tooltip\": \"{{playerName}}: {{markup_escape(title)}} - {{markup_escape(artist)}}\" }'",
"on-click": "playerctl play-pause",
"on-click-right": "playerctl next",
"on-scroll-up": "playerctl position 10+",
"on-scroll-down": "playerctl position 10-",
"signal": 5
},
"custom/clipboard": {
"format": "󰨸",
"interval": "once",
"return-type": "json",
"on-click": "swaymsg -q exec '$clipboard'; waybar-signal clipboard",
"on-click-right": "swaymsg -q exec '$clipboard-del'; waybar-signal clipboard",
"on-click-middle": "rm -f ~/.cache/cliphist/db; waybar-signal clipboard",
"exec": "printf '{\"tooltip\":\"%s\"}' $(cliphist list | wc -l)' item(s) in the clipboard\r(Mid click to clear)'",
"exec-if": "[ -x \"$(command -v cliphist)\" ] && [ $(cliphist list | wc -l) -gt 0 ]",
"signal": 9
},
"custom/taskwarrior": {
"format": "{text}",
"tooltip": false,
"interval": 2,
"exec": "taskwarrior_active",
"return-type": "json",
"on-click": "taskwarrior_start",
"on-click-right": "taskwarrior_stop",
},
"custom/weather": {
"format": "{}",
"tooltip": true,
"interval": 3600,
// accepts -c/--city <city> -t/--temperature <C/F> -d/--distance <km/miles>
"exec": "$HOME/.local/share/sway/scripts/weather.py",
"return-type": "json",
"on-click": "xdg-open \"https://wttr.in/$(curl -s https://manjaro-sway.download/geoip | jq -r '.city')\"",
"on-click-right": "waybar-signal weather",
"signal": 16
},
"custom/dnd": {
"interval": "once",
"return-type": "json",
"format": "{}{icon}",
"format-icons": {
"default": "󰚢",
"dnd": "󰚣"
},
"on-click": "$HOME/.local/share/sway/scripts/dnd.sh toggle; waybar-signal dnd",
"on-click-right": "$HOME/.local/share/sway/scripts/dnd.sh restore",
"exec": "$HOME/.local/share/sway/scripts/dnd.sh status",
"signal": 11
},
"custom/adaptive-light": {
"interval": "once",
"tooltip": true,
"return-type": "json",
"format": "{icon}",
"format-icons": {
"on": "󰃡",
"off": "󰃠"
},
"exec": "$HOME/.local/share/sway/scripts/wluma.sh",
"on-click": "$HOME/.local/share/sway/scripts/wluma.sh toggle",
"exec-if": "$HOME/.local/share/sway/scripts/wluma.sh check",
"signal": 12
},
"custom/valent": {
"format": "{icon}",
"tooltip": true,
"interval": 60,
"exec": "$HOME/.local/share/sway/scripts/valent.py",
"exec-if": "[ -x \"$(command -v valent)\" ]",
"return-type": "json",
"format-icons": {
"no-devices": "",
"dangerously-empty": "󰂃",
"no-signal": "󰞃",
"connected": "",
"disconnected": ""
},
"on-click": "valent",
"on-click-middle": "waybar-signal valent",
"signal": 13
},
"custom/idle_inhibitor": {
"interval": 60,
"return-type": "json",
"format": "{icon}",
"format-icons": {
"on": "󰒳",
"off": "󰒲"
},
"exec": "inhibit-idle",
"on-click": "inhibit-idle off; inhibit-idle interactive",
"on-click-middle": "inhibit-idle off",
"signal": 15
}
}