refactor(waybar): change style

This commit is contained in:
Price Hiller 2022-08-07 19:15:30 -05:00
parent e532faa6ec
commit 63dc3dada0
4 changed files with 288 additions and 262 deletions

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
main() {
if pidof waybar >/dev/null 2>&1; then
killall waybar
fi
waybar &
}
main

View File

@ -1,79 +1,156 @@
{ {
"layer": "top", "layer": "top",
"modules-left": ["custom/launcher","cpu","memory","custom/media","tray"], "position": "top",
"modules-center": ["river/tags"], "modules-left": [
"modules-right": ["custom/updates","custom/wallpaper","backlight","pulseaudio","clock", "battery","custom/power"], "idle_inhibitor",
"cpu",
"pulseaudio": { "temperature",
"tooltip": false, "memory",
"scroll-step": 5, "battery",
"format": "{icon} {volume}%", "disk",
"format-muted": "{icon} {volume}%", "pulseaudio",
"on-click":"pactl set-sink-mute @DEFAULT_SINK@ toggle", "custom/cap-left"
"format-icons": { ],
"default": ["", "", ""] "modules-center": [
} "sway/workspaces"
}, ],
"modules-right": [
"river/tags": { "custom/cap-right",
"num-tags": 6 "custom/weather",
"network",
"clock",
"custom/offswitch"
],
"sway/window": {},
"custom/weather": {
"tooltip": false,
"min-length": 5,
"exec": "curl 'https://wttr.in/Melbourne?m&format='%t''",
"interval": 3600
}, },
"network": {
"tooltip": false,
"format-wifi": " {essid}",
"format-ethernet": ""
},
"backlight": {
"tooltip": false,
"format": " {}%",
"interval":1,
"on-scroll-up": "light -A 5",
"on-scroll-down": "light -U 5"
},
"battery": { "battery": {
"min-length": 5,
"states": { "states": {
"good": 95, "full": 90,
"warning": 30, "warning": 30,
"critical": 20 "critical": 15
}, },
"format": "{icon} {capacity}%", "tooltip": false,
"format-charging": " {capacity}%", "full-at": 95,
"format-plugged": " {capacity}%", "format-plugged": "{icon} {capacity}%",
"format-alt": "{time} {icon}", "format-charging": "{icon} {capacity}%",
"format-icons": ["", "", "", "", ""] "format": "{icon} {capacity}%",
"format-icons": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
}, },
"tray":{
"icon-size":18,
"spacing": 10
},
"clock": { "clock": {
"format": "{: %I:%M %p  %d/%m/%Y}" "format": " {:%a %b %d %H:%M}",
"tooltip": false,
"min-length": 18
},
"custom/offswitch": {
"tooltip": false,
"format": "",
"interval": "once",
"on-click": "systemctl poweroff"
},
"network": {
"interval": 10,
"format-wifi": " {essid}",
"format-ethernet": " {ipaddr}",
"format-linked": " {ifname}",
"format-disconnected": " Disconnected",
"tooltip": false,
"max-length": 20,
"min-length": 14
},
"pulseaudio": {
"tooltip": false,
"min-length": 5,
"format": "{icon} {volume}%",
"format-bluetooth": "{icon} {volume}%",
"format-muted": "MUTE",
"format-icons": {
"headphone": "",
"headset": "",
"default": [
"",
"",
""
]
}
},
"idle_inhibitor": {
"tooltip": false,
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
}, },
"cpu": { "cpu": {
"interval": 15, "interval": 4,
"format": " {}%", "min-length": 6,
"max-length": 10 "format": " {usage}%",
"tooltip": false,
"states": {
"critical": 90
}
},
"temperature": {
"tooltip": false,
"min-length": 6,
"critical-threshold": 90,
"format": "{icon} {temperatureC}°C",
"format-critical": "{icon} {temperatureC}°C",
"format-icons": {
"default": [
"",
"",
"",
"",
""
]
}
}, },
"memory": { "memory": {
"interval": 30, "tooltip": false,
"format": " {}%", "format": " {percentage}%",
"max-length": 10 "states": {
}, "critical": 90
"custom/media": {
"interval": 30,
"format": "{icon} {}",
"return-type": "json",
"max-length": 20,
"format-icons": {
"default": " "
}, },
"escape": true, "min-length": 5
"exec": "$HOME/.config/waybar/scripts/mediaplayer.py 2> /dev/null",
"on-click": "playerctl play-pause"
}, },
"custom/launcher":{ "disk": {
"format": " ", "tooltip": false,
"on-click": "wofi --show drun", "path": "/",
"on-click-right": "killall wofi" "interval": 60,
"min-length": 5,
"format": " {percentage_used}%",
"states": {
"critical": 90
}
}, },
"sway/workspaces": {
"tooltip": false,
"disable-scroll": true
},
"custom/cap-left": {
"tooltip": false,
"format": ""
},
"custom/cap-right": {
"tooltip": false,
"format": ""
}
} }

