why won't you work waybar?

This commit is contained in:
Zonsopkomst 2023-02-09 17:12:48 -06:00
parent cccb7ae7f4
commit 8b6c164d9f
3 changed files with 340 additions and 165 deletions

View File

@ -1,167 +1,200 @@
#Waybar Config Sample
{
// "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 30, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
"spacing": 4, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad", "custom/media"],
"modules-center": ["sway/window"],
"modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "keyboard-state", "sway/language", "battery", "battery#bat2", "clock", "tray"],
// Modules configuration
// "sway/workspaces": {
// "disable-scroll": true,
// "all-outputs": true,
// "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": ""
// "layer": "top", // Waybar at top layer
// "position": "top", // Waybar position (top|bottom|left|right)
// "height": 30, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
// Choose the order of the modules
"modules-left": [
"custom/disk_home",
"custom/disk_root",
"sway/workspaces",
"sway/mode"
],
"modules-center": [
"clock#1",
// "clock#2",
"custom/jalalidate"
],
"modules-right": [
"custom/weather",
// "temperature",
"cpu",
// "memory",
"network",
"backlight",
"pulseaudio",
"battery",
"custom/wkblayout",
"idle_inhibitor",
"tray"],
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true,
"format": "{name}",
"format-icons": {
"urgent": "<span color='#e85c5c'></span>",
"focused": "<span color='#8af0f0'></span>",
"default": "<span color='#b8b8b8'></span>"
}
},
"sway/mode": {
"format": "{}"
},
"backlight": {
// "device": "acpi_video1",
"format": "{icon} {percent}%",
"format-icons": ["🔅", "🔆"]
},
"battery": {
"states": {
// "good": 95,
"warning": 20,
"critical": 10
},
"format": "<span color='#e88939'>{icon}</span> {capacity}%",
"format-charging": "<span color='#e88939'> </span> {capacity}% ({time})",
"format-plugged": "<span color='#e88939'>{icon}  </span> {capacity}%",
// "format-good": "", // An empty format will hide the module
"format-discharging": "<span color='#e88939'>{icon}</span> {capacity}% ({time})",
"format-icons": ["", "", "", "", ""]
},
"clock#1": {
"interval": 60,
"format": "<span color='#cde9f0'> {:%H:%M %F} </span>",
"tooltip-format": "{:%Y-%m-%d | %H:%M:%S}"
// "format-alt": "{:%Y-%m-%d}"
},
"clock#2": {
"interval": 18000,
"format": "{:%F} 📅",
"tooltip-format": "{:%Y-%m-%d | %H:%M:%S}"
// "format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"interval": 5,
"format": "<span color='#eb8a60'> {usage}% ({load})</span>", // Icon: microchip
"states": {
"warning": 70,
"critical": 90
}
},
/*
"cpu": {
"format": "🏭 {usage}%",
"tooltip": false
},
*/
"idle_inhibitor": {
"format": "<span color='#589df6'>{icon}</span>",
"format-icons": {
"activated": "",
"deactivated": ""
},
"on-click-right": "swaylock -eFfki ~/Pictures/lockscreen.jpeg"
},
/*
"memory": {
"format": "💾 {used:0.1f}G",
"tooltip": false
},
*/
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "<span color='#589df6'></span> <span color='gray'>{signalStrength}%</span>" ,
"format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": " ",
"format-alt": "<span color='gray'>{essid}</span> <span color='green'>⬇</span>{bandwidthDownBits} <span color='green'>⬆</span>{bandwidthUpBits}",
"interval": 60,
"tooltip-format": "{ifname}  {ipaddr}"
},
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{icon} {volume}% {format_source}",
"format-muted": "🔇 {format_source}",
"format-bluetooth": "{icon} {volume}% {format_source}",
"format-bluetooth-muted": "🔇 {format_source}",
"format-source": " {volume}%",
"format-source-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["🔈", "🔉", "🔊"]
},
"on-click": "ponymix -N -t sink toggle",
"on-click-right": "ponymix -N -t source toggle"
},
/*
"temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "<span color='#e88939'>{icon}</span> {temperatureC}°C",
"format-icons": ["", "", ""],
"tooltip": false
},
*/
"tray": {
"icon-size": 18,
"spacing": 5
},
"custom/disk_home": {
"format": "<span color='#11eec2'> {} </span>",
"interval": 3600,
"exec": "df -h --output=avail $HOME | tail -1 | tr -d ' '",
"tooltip": "false"
},
"custom/disk_root": {
"format": "<span color='#a1b5e9'> {} </span>",
"interval": 3600,
"exec": "df -h --output=avail / | tail -1 | tr -d ' '",
"tooltip": "false"
},
// Persian calendar
"custom/jalalidate": {
"format": "<span color='#cde9f0'>{}</span>",
"interval": 18000,
// "exec": "sb-jalalidate"
"exec": "pcal -t",
"tooltip": "false"
},
"custom/weather": {
"format": "<span color='#22dfda'>{}</span>",
"interval": 18000,
"exec": "sb-forecast",
//ansiweather -l shiraz,IR -u metric -s true -f 1 -a false | cut -d' ' -f2,8-
"exec-if": "ping openweathermap.org -c1",
"tooltip": "false"
},
"custom/wkblayout": {
"format": "<span color='#11eec2'>🖋</span> {}",
"exec": "swaymsg -mrt subscribe '[\"input\"]' | jq -r --unbuffered \"select(.change == \\\"xkb_layout\\\") | .input | select(.type == \\\"keyboard\\\") | .xkb_active_layout_name | .[0:2]\"",
"tooltip": "false"
}
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"sway/scratchpad": {
"format": "{icon} {count}",
"show-empty": false,
"format-icons": ["", ""],
"tooltip": true,
"tooltip-format": "{app}: {title}"
},
"mpd": {
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ",
"format-disconnected": "Disconnected ",
"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
"unknown-tag": "N/A",
"interval": 2,
"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": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
// "timezone": "America/New_York",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"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": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ipaddr}/{cidr} ",
"tooltip-format": "{ifname} via {gwaddr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
},
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{volume}% {icon} {format_source}",
"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"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"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
}
}
}

