feat: Waybar

This commit is contained in:
2025-12-19 22:14:03 -08:00
parent acd842c2aa
commit e2da3d9a20
3 changed files with 17 additions and 134 deletions

View File

@@ -1,5 +1,6 @@
#font 'JetBrainsMono NF' 9 #font 'JetBrainsMono NF' 9
font 'JetBrainsMono Nerd Font Mono' 9 #font 'JetBrainsMono Nerd Font Mono' 9
font 'JetBrainsMonoNFM-Regular' 9
### Variables ### Variables
#set $mod Mod1 #set $mod Mod1

View File

@@ -1,65 +1,24 @@
// -*- mode: jsonc -*- // -*- mode: jsonc -*-
{ {
// "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
//"height": 10, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
"spacing": 2, // Gaps between modules (4px) "spacing": 2, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": [ "modules-left": [
"sway/workspaces", "sway/workspaces",
"sway/mode", "sway/mode",
"sway/scratchpad", "sway/scratchpad",
"custom/media",
"sway/window" "sway/window"
], ],
//"modules-center": [ //"modules-center": [
//"sway/window" //"sway/window"
//], //],
"modules-right": [ "modules-right": [
"mpd", //"mpd",
//"custom/audio_idle_inhibitor",
"pulseaudio", "pulseaudio",
"network", //"network",
//"power-profiles-daemon",
//"cpu",
//"memory",
//"temperature",
//"backlight",
//"keyboard-state",
//"sway/language",
"battery", "battery",
//"battery#bat2",
"clock", "clock",
"tray" "tray"
//"custom/power" //"custom/power"
], ],
// Modules configuration
// "sway/workspaces": {
// "disable-scroll": true,
// "all-outputs": true,
// "warp-on-scroll": false,
// "format": "{name}: {icon}",
// "format-icons": {
// "1": "",
// "2": "",
// "3": "",
// "4": "",
// "5": "",
// "urgent": "",
// "focused": "",
// "default": ""
// }
// },
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{name} {icon}",
"format-icons": {
"locked": "",
"unlocked": ""
}
},
"sway/mode": { "sway/mode": {
"format": "<span style=\"italic\">{}</span>" "format": "<span style=\"italic\">{}</span>"
}, },
@@ -70,42 +29,6 @@
"tooltip": true, "tooltip": true,
"tooltip-format": "{app}: {title}" "tooltip-format": "{app}: {title}"
}, },
"mpd": {
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {title} ⸨{songPosition}|{queueLength}⸩% ",
"format-alt": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩% ",
"format-disconnected": "Disconnected ",
//"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
"format-stopped": "",
//"unknown-tag": "N/A",
"unknown-tag": "",
"interval": 5,
"consume-icons": {
"on": " "
},
"random-icons": {
"off": "<span color=\"#f53c3c\"></span> ",
"on": " "
},
"repeat-icons": {
"on": " "
},
"single-icons": {
"on": "1 "
},
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": { "tray": {
// "icon-size": 21, // "icon-size": 21,
"spacing": 10, "spacing": 10,
@@ -121,26 +44,6 @@
//"format": "{:%R %p %Y-%m-%d}", //"format": "{:%R %p %Y-%m-%d}",
//"format-alt": "{:%Y-%m-%d}" //"format-alt": "{:%Y-%m-%d}"
}, },
"cpu": {
"format": "{usage}% ",
"tooltip": false
},
"memory": {
"format": "{}% "
},
"temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C {icon}",
"format-icons": ["", "", ""]
},
"backlight": {
// "device": "acpi_video1",
"format": "{percent}% {icon}",
"format-icons": ["", "", "", "", "", "", "", "", ""]
},
"battery": { "battery": {
"states": { "states": {
// "good": 95, // "good": 95,
@@ -172,18 +75,19 @@
}, },
"network": { "network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface // "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "{essid} ({signalStrength}%) ", //"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ipaddr}/{cidr} ", //"format-ethernet": "{ipaddr}/{cidr} ",
"tooltip-format": "{ifname} via {gwaddr} ", //"tooltip-format": "{ifname} via {gwaddr} ",
"format-linked": "{ifname} (No IP) ", //"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠", //"format-disconnected": "Disconnected ⚠",
"format-disconnected": "Disconnected",
"format-alt": "{ifname}: {ipaddr}/{cidr}" "format-alt": "{ifname}: {ipaddr}/{cidr}"
}, },
"pulseaudio": { "pulseaudio": {
// "scroll-step": 1, // %, can be a float // "scroll-step": 1, // %, can be a float
"format": "{volume}% {icon} {format_source}", "format": "{volume}% {icon} {format_source}",
"format-bluetooth": "{volume}% {icon}  {format_source}", "format-bluetooth": "{volume}% {icon}  {format_source}",
"format-bluetooth-muted": " {icon}  {format_source}", "format-bluetooth-muted": " {icon}  {format_source}",
"format-muted": " {format_source}", "format-muted": " {format_source}",
"format-source": "{volume}% ", "format-source": "{volume}% ",
"format-source-muted": "", "format-source-muted": "",
@@ -209,29 +113,5 @@
"escape": true, "escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
}, }
"custom/power": {
"format" : "⏻ ",
"tooltip": false,
"menu": "on-click",
"menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder
"menu-actions": {
"shutdown": "shutdown",
"reboot": "reboot",
"suspend": "systemctl suspend",
"hibernate": "systemctl hibernate"
}
},
"custom/audio_idle_inhibitor": {
"format": "{icon} ",
"exec": "sway-audio-idle-inhibit --dry-print-both-waybar",
"exec-if": "which sway-audio-idle-inhibit",
"return-type": "json",
"format-icons": {
"output": "",
"input": "",
"output-input": " ",
"none": ""
}
}
} }

View File

@@ -1,8 +1,10 @@
* { * {
/* `otf-font-awesome` is required to be installed for icons */ /* `otf-font-awesome` is required to be installed for icons */
/*font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif; */ /*font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif; */
font-family: "JetBrainsMono NF"; /*font-family: "JetBrainsMono NF";*/
font-size: 13px; font-family: "JetBrainsMonoNFM-Regular";
font-size: 14px;
font-weight: bold;
} }
window#waybar { window#waybar {