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 if [ "$updates" -gt $threshhold_green ]; then
printf '{"text": "%s", "alt": "%s", "tooltip": "%s Updates", "class": "%s"}' "$updates" "$updates" "$updates" "$css_class" printf '{"text": "%s", "alt": "%s", "tooltip": "%s Updates", "class": "%s"}' "$updates" "$updates" "$updates" "$css_class"
else else
printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "green"}' printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "green", ""}'
fi fi

View File

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

View File

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

View File

@ -3,29 +3,21 @@
* ----------------------------------------------------- */ * ----------------------------------------------------- */
/* @import 'style-light.css'; */ /* @import 'style-light.css'; */
/* -----------------------------------------------------
* General
* ----------------------------------------------------- */
* { * {
font-family: "Fira Sans Semibold", FontAwesome, Roboto, Helvetica, Arial, sans-serif; font-family: "Fira Sans Semibold", FontAwesome, Roboto, Helvetica, Arial, sans-serif;
font-size: 16px;
border: none; border: none;
border-radius: 0px; border-radius: 0px;
min-height: 0;
} }
window#waybar { window#waybar {
background-color: rgba(0,0,0,0.8); background-color: transparent;
border-bottom: 0px solid #ffffff; color: black;
/* color: #FFFFFF; */
background: transparent;
transition-property: background-color; transition-property: background-color;
transition-duration: .5s; transition-duration: .5s;
} }
/* -----------------------------------------------------
* Workspaces
* ----------------------------------------------------- */
#workspaces { #workspaces {
background: @workspacesbackground1; background: @workspacesbackground1;
margin: 2px 1px 3px 1px; margin: 2px 1px 3px 1px;
@ -35,7 +27,6 @@ window#waybar {
font-weight: bold; font-weight: bold;
font-style: normal; font-style: normal;
opacity: 0.8; opacity: 0.8;
font-size: 16px;
color: @textcolor1; color: @textcolor1;
} }
@ -66,9 +57,10 @@ window#waybar {
opacity:0.7; opacity:0.7;
} }
/* ----------------------------------------------------- #window,
* Tooltips #workspace {
* ----------------------------------------------------- */ margin: 0px 4px;
}
tooltip { tooltip {
border-radius: 10px; border-radius: 10px;
@ -82,52 +74,10 @@ tooltip label {
color: @textcolor2; 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 { window#waybar.empty #window {
background-color:transparent; 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 { .modules-left > widget:first-child > #workspaces {
margin-left: 0; margin-left: 0;
} }
@ -136,237 +86,22 @@ window#waybar.empty #window {
margin-right: 0; margin-right: 0;
} }
/* ----------------------------------------------------- #custom-appmenu,
* Custom Quicklinks #taskbar,
* ----------------------------------------------------- */ #clock,
#custom-updates,
#custom-browser, #custom-email, #custom-filemanager, #custom-teams, #custom-pass, #custom-cliphist, #custom-wallpaper, #custom-waybarthemes { #network,
margin-right: 20px; #battery,
font-size: 20px; #pulseaudio,
font-weight: bold; #backlight,
opacity: 0.8; #custom-cliphist,
#bluetooth.on,
#bluetooth.connected,
#custom-exit{
padding: 0px 10px;
color: @iconcolor; 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-exit {
margin: 0px 20px 0px 0px;
padding:0px;
font-size:20px;
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 { #tray {
background-color: #2980b9; background-color: #2980b9;
} }
@ -380,24 +115,6 @@ window#waybar.empty #window {
background-color: #eb4d4b; background-color: #eb4d4b;
} }
/* -----------------------------------------------------
* Other
* ----------------------------------------------------- */
label:focus { label:focus {
background-color: #000000; background-color: #000000;
} }
#backlight {
/* background-color: #90b1b1; */
background-color: @backgroundlight;
}
#network {
background-color: #2980b9;
}
#network.disconnected {
background-color: #f53c3c;
}