141
config/waybar/style.css Normal file
View File

@ -0,0 +1,141 @@
* {
border: none;
background: rgba(28, 28, 28, 0.6);
border-radius: 0;
font-family: "monospace";
font-size: 15;
min-height: 0;
}
#waybar {
/* background: rgba(48,48,59, 0);*/
color: #ffffff;
}
#window {
color: #e4e4e4;
font-weight: bold;
}
#workspaces {
font-size: 8px;
/* padding: 0 2px;*/
margin-left: 8px;
margin-right: 8px;
padding-left: 0px;
padding-right: 0px;
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
background: rgba(28, 28, 28, 0.8);
}
#workspaces button {
padding: 0 5px;
/* background: rgba(28, 28, 28, 0.9);*/
color: #b8b8b8;
/* margin: 0 1px;*/
}
#workspaces button:hover {
box-shadow: inherit;
text-shadow: inherit;
}
#workspaces button.focused {
padding: 0 5px;
border-radius: 10;
/* background: #00afd7;*/
color: #8af0f0;
margin: 0 0px;
}
#workspaces button.urgent {
background: #af005f;
color: #1b1d1e;
}
#mode {
background: #af005f;
}
#clock, #custom-jalalidate, #custom-weather, #custom-disk_home, #custom-disk_root,#custom-wkblayout, #temperature, #cpu, #memory, #network, #backlight, #pulseaudio, #battery, #tray, #idle_inhibitor {
padding: 0 3px;
/* background-color: #000000; */
background: rgba(28, 28, 28, 0.8);
/* margin: 0 2px;*/
}
#clock {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}
#custom-disk_root {
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
#custom-weather {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}
#custom-jalalidate {
margin-right: 8px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
#battery {
}
#battery icon {
color: red;
}
#battery.charging {
}
@keyframes blink {
to {
background-color: #af005f;
}
}
#battery.warning:not(.charging) {
background-color: #ff8700;
color: #1b1d1e;
}
#battery.critical:not(.charging) {
color: white;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#cpu {
}
#memory {
}
#network {
}
#network.disconnected {
background: #f53c3c;
}
#pulseaudio {
}
#pulseaudio.muted {
}
#tray {
margin-left: 1px;
}

View File

@ -8,6 +8,7 @@
dconf2nix
dunst
#eww
grim
hyprpaper
kitty
ranger