waybar layout

This commit is contained in:
Spangenberg 2023-10-25 13:36:00 +02:00
parent 0c4f20e85f
commit 21785526a8
7 changed files with 93 additions and 354 deletions

24
scripts/checksystemupdates.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# Requires pacman-contrib trizen
# Define threshholds for color indicators
threshhold_green=0
threshhold_yellow=25
threshhold_red=100
# Calculate available updates pacman and aur (with trizen)
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
updates_arch=0
fi
if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
updates_aur=0
fi
updates=$(("$updates_arch" + "$updates_aur"))
if [[ $updates = 0 ]]; then
printf '{"text": "%s", "alt": "updated", "tooltip": "%s Updates", "class": "green", "percentage": "100"}' "$updates" "$updates"
else
printf '{"text": "$s", "alt": "has-updates", "tooltip": "%s Updates", "class": "green", "percentage": "0"}' "$updates" "$updates"
fi

8
scripts/systemupdates.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
echo "Starting install updates"
echo ""
yay
notify-send "Update complete"

View File

@ -30,5 +30,5 @@ fi
if [ "$updates" -gt $threshhold_green ]; then
printf '{"text": "%s", "alt": "%s", "tooltip": "%s Updates", "class": "%s"}' "$updates" "$updates" "$updates" "$css_class"
else
printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "green"}'
printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "green", ""}'
fi

View File

@ -57,14 +57,17 @@
// Updates Count
"custom/updates": {
"format": " {}",
"format": "{icon}",
"format-icons": {
"has-updates": "󰻍",
"updated": "󰳈"},
"tooltip-format": "{}",
"escape": true,
"return-type": "json",
"exec": "~/dotfiles/scripts/updates.sh",
"exec": "~/dotfiles/scripts/checksystemupdates.sh",
"restart-interval": 60,
"on-click": "alacritty -e ~/dotfiles/scripts/installupdates.sh",
"tooltip": false
"on-click": "kitty ~/dotfiles/scripts/installupdates.sh",
"tooltip": true
},
// Wallpaper
@ -157,8 +160,9 @@
// Clock
"clock": {
"format": "{:%H:%M}",
// "timezone": "Europe/Berlin",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"tooltip-format": "<big>{:%d %B %Y}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
@ -184,9 +188,9 @@
// Network
"network": {
"format": "{ifname}",
"format-wifi": " {signalStrength}%",
"format-ethernet": " {ipaddr}",
"format": "{}",
"format-wifi": "",
"format-ethernet": "",
"format-disconnected": "", //An empty format will hide the module.
"tooltip-format": " {ifname} via {gwaddri}",
"tooltip-format-wifi": " {essid} ({signalStrength}%)",
@ -203,19 +207,19 @@
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}%",
"format-charging": " {capacity}%",
"format-plugged": " {capacity}%",
"format-alt": "{icon} {time}",
"format": "{icon}",
"format-charging": "󰂄",
"format-plugged": "󱐥",
"format-alt": "{icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": [" ", " ", " ", " ", " "]
"format-icons": ["󰂎", "󱊡", "󱊢", "󱊣"]
},
// Pulseaudio
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{icon} {volume}%",
"format": "{icon}",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon} {format_source}",
"format-muted": " {format_source}",
@ -230,6 +234,7 @@
"car": "",
"default": ["", " ", " "]
},
"tooltip-format": "{volume}%",
"on-click": "pavucontrol"
},
@ -244,8 +249,10 @@
//Backlight
"backlight": {
"device": "intel_backlight",
"format": "{icon} {percent}%",
"format-icons": ["󰃞", "󰃠"]
"format": "{icon}",
"format-icons": ["󰃞", "󰃠"],
"tooltip-format": "{percent}%"
},
// Other

View File

