back to top
Menu Close

waybar modules file

this is the code used in my waybar modules file.

//* ----  https://github.com/JaKooLit  ---- *//

{
 // Modules configuration

"hyprland/workspaces": {
    "format": "{icon}",
    "on-click": "activate",
    "all-outputs": true,
    "sort-by-number": true,
    "format-icons": {
	"1": "1",
	"2": "2",
	"3": "3",
	"4": "4",
	"5": "5",
	"6": "6",
	"7": "7",
	"8": "8",
	"9": "9",
	"10": "10",
	"focused": "",
	"default": ""
    },
"persistent-workspaces": {
		"eDP-1": 4,
		"HDMI-A-1": 2,
	},   
	 
    "on-scroll-up": "hyprctl dispatch workspace e+1",
    "on-scroll-down": "hyprctl dispatch workspace e-1",
    },
    
"hyprland/window": {
        "format": "{}",
        "icon":true,
	"icon-size": 14
	},
	
"clock": {
    "tooltip-format": "{:%A, %d.%B %Y }\n{calendar}",
    //"format": " {:%a %d %b  %I:%M %p}",	//12 hour format
    "format": "{:%a %d %b %Y %H:%M}",	//24 hour format
    //"format-alt": " {:%d/%m/%Y  %H:%M:%S}",
    "timezones": [ "Europe/Amsterdam" ],
    //"max-length": 200
    "interval": 1,
    "on-click": "~/.config/waybar/scripts/OCV",
    },

"network": {
    //"interface": "wlp0s20f3", // (Optional) To force the use of this interface  "format-wifi": "  {essid}",
    "interface": "tun0",
    "format": " Disconnected",
    "format-wifi": " ",
    "format-ethernet": " {ifname} IP:{ipaddr}/{cidr}",
    "format-linked": "{ifname} (No IP)",
    "format-disconnected": " Disconnected",
    "family": "ipv4",
    "tooltip-format-wifi": "  {ifname} @ {essid}\nIP: {ipaddr}\nStrength: {signalStrength}%\nFreq: {frequency}MHz\nUp: {bandwidthUpBits} Down: {bandwidthDownBits}",
    "tooltip-format-ethernet": " {ifname}\nIP: {ipaddr}\n up:{bandwidthUpBytes} down:{bandwidthDownBytes}",
    //"min-length": 2,
    //"max-length": 2,
    "on-click": "nm-connection-editor"
    },

"custom/keyboard-layout": {
    "format": " Cheat", // Icon: keyboard
    "on-click": "~/.config/waybar/scripts/keyhint.sh",
    },

"custom/launcher": {
    "format":"",
    "on-click": "exec nwg-drawer -c 7 -is 70 -spacing 23",
    "tooltip": false,
    },

"custom/network_traffic": {
    "exec": "~/.config/waybar/scripts/network_traffic.sh",
    "return-type": "json",
    "format-ethernet": "{icon} {ifname} ⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",    // optional
    },

"wireplumber": {
    "format": "{icon} {volume} %",
    "format-muted": " Mute",
    "on-click": "~/.config/hypr/scripts/volume.sh --toggle",
    "on-click-right": "pavucontrol",
    "on-scroll-up": "~/.config/hypr/scripts/volume.sh --inc",
    "on-scroll-down": "~/.config/hypr/scripts/volume.sh --dec",
    "format-icons": ["", "", ""],
    },

// https://github.com/chubin/wttr.in
"custom/weather": {
    "exec": "curl 'https://wttr.in/Lelystad?format=2'",
    "interval": 900,
    "on-click": "yad --html --uri='https://wttr.in/Lelystad' --center --fixed --width=1000 --height=680 --timeout=60 --timeout-indicator=right"
    },

"lock-screen": {
    "format": "",
    "on-click": "brightnessctl -c backlight set 1% && swaylock && brightnessctl -c backlight set 100%",
    "tooltip": false,
    },

"custom/spacer": {
    "format": "•",
},

//* ---- expand / minimize ---- *//

"custom/expand": {
    "tooltip": false,
    "format": "",
    "icon-size": 32
},

"group/minimized": {
    "orientation": "horizontal",
    "modules": ["custom/expand", "tray"],
    "drawer": {
        "transition-duration": 500,
        "children-class": "minimized"
	}
    },

"tray": {
    "icon-size": 20
},

//* ---- custom wireguard - pronton vpn and network modules---- *//

"custom/wireguard": {
    "tooltip": false,
    "format": "",
    "icon-size": 32
},

"group/wireguard": {
    "orientation": "horizontal",
    "modules": ["network#wireguard", "custom/ip", "network#speed" ],
    "drawer": {
        "transition-duration": 500,
        "children-class": "minimized"
	}
    },
    
"network#wireguard": {
    "interface": "WG-BE-BE-12",
    "format": " Disconnected",
    "format-ethernet": "",
    "tooltip-format-ethernet": "VPN {ifname}\nIP:{ipaddr}/{cidr}\nup:{bandwidthUpBits} down:{bandwidthDownBits}",
    },

"custom/openvpn": {
    "interface": "",
    "format": " Disconnected",
    "format-ethernet": "",
    "tooltip-format-ethernet": "VPN {ifname}\nIP:{ipaddr}/{cidr}\nup:{bandwidthUpBits} down:{bandwidthDownBits}",
    },

"custom/ip": {
    "tooltip-format": "euhm",
    "interval": 7200,
    "exec": "curl -4 icanhazip.com",
    },

"network#speed": {
    "interval": 1,
    "format": "{ifname}",
    "format-wifi": "{icon}  {bandwidthUpBytes}  {bandwidthDownBytes}",
    "format-ethernet": "up:{bandwidthUpBytes} down:{bandwidthDownBytes}",
    "format-disconnected": "", 
    "tooltip-format": "{ipaddr}",
    "format-linked": " {ifname} (No IP)",
    "tooltip-format-wifi": "{essid} {icon} {signalStrength}%",
    "tooltip-format-ethernet": "{ifname} ",
    "tooltip-format-disconnected": " Disconnected",
    "max-length": 50,
    "format-icons": ["","","","",""]
    },

//* ---- custom / system - system monitor modules ---- *//

"custom/system": {
    "format": "",
    "icon-size": 32,
    "tooltip-format": "System monitor"
},

"group/system": {
    "orientation": "horizontal",
    "modules": ["custom/system", "custom/pacman", "temperature", "disk", "cpu", "memory", "battery", "pulseaudio" ],
    "drawer": {
        "transition-duration": 500,
        "children-class": "minimized"
	}
    },

"custom/pacman": {
    "format": "{} ",
    "interval": 7200,                     // every two hours
    "exec": "checkupdates | wc -l",       // # of updates
    //"exec": "i=$(checkupdates); echo \"$i\" |wc -l; echo \"$i\" |column -t |tr '\n' '\r'",       // # of updates and tooltip details
    "exec-if": "exit 0",                  // always run; consider advanced run conditions
    "on-click": "foot -e update", // update system
    "signal": 8
    },

"temperature": {
    "interval": 10,
    "tooltip": true,
    "thermal-zone": 1,  // Check with: # cat /sys/class/hwmon/hwmon*/temp1_input
    "hwmon-path": "/sys/class/hwmon/hwmon1/temp1_input",
    "critical-threshold": 80,
    "format-critical": "{temperatureC}°C ",
    "format": "{temperatureC}°C "
    },

"disk": {
    "interval": 30,
    //"format": "",
    "path": "/",
    //"format-alt-click": "click",
    "format": "{percentage_used}% ",
    //"tooltip": true,
    "tooltip-format": "{used} used out of {total} on {path} ({percentage_used}%)",
    },

"cpu": {
    "format": "{usage}% ",  
    "interval": 1,
    "format-alt-click": "click",
    "format-alt": "{icon0}{icon1}{icon2}{icon3} {usage:>2}% ",
    "format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"],
    "on-click": "foot -e htop"
    },

