313 lines
		
	
	
		
			8.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			313 lines
		
	
	
		
			8.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
// Global 
 | 
						|
{
 | 
						|
    "layer": "bottom",
 | 
						|
    "position": "top",
 | 
						|
    "margin-top": 3,
 | 
						|
    "margin-left": 3,
 | 
						|
    "margin-right": 3,
 | 
						|
    "margin-bottom": 3,
 | 
						|
 | 
						|
    // If height property would be not present, it'd be calculated dynamically
 | 
						|
    // "height": 60,
 | 
						|
 | 
						|
    "modules-left": [
 | 
						|
        "custom/launcher",
 | 
						|
        "niri/workspaces",
 | 
						|
        "niri/window",
 | 
						|
    ],
 | 
						|
 
 | 
						|
    "modules-right": [
 | 
						|
        "clock",
 | 
						|
        // "network",  // using network applet in tray
 | 
						|
        // "idle_inhibitor",
 | 
						|
        "custom/storage",
 | 
						|
        "memory",
 | 
						|
        "cpu",
 | 
						|
        "pulseaudio",
 | 
						|
        "custom/keyboard-layout",
 | 
						|
        "battery",
 | 
						|
        "backlight",
 | 
						|
        "custom/wlsunset",
 | 
						|
        "tray",
 | 
						|
        //"custom/weather",
 | 
						|
        "custom/power",
 | 
						|
    ],
 | 
						|
 | 
						|
    // Modules
 | 
						|
 | 
						|
    "idle_inhibitor": {
 | 
						|
        "format": "{icon} ",
 | 
						|
        "format-icons":{
 | 
						|
            "activated": "",
 | 
						|
            "deactivated": ""
 | 
						|
        }
 | 
						|
    },
 | 
						|
 | 
						|
    "battery": {
 | 
						|
        "states": {
 | 
						|
            // "good": 95,
 | 
						|
            "warning": 30,
 | 
						|
            "critical": 15
 | 
						|
        },
 | 
						|
        "format": "{icon}  {capacity}%",
 | 
						|
        "format-charging": "{capacity}% ",
 | 
						|
        "format-plugged": "{capacity}% ",
 | 
						|
        // "format-good": "", // An empty format will hide the module
 | 
						|
        // "format-full": "",
 | 
						|
        "format-icons": ["", "", "", "", ""]
 | 
						|
    },
 | 
						|
 | 
						|
    "clock": {
 | 
						|
        "interval": 1,
 | 
						|
        // "format-alt": " {:%e %b %Y}", // Icon: calendar-alt
 | 
						|
        "format": "{:%I:%M.%S %p}",
 | 
						|
        "tooltip-format": "{:%e %B %Y}"
 | 
						|
    },
 | 
						|
 | 
						|
    "cpu": {
 | 
						|
        "interval": 5,
 | 
						|
        "format": "  {usage}%", // Icon: microchip
 | 
						|
        "states": {
 | 
						|
            "warning": 70,
 | 
						|
            "critical": 90,
 | 
						|
        },
 | 
						|
        "on-click": "ghostty -e 'htop'",
 | 
						|
    },
 | 
						|
 | 
						|
    "memory": {
 | 
						|
        "interval": 5,
 | 
						|
        "format": "  {}%", // Icon: memory
 | 
						|
        "on-click": "ghostty -e 'htop'",
 | 
						|
        "states": {
 | 
						|
            "warning": 70,
 | 
						|
            "critical": 90
 | 
						|
        }
 | 
						|
    },
 | 
						|
 | 
						|
    "network": {
 | 
						|
        "interval": 5,
 | 
						|
        "format-wifi": "", // Icon: wifi
 | 
						|
        "format-ethernet": "  {ifname}: {ipaddr}/{cidr}", // Icon: ethernet
 | 
						|
        "format-disconnected": "⚠  Disconnected",
 | 
						|
        "tooltip-format": "{essid} - {ifname}:{ipaddr}  {bandwidthUpBytes} {bandwidthDownBytes}",
 | 
						|
        "on-click": "ghostty -e 'nmtui'",
 | 
						|
    },
 | 
						|
    "network#vpn": {
 | 
						|
        "interface": "tun0",
 | 
						|
        "format": "  {signalStrength}%",
 | 
						|
        "format-disconnected": "⚠  Disconnected",
 | 
						|
        "tooltip-format": "{essid} - {ifname}:{ipaddr}  {bandwidthUpBytes} {bandwidthDownBytes}",
 | 
						|
    },
 | 
						|
 | 
						|
    "niri/window": {
 | 
						|
        "format": "{title}",
 | 
						|
        "icon": true,
 | 
						|
        "icon-size": 24,
 | 
						|
        "rewrite": {
 | 
						|
            // Firefox
 | 
						|
            "(.*) — Mozilla Firefox": " $1",
 | 
						|
            "(.*) - Mozilla Firefox": " $1",
 | 
						|
            "Mozilla Firefox": " Firefox",
 | 
						|
 | 
						|
            // Chrome/Chromium
 | 
						|
            "(.*) - Google Chrome": " $1",
 | 
						|
            "(.*) - Chromium": " $1",
 | 
						|
            "Google Chrome": " Chrome",
 | 
						|
            "Chromium": " Chromium",
 | 
						|
 | 
						|
            // Terminal applications
 | 
						|
            "(.*) - zsh": " $1",
 | 
						|
            "(.*) - bash": " $1",
 | 
						|
            "(.*) - fish": " $1",
 | 
						|
            "ghostty": " Terminal",
 | 
						|
            "kitty": " Terminal",
 | 
						|
            "alacritty": " Terminal",
 | 
						|
            "ghostty": " Terminal",
 | 
						|
 | 
						|
            // Text editors and IDEs
 | 
						|
            "(.*) - Visual Studio Code": " $1",
 | 
						|
            "(.*) - Code": " $1",
 | 
						|
            "(.*) - Vim": " $1",
 | 
						|
            "(.*) - Neovim": " $1",
 | 
						|
            "(.*) - Emacs": " $1",
 | 
						|
            "Visual Studio Code": " VS Code",
 | 
						|
 | 
						|
            // File managers
 | 
						|
            "(.*)Nautilus": " Files: $1",
 | 
						|
            "Files": " Files",
 | 
						|
            "Thunar": " Files",
 | 
						|
            "Dolphin": " Files",
 | 
						|
 | 
						|
            // Communication apps
 | 
						|
            "Slack (.*)": " $1",
 | 
						|
            "Slack": " Slack",  
 | 
						|
            "Signal": " Signal",
 | 
						|
            "Discord": " Discord",
 | 
						|
            "Telegram": " Telegram",
 | 
						|
 | 
						|
            // Media and entertainment
 | 
						|
            "Spotify": " Spotify",
 | 
						|
            "Steam": " Steam",
 | 
						|
            "(.*) - YouTube": " $1",
 | 
						|
            "VLC media player": " VLC",
 | 
						|
 | 
						|
            // Development tools
 | 
						|
            "(.*) - GitHub": " $1",
 | 
						|
            "GitKraken": " GitKraken",
 | 
						|
            "Postman": " Postman",
 | 
						|
 | 
						|
            // System applications
 | 
						|
            "System Monitor": " System Monitor",
 | 
						|
            "Task Manager": " Task Manager",
 | 
						|
            "Settings": " Settings",
 | 
						|
            "Control Panel": " Settings",
 | 
						|
 | 
						|
            // Office applications
 | 
						|
            "(.*) - LibreOffice Writer": " $1",
 | 
						|
            "(.*) - LibreOffice Calc": " $1",
 | 
						|
            "(.*) - LibreOffice Impress": " $1",
 | 
						|
 | 
						|
            // Remove common suffixes that don't add value
 | 
						|
            "^(.*) - .*$": "$1",
 | 
						|
            "^(.*) | .*$": "$1",
 | 
						|
 | 
						|
            // Fallback for empty/unnamed windows
 | 
						|
            "^$": "Desktop"
 | 
						|
        }
 | 
						|
    },
 | 
						|
 | 
						|
    "niri/workspaces": {
 | 
						|
        "disable-click": false,
 | 
						|
        "disable-markup": false,
 | 
						|
        "all-outputs": true,
 | 
						|
        "format": "  {icon}  ",
 | 
						|
        "format-icons": {
 | 
						|
            "1": "",
 | 
						|
            "2": "",
 | 
						|
            "3": "",
 | 
						|
            "4": "",
 | 
						|
            "5": " 5",
 | 
						|
            "6": " 6",
 | 
						|
            "7": " 7",
 | 
						|
            "8": " 8",
 | 
						|
            "9": " 9",
 | 
						|
            "music": "",
 | 
						|
            "scratch": "",
 | 
						|
        }
 | 
						|
    },
 | 
						|
 | 
						|
    "pulseaudio": {
 | 
						|
        "scroll-step": 1, // %, can be a float
 | 
						|
        "format": "{icon}  {volume}%",
 | 
						|
        "format-bluetooth": "{volume}% {icon}  {format_source}",
 | 
						|
        "format-bluetooth-muted": " {icon}  {format_source}",
 | 
						|
        "format-muted": " {format_source}",
 | 
						|
        "format-source": "{volume}% ",
 | 
						|
        "format-source-muted": "",
 | 
						|
        "format-icons": {
 | 
						|
            "headphone": ["", "", "", "", ""],
 | 
						|
            "hands-free": "",
 | 
						|
            "headset": "",
 | 
						|
            "phone": "",
 | 
						|
            "portable": "",
 | 
						|
            "car": "",
 | 
						|
            "default": ["", "", ""]
 | 
						|
        },
 | 
						|
        "on-click": "pavucontrol",
 | 
						|
        "on-scroll-up": "pactl set-sink-volume @DEFAULT_SINK@ +2%",
 | 
						|
        "on-scroll-down": "pactl set-sink-volume @DEFAULT_SINK@ -2%",
 | 
						|
    },
 | 
						|
 | 
						|
    // "custom/temp": {
 | 
						|
    //     "exec": "notify-send \"temp thing\"",
 | 
						|
    //     "interval": "once",
 | 
						|
    //     "signal": 8,
 | 
						|
    // },
 | 
						|
 | 
						|
    "tray": {
 | 
						|
        "icon-size": 20,
 | 
						|
        "spacing":10,
 | 
						|
     },
 | 
						|
 | 
						|
    "backlight": {
 | 
						|
        "format": "{icon}  {percent}%",
 | 
						|
        "format-icons": ["", "", "", "", "", ""],
 | 
						|
        "on-scroll-down": "brightnessctl -c backlight set 1%-",
 | 
						|
        "on-scroll-up": "brightnessctl -c backlight set +1%",
 | 
						|
        "min-brightness": 1
 | 
						|
    },
 | 
						|
 | 
						|
    "custom/storage": {
 | 
						|
        "format": "{icon}  {percentage}%",
 | 
						|
        "format-icons": {
 | 
						|
          "default": "",
 | 
						|
          "warning": "",
 | 
						|
          "critical": "",
 | 
						|
        },
 | 
						|
        "exec": "usage=$(df / --output=pcent | tail -n1 | tr -d ' %'); if [ $usage -ge 90 ]; then class=\"critical\"; elif [ $usage -ge 75 ]; then class=\"warning\"; else class=\"default\"; fi; echo \"{\\\"percentage\\\":$usage,\\\"class\\\":\\\"$class\\\"}\"",
 | 
						|
        "return-type": "json",
 | 
						|
        "interval": 30,
 | 
						|
        "tooltip-format": "Root filesystem: {percentage}% used",
 | 
						|
    },
 | 
						|
 | 
						|
    "custom/signal": {
 | 
						|
        "format": "  ",
 | 
						|
        "on-click": "exec signal",
 | 
						|
        "tooltip": false,
 | 
						|
    },
 | 
						|
 | 
						|
    "custom/steam": {
 | 
						|
        "format": "  ",
 | 
						|
        "on-click": "exec steam",
 | 
						|
        "tooltip": false,
 | 
						|
    },
 | 
						|
 | 
						|
    "custom/spotify": {
 | 
						|
        "format": "  ",
 | 
						|
        "on-click": "exec flatpak run com.spotify.Client",
 | 
						|
        "tooltip": false,
 | 
						|
    },
 | 
						|
 | 
						|
    "custom/firefox": {
 | 
						|
        "format": "  ",
 | 
						|
        "on-click": "exec firefox",
 | 
						|
        "tooltip": false,
 | 
						|
    },
 | 
						|
 | 
						|
 | 
						|
    "custom/slack": {
 | 
						|
        "format": "  ",
 | 
						|
        "on-click": "slack",
 | 
						|
        "tooltip": false,
 | 
						|
        "exec if": "pgrep slack"
 | 
						|
    },
 | 
						|
 | 
						|
 | 
						|
   "custom/files": {
 | 
						|
        "format": "  ",
 | 
						|
        "on-click": "exec nautilus",
 | 
						|
        "tooltip": false,
 | 
						|
    },
 | 
						|
 | 
						|
    "custom/launcher": {
 | 
						|
        "format":" ",
 | 
						|
        "on-click": "exec wofi -c ~/.config/wofi/config --show=drun",
 | 
						|
        "tooltip": false,
 | 
						|
    },
 | 
						|
 | 
						|
    "custom/wlsunset": {
 | 
						|
        "format": "{}",
 | 
						|
        "exec": "~/.config/waybar/scripts/wlsunset-status.sh",
 | 
						|
        "on-click": "~/.config/waybar/scripts/wlsunset-toggle.sh",
 | 
						|
        "interval": "once",
 | 
						|
        "signal": 8,
 | 
						|
        "tooltip": false,
 | 
						|
    },
 | 
						|
 | 
						|
    "custom/power": {
 | 
						|
        "format":"⏻",
 | 
						|
        "on-click": "exec ~/.config/waybar/scripts/power-menu.sh",
 | 
						|
        "tooltip": false,
 | 
						|
    },
 | 
						|
}
 |