@ -1,56 +1,39 @@
{
// Position
"layer": "top",
"height": 16,
"margin-top": 14,
"margin-top": 5,
"margin-bottom": 0,
"margin-left": 0,
"margin-right": 0,
"spacing": 0,
// Load Modules
"include": ["~/dotfiles/waybar/modules.json"],
// Modules Left
"modules-left": [
"custom/appmenu",
"custom/wallpaper",
"custom/waybarthemes",
"wlr/taskbar",
"group/quicklinks",
"hyprland/window"
// "custom/wallpaper",
// "custom/waybarthemes",
"wlr/taskbar"
// "group/quicklinks",
// "hyprland/window"
],
// Modules Center
"modules-center": [
"hyprland/workspaces"
],
"modules-center": {},
// Modules Right
"modules-right": [
"custom/updates",
"custom/cliphist",
"backlight",
"pulseaudio",
"bluetooth",
"battery",
"group/hardware",
"custom/cliphist",
// "group/hardware",
"network",
"custom/exit",
"clock"
"tray",
"clock",
"custom/exit"
],
// Group Quicklinks
"group/quicklinks": {
"orientation": "horizontal",
"modules": [
"custom/filemanager",
"custom/browser",
"custom/email",
"custom/pass"
]
},
// Group Hardware
"group/hardware": {
"orientation": "horizontal",

View File

@ -3,29 +3,21 @@
* ----------------------------------------------------- */
/* @import 'style-light.css'; */
/* -----------------------------------------------------
* General
* ----------------------------------------------------- */
* {
font-family: "Fira Sans Semibold", FontAwesome, Roboto, Helvetica, Arial, sans-serif;
font-size: 16px;
border: none;
border-radius: 0px;
min-height: 0;
}
window#waybar {
background-color: rgba(0,0,0,0.8);
border-bottom: 0px solid #ffffff;
/* color: #FFFFFF; */
background: transparent;
background-color: transparent;
color: black;
transition-property: background-color;
transition-duration: .5s;
}
/* -----------------------------------------------------
* Workspaces
* ----------------------------------------------------- */
#workspaces {
background: @workspacesbackground1;
margin: 2px 1px 3px 1px;
@ -35,7 +27,6 @@ window#waybar {
font-weight: bold;
font-style: normal;
opacity: 0.8;
font-size: 16px;
color: @textcolor1;
}
@ -66,9 +57,10 @@ window#waybar {
opacity:0.7;
}
/* -----------------------------------------------------
* Tooltips
* ----------------------------------------------------- */
#window,
#workspace {
margin: 0px 4px;
}
tooltip {
border-radius: 10px;
@ -82,52 +74,10 @@ tooltip label {
color: @textcolor2;
}
/* -----------------------------------------------------
* Window
* ----------------------------------------------------- */
#window {
background: @backgroundlight;
margin: 5px 15px 5px 0px;
padding: 2px 10px 0px 10px;
border-radius: 12px;
color:@textcolor2;
font-size:16px;
font-weight:normal;
opacity:0.8;
}
window#waybar.empty #window {
background-color:transparent;
}
/* -----------------------------------------------------
* Taskbar
* ----------------------------------------------------- */
#taskbar {
/* background: @color11; */
background: @backgroundlight;
margin: 3px 15px 3px 0px;
padding:0px;
/*padding: 2px 3px 1px 3px;*/
border-radius: 15px;
font-weight: normal;
font-style: normal;
opacity:0.8;
border: 3px solid @backgroundlight;
}
#taskbar button {
margin:0;
border-radius: 15px;
padding: 0px 5px 0px 5px;
}
/* -----------------------------------------------------
* Modules
* ----------------------------------------------------- */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
@ -136,237 +86,22 @@ window#waybar.empty #window {
margin-right: 0;
}
/* -----------------------------------------------------
* Custom Quicklinks
* ----------------------------------------------------- */
#custom-browser, #custom-email, #custom-filemanager, #custom-teams, #custom-pass, #custom-cliphist, #custom-wallpaper, #custom-waybarthemes {
margin-right: 20px;
font-size: 20px;
font-weight: bold;
opacity: 0.8;
color: @iconcolor;
}
#custom-wallpaper {
margin-right:23px;
}
/* -----------------------------------------------------
* Custom Modules
* ----------------------------------------------------- */
#custom-appmenu {
background-color: @backgrounddark;
font-size: 16px;
color: @textcolor1;
border-radius: 15px;
padding: 0px 10px 0px 10px;
margin: 3px 15px 3px 14px;
opacity:0.8;
border:3px solid @bordercolor;
}
/* -----------------------------------------------------
* Custom Exit
* ----------------------------------------------------- */
#custom-appmenu,
#taskbar,
#clock,
#custom-updates,
#network,
#battery,
#pulseaudio,
#backlight,
#custom-cliphist,
#bluetooth.on,
#bluetooth.connected,
#custom-exit{
margin: 0px 20px 0px 0px;
padding:0px;
font-size:20px;
padding: 0px 10px;
color: @iconcolor;
}
/* -----------------------------------------------------
* Custom Updates
* ----------------------------------------------------- */
#custom-updates {
background-color: @backgroundlight;
font-size: 16px;
color: @textcolor2;
border-radius: 15px;
padding: 2px 10px 0px 10px;
margin: 5px 15px 5px 0px;
opacity:0.8;
}
#custom-updates.green {
background-color: @backgroundlight;
}
#custom-updates.yellow {
background-color: #ff9a3c;
color: #FFFFFF;
}
#custom-updates.red {
background-color: #dc2f2f;
color: #FFFFFF;
}
/* -----------------------------------------------------
* Custom Youtube
* ----------------------------------------------------- */
#custom-youtube {
background-color: @backgroundlight;
font-size: 16px;
color: @textcolor2;
border-radius: 15px;
padding: 2px 10px 0px 10px;
margin: 5px 15px 5px 0px;
opacity:0.8;
}
/* -----------------------------------------------------
* Hardware Group
* ----------------------------------------------------- */
#disk,#memory,#cpu {
margin:0px;
padding:0px;
font-size:16px;
color:@iconcolor;
}
#memory {
margin-right:10px;
}
/* -----------------------------------------------------
* Clock
* ----------------------------------------------------- */
#clock {
background-color: @backgrounddark;
font-size: 16px;
color: @textcolor1;
border-radius: 15px;
padding: 1px 10px 0px 10px;
margin: 3px 15px 3px 0px;
opacity:0.8;
border:3px solid @bordercolor;
}
/* -----------------------------------------------------
* Backlight
* ----------------------------------------------------- */
#backlight {
background-color: @backgroundlight;
font-size: 16px;
color: @textcolor2;
border-radius: 15px;
padding: 2px 10px 0px 10px;
margin: 5px 15px 5px 0px;
opacity:0.8;
}
/* -----------------------------------------------------
* Pulseaudio
* ----------------------------------------------------- */
#pulseaudio {
background-color: @backgroundlight;
font-size: 16px;
color: @textcolor2;
border-radius: 15px;
padding: 2px 10px 0px 10px;
margin: 5px 15px 5px 0px;
opacity:0.8;
}
#pulseaudio.muted {
background-color: @backgrounddark;
color: @textcolor1;
}
/* -----------------------------------------------------
* Network
* ----------------------------------------------------- */
#network {
background-color: @backgroundlight;
font-size: 16px;
color: @textcolor2;
border-radius: 15px;
padding: 2px 10px 0px 10px;
margin: 5px 15px 5px 0px;
opacity:0.8;
}
#network.ethernet {
background-color: @backgroundlight;
color: @textcolor2;
}
#network.wifi {
background-color: @backgroundlight;
color: @textcolor2;
}
/* -----------------------------------------------------
* Bluetooth
* ----------------------------------------------------- */
#bluetooth.on, #bluetooth.connected {
background-color: @backgroundlight;
font-size: 16px;
color: @textcolor2;
border-radius: 15px;
padding: 2px 10px 0px 10px;
margin: 5px 15px 5px 0px;
opacity:0.8;
}
#bluetooth.off {
background-color: transparent;
padding: 0px;
margin: 0px;
}
/* -----------------------------------------------------
* Battery
* ----------------------------------------------------- */
#battery {
background-color: @backgroundlight;
font-size: 16px;
color: @textcolor2;
border-radius: 15px;
padding: 2px 15px 0px 10px;
margin: 5px 15px 5px 0px;
opacity:0.8;
}
#battery.charging, #battery.plugged {
color: @textcolor2;
background-color: @backgroundlight;
}
@keyframes blink {
to {
background-color: @backgroundlight;
color: @textcolor2;
}
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: @textcolor3;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
/* -----------------------------------------------------
* Tray
* ----------------------------------------------------- */
#tray {
background-color: #2980b9;
}
@ -380,24 +115,6 @@ window#waybar.empty #window {
background-color: #eb4d4b;
}
/* -----------------------------------------------------
* Other
* ----------------------------------------------------- */
label:focus {
background-color: #000000;
}
#backlight {
/* background-color: #90b1b1; */
background-color: @backgroundlight;
}
#network {
background-color: #2980b9;
}
#network.disconnected {
background-color: #f53c3c;
}