"memory": {
    "interval": 10,
    "format": "{used:0.1f}G ",
    "format-alt": "{percentage}% ",
    "format-alt-click": "click",
    "tooltip": true,
    "tooltip-format": "{used:0.1f}GB/{total:0.1f}G",
    "on-click": "foot -e htop"
    },

"battery": {
    //"interval": 5,
    "align": 0,
    "rotate": 0,
    //"bat": "BAT1",
    //"adapter": "ACAD",
    "full-at": 100,
    "design-capacity": false,
    "states": {
    "good": 95,
    "warning": 30,
    "critical": 15
	},
    "format": "{icon} {capacity}%",
    "format-charging": "{capacity}%",
    "format-plugged": " {capacity}%",
	"format-alt-click": "click",
    "format-full": "{icon} Full",
    "format-alt": "{icon} {time}",
    "format-icons": ["", "", "", "", "", "", "", "", "", "", ""],
    "format-time": "{H}h {M}min",
    "tooltip": true,
    "tooltip-format": "{timeTo} {power}w"
    },

"pulseaudio": {
    "format": "{icon} {volume} %",
    "format-muted": " Mute",
    "format-bluetooth": " {volume % {format_source}",
    "format-bluetooth-muted": " Mute",
    "format-icons": {
    "headphone": "",
    "hands-free": "",
    "headset": "",
    "phone": "",
    "portable": "",
    "car": "",
    "default": ["", "", ""],
    },
    "scroll-step": 5.0,
    "on-click": ".config/hypr/scripts/volume.sh --toggle",
    "on-click-right": "pavucontrol",
    "on-scroll-up": ".config/hypr/scripts/volume.sh --inc",
    "on-scroll-down": ".config/hypr/scripts/volume.sh --dec",
    "smooth-scrolling-threshold": 1,
    },

