feat: Add wifi to status bar

This commit is contained in:
2026-02-16 17:21:24 +11:00
parent d2e3069d13
commit 09273a9c4d
6 changed files with 53 additions and 2 deletions

Binary file not shown.

View File

@@ -15,7 +15,8 @@
"bar.layouts": {
"0": {
"left": [
"media"
"media",
"custom/wifi"
],
"middle": [
"workspaces"
@@ -31,7 +32,8 @@
},
"1": {
"left": [
"media"
"media",
"custom/wifi"
],
"middle": [
"workspaces"

View File

@@ -1,2 +1,20 @@
{
"custom/wifi": {
"icon": "󰖩",
"label": "{status}",
"tooltip": "{status}",
"truncationSize": -1,
"execute": "/home/nathan/dotfiles/.config/hyprpanel/wifi.sh",
"executeOnAction": "",
"interval": 1000,
"hideOnEmpty": true,
"scrollThreshold": 1,
"actions": {
"onLeftClick": "",
"onRightClick": "",
"onMiddleClick": "",
"onScrollUp": "",
"onScrollDown": ""
}
}
}

View File

@@ -0,0 +1,18 @@
/* ##################################
* # Custom Wi-Fi Module Styling #
* ################################## */
@include styleModule(
// class name
'cmodule-wifi',
// styling properties
(
'text-color': #FFFFFF,
'icon-color': #FFFFFF,
'icon-background': #090909,
'label-background': #090909,
'inner-spacing': 0.5em,
'border-enabled': false,
'border-color': #FFFFFF,
'icon-size': 1.2em
)
);

10
.config/hyprpanel/wifi.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Get the current Wi-Fi network name
wifi_name=$(iwgetid -r)
# Output the Wi-Fi network name, or "Disconnected" if not connected
if [ -z "$wifi_name" ]; then
echo '{"status":"Disconnected"}'
else
echo "{\"status\":\"$wifi_name\"}"
fi