0
dots/.config/waybar/scripts/mediaplayer.py Normal file → Executable file
View File

View File

@ -1,248 +1,188 @@
/* --fujiWhite: #DCD7BA */
/* --oldWhite: #C8C093 */
/* --sumiInk0: #16161D */
/* --sumiInk1: #1F1F28 */
/* --sumiInk2: #2A2A37 */
/* --sumiInk3: #363646 */
/* --sumiInk4: #54546D */
/* --waveBlue1: #223249 */
/* --waveBlue2: #2D4F67 */
/* --winterGreen: #2B3328 */
/* --winterYellow: #49443C */
/* --winterRed: #43242B */
/* --winterBlue: #252535 */
/* --autumnGreen: #76946A */
/* --autumnRed: #C34043 */
/* --autumnYellow: #DCA561 */
/* --samuraiRed: #E82424 */
/* --roninYellow: #FF9E3B */
/* --waveAqua1: #6A9589 */
/* --dragonBlue: #658594 */
/* --fujiGray: #727169 */
/* --springViolet1: #938AA9 */
/* --oniViolet: #957FB8 */
/* --crystalBlue: #7E9CD8 */
/* --springViolet2: #9CABCA */
/* --springBlue: #7FB4CA */
/* --lightBlue: #A3D4D5 */
/* --waveAqua2: #7AA89F */
/* --springGreen: #98BB6C */
/* --boatYellow1: #938056 */
/* --boatYellow2: #C0A36E */
/* --carpYellow: #E6C384 */
/* --sakuraPink: #D27E99 */
/* --waveRed: #E46876 */
/* --peachRed: #FF5D62 */
/* --surimiOrange: #FFA066 */
/* waybar style.css */
@define-color bgcolor #16161D; /* background color */
@define-color fgcolor #DCD7BA; /* foreground color */
@define-color charging #07fb05; /* battery charging color */
@define-color plugged #acfcad; /* ac plugged color */
@define-color critical #ff0000; /* critical color */
@define-color warning #f3f809; /* warning color */
@define-color hover #94a6e3; /* mouse hover over workspace color */
/* Reset all styles */
* { * {
border: none; border: none;
border-radius: 10; border-radius: 0;
font-family: "JetbrainsMono Nerd Font"; min-height: 0;
font-size: 15px; margin: 0;
min-height: 10px; padding: 0;
} }
window#waybar { #waybar {
background: transparent; background: transparent;
font-family: JetBrainsMono;
font-size: medium;
color: @fgcolor;
} }
window#waybar.hidden { #workspaces button {
opacity: 0.2;
}
#window {
margin-top: 6px;
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
border-radius: 10px; color: @bgcolor;
transition: none;
color: transparent;
background: transparent;
}
#tags {
margin-top: 6px;
margin-left: 12px;
font-size: 4px;
margin-bottom: 0px;
border-radius: 10px;
background: #161320;
transition: none;
} }
#tags button { #workspaces button.focused {
transition: none; background: @bgcolor;
color: #b5e8e0; color: @fgcolor;
background: transparent;
font-size: 16px;
border-radius: 2px;
} }
#tags button.occupied { #workspaces button:hover {
transition: none; background: @hover;
color: #f28fad; color: @fgcolor;
background: transparent;
font-size: 4px;
}
#tags button.focused {
color: #abe9b3;
border-top: 2px solid #abe9b3;
border-bottom: 2px solid #abe9b3;
}
#tags button:hover {
transition: none; transition: none;
box-shadow: inherit; box-shadow: inherit;
text-shadow: inherit; text-shadow: inherit;
color: #fae3b0;
border-color: #e8a2af;
color: #e8a2af;
} }
#tags button.focused:hover { #custom-cap-left,
color: #e8a2af; #custom-cap-right {
color: @bgcolor;
font-size: 24px;
} }
#idle_inhibitor {
background: @bgcolor;
padding-left: 20px;
padding-right: 10px;
}
#custom-offswitch {
background: @bgcolor;
padding-right: 20px;
padding-left: 10px;
}
#custom-weather,
#cpu,
#temperature,
#memory,
#pulseaudio,
#disk,
#battery,
#clock,
#network { #network {
margin-top: 6px; background: @bgcolor;
margin-left: 8px;
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #bd93f9;
} }
#pulseaudio { #disk.critical {
margin-top: 6px; color: @critical;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #1a1826;
background: #fae3b0;
} }
#battery { #temperature.critical {
margin-top: 6px; color: @critical;
margin-left: 8px; }
padding-left: 10px;
padding-right: 10px; #cpu.critical {
margin-bottom: 0px; color: @critical;
border-radius: 10px; }
transition: none;
color: #161320; #memory.critical {
background: #b5e8e0; color: @critical;
}
@keyframes blink1 {
to {
color: @plugged;
}
} }
#battery.charging,
#battery.plugged { #battery.plugged {
color: #161320; background-color: @bgcolor;
background-color: #b5e8e0; animation-name: blink1;
}
#battery.critical:not(.charging) {
background-color: #b5e8e0;
color: #161320;
animation-name: blink;
animation-duration: 0.5s; animation-duration: 0.5s;
animation-timing-function: linear; animation-timing-function: linear;
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-direction: alternate; animation-direction: alternate;
} }
@keyframes blink { @keyframes blink2 {
to { to {
background-color: #bf616a; background-color: @charging;
color: #b5e8e0;
} }
} }
#backlight { #battery.charging {
margin-top: 6px; /* background-color: @bgcolor; */
margin-left: 8px; animation-name: blink2;
padding-left: 10px; animation-duration: 2s;
padding-right: 10px; animation-timing-function: ease-in-out;
margin-bottom: 0px; animation-iteration-count: infinite;
border-radius: 10px; animation-direction: alternate;
transition: none;
color: #161320;
background: #f8bd96;
}
#clock {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #abe9b3;
/*background: #1A1826;*/
} }
#memory { @keyframes blink3 {
margin-top: 6px; to {
margin-left: 8px; background-color: @warning;
padding-left: 10px; }
margin-bottom: 0px;
padding-right: 10px;
border-radius: 10px;
transition: none;
color: #161320;
background: #ddb6f2;
}
#cpu {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
margin-bottom: 0px;
padding-right: 10px;
border-radius: 10px;
transition: none;
color: #161320;
background: #96cdfb;
} }
#tray { #battery.warning:not(.charging) {
margin-top: 6px; /* background-color: @bgcolor; */
margin-left: 8px; animation-name: blink3;
padding-left: 10px; animation-duration: 0.7s;
margin-bottom: 0px; animation-timing-function: ease-in-out;
padding-right: 10px; animation-iteration-count: infinite;
border-radius: 10px; animation-direction: alternate;
transition: none;
color: #b5e8e0;
background: #161320;
} }
#custom-launcher { @keyframes blink4 {
font-size: 24px; to {
margin-top: 6px; background-color: @critical;
margin-left: 8px; }
padding-left: 10px;
padding-right: 5px;
border-radius: 10px;
transition: none;
color: #89dceb;
background: #161320;
} }
#custom-power { #battery.critical:not(.charging) {
font-size: 20px; /* background-color: @bgcolor; */
margin-top: 6px; animation-name: blink4;
margin-left: 8px; animation-duration: 0.8s;
margin-right: 8px; animation-timing-function: ease-in-out;
padding-left: 10px; animation-iteration-count: infinite;
padding-right: 5px; animation-direction: alternate;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #f28fad;
}
#custom-wallpaper {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #c9cbff;
}
#custom-updates {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #e8a2af;
}
#custom-media {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #f2cdcd;
} }