//* ---- custom / temp - sytem tray module ---- *//

"custom/temp": {
    "format": "",
    "tooltip-format": "test",
    "icon-size": 24
},

"group/temp": {
    "orientation": "horizontal",
    "modules": [ "custom/temp", "backlight","custom/lock_screen", "custom/power" ],
    "drawer": {
        "transition-duration": 500,
        "children-class": "minimized"
	}
    },

"backlight": {
    // "device": "acpi_video1",
    "interval": 2,
    "align": 0,
    "rotate": 0,
    //"format": "{icon} {percent}%",
    "format-icons": [" ", " ", " ", " ", " ", " ", " "],
    "format": "{icon}",
    //"format-icons": ["","","","","","","","","","","","","","",""],
    "tooltip-format": "backlight {percent}%",
    "icon-size": 10,
    "on-click": "",
    "on-click-middle": "",
    "on-click-right": "",
    "on-update": "",
    "on-scroll-down": "brightnessctl -c backlight set 1%-",
    "on-scroll-up": "brightnessctl -c backlight set +1%",
    "on-click": "~/.config/waybar/scripts/backlight-hint.sh"
    },

"custom/lock_screen": {
    "format": "",
    "on-click": ".config/hypr/scripts/volume.sh --toggle && sleep 1 && brightnessctl -c backlight set 1% && sleep 1 && swaylock && sleep 1 && brightnessctl -c backlight set 100% && sleep 1 && .config/hypr/scripts/volume.sh --toggle",
    "tooltip": false,
    "icon-size": 24
    },

"custom/power": {
    "format":"⏻",
    "on-click": "nwgbar",
    "tooltip": false,
   },
   
//* ----  https://github.com/JaKooLit  ---- *//

"custom/network": {
    "format": "",
    "tooltip": false,
    "icon-size": 24,
},

//* ---- custom /sw - software shortcuts ---- *//
"custom/sw": {
    "tooltip": false,
    "format": "",
    "icon-size": 24
},

"group/sw": {
    "orientation": "horizontal",
    "modules": [ "custom/sw", "custom/kpntv", "custom/firefox", "custom/thunar", "custom/geany", "custom/deluge", "custom/thunderbird" ],
    "drawer": {
        "transition-duration": 500,
        "children-class": "minimized"
	}
    },
        
"custom/kpntv": {
    "tooltip": false,
    "format": "",
    "icon-size": 24,
    "on-click": "firedragon https://tv.kpn.com/nu-op-tv", 
    },
    
"custom/firefox": {
    "tooltip": false,
    "format": "",
    "icon-size": 24,
    "on-click": "firefox-esr", 
    },

"custom/thunar": {
    "tooltip": false,
    "format": "",
    "icon-size": 24,
    "on-click": "thunar", 
    },

"custom/geany": {
    "format": "",
    "tooltip-format": "Text editor",
    "icon-size": 24,
    "on-click": "geany", 
    //"tooltip": true,//
    },

"custom/deluge": {
    "format": "",
    "tooltip-format": "Deluge",
    "icon-size": 24,
    "on-click": "deluge", 
    },

"custom/thunderbird": {
    "format": "",
    "tooltip-format": "thunderbird",
    "icon-size": 24,
    "on-click": "thunderbird",
    },

//* ---- custom / testing - test modules ---- *//

"custom/externalip": {
        "format": "{}",
        "format-alt": "{source .config/waybar/scripts/external-ip.sh}",
        "return-type": "json",
        "exec": ".config/waybar/scripts/external-ip.sh",
        "interval": 7200,
        "tooltip": true,
    },
    

}

}

Leave a Reply

Your email address will not be published. Required fields are marked *