feat: replaced waybar with gBar

This commit is contained in:
moonleay 2024-01-04 19:20:16 +01:00
parent aeb59d1b1a
commit 3de8465cca
Signed by: moonleay
GPG key ID: 82667543CCD715FB
6 changed files with 1028 additions and 1 deletions

197
gBar/config Normal file
View file

@ -0,0 +1,197 @@
# Example configuration.
# Everything after '#' is ignored
# Format of the variables:
# [variable]: [value]
# Whitespaces are ignored in the following locations:
# - Before the variable
# - After the ':'
# - After the value
#
# String variables can be escaped ([Notation in config] -> "Result"):
# - foo\\bar -> "foo<backlash>bar"
# - foo\nbar -> "foo<newline>bar"
# - foo\sbar -> "foo bar"
# The following three options control the ordering of the widgets.
# Reordering can cause slight margin inconsistencies,
# so it is recommend to only make minor adjustments to the default layout.
# Adding the same widget multiple times to the layout is *not* supported and will cause issues.
# Widgets to show on the left side
WidgetsLeft: [Workspaces]
# Widgets to center
WidgetsCenter: [Time]
# Widgets to display on the right side
WidgetsRight: [Tray, Packages, Audio, Bluetooth, Network, Disk, VRAM, GPU, RAM, CPU, Battery, Power]
# The CPU sensor to use
CPUThermalZone: /sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon8/temp1_input
# The command to execute on suspend
# SuspendCommand: ~/.config/scripts/sys.sh suspend
# The command to execute on lock
# LockCommand: ~/.config/scripts/sys.sh lock
LockCommand: swaylock
# The command to execute on exit
ExitCommand: killall Hyprland
# The folder, where the battery sensors reside
BatteryFolder: /sys/class/power_supply/BAT0
# The partition to monitor with disk sensor
DiskPartition: /
# Overrides the icon of the nth (in this case the first) workspace.
# Please note the missing space between "," and the symbol. Adding a space here adds it to the bar too!
#WorkspaceSymbol: 1,
# The default symbol for the workspaces
DefaultWorkspaceSymbol: 
# All of the icons that can be modified.
# Please note that some icons require a space ("\s") (e.g. default ShutdownIcon)
ShutdownIcon: \s
RebootIcon: 󰑐
SleepIcon: 󰏤
LockIcon: 
ExitIcon: 󰗼
BTOffIcon: 󰂲
BTOnIcon: 󰂯
BTConnectedIcon: 󰂱
DevKeyboardIcon: 󰌌\s
DevMouseIcon: 󰍽\s
DevHeadsetIcon: 󰋋\s
DevControllerIcon: 󰖺\s
DevUnknownIcon: \s
SpeakerMutedIcon: 󰝟
SpeakerHighIcon: 󰕾
MicMutedIcon: 󰍭
MicHighIcon: 󰍬
PackageOutOfDateIcon: 󰏔\s
# Scroll through the workspaces of the current monitor instead of all workspaces
WorkspaceScrollOnMonitor: true
# When true: Scroll up -> Next workspace instead of previous workspace. Analogous with scroll down
WorkspaceScrollInvert: false
# Number of workspaces to display. Displayed workspace IDs are 1-n (Default: 1-9)
NumWorkspaces: 12
# Use Hyprland IPC instead of the ext_workspace protocol for workspace polling.
# Hyprland IPC is *slightly* less performant (+0.1% one core), but way less bug prone,
# since the protocol is not as feature complete as Hyprland IPC.
# NOTE: Hyprland no longer supports ext-workspace-unstable-v1 as of commit bb09334.
# Hyprland IPC is thus *required* for workspace support under Hyprland >=v0.30.0!
UseHyprlandIPC: true
# The location of the bar
# Needs to be capitalized!!
# Values are: L (Left), R (Right), T (Top), B (bottom)
Location: T
# When the location is set to side, this option forces everything (even text) to be right-side up.
# *Always* make sure to enable SensorTooltips when enabling this option. Failure to do so *will* cause graphical issues.
IconsAlwaysUp: false
# Forces the time to be centered.
# This can cause the right widget to clip outside, if there is not enough space on screen (e.g. when opening the text)
# Setting this to false will definitely fix this issue, but it won't look very good, since it will be off-center.
# So try to decrease "TimeSpace" first, before setting this configuration to false.
CenterTime: true
# How much space should be reserved for the time widget. Setting this too high can cause the right widget to clip outside.
# Therefore try to set it as low as possible if you experience clipping.
# Although keep in mind, that a value that is too low can cause the widget to be be off-center,
# which can also cause clipping.
# If you can't find an optimal value, consider setting 'CenterTime' to false
# TimeSpace: 300
TimeSpace: 240
# Set datetime style
# DateTimeStyle: %a %D - %H:%M:%S %Z
DateTimeStyle: %a %F %R %Z
# Set datetime locale (defaults to system locale if not set or set to empty string)
#DateTimeLocale: de_DE.utf8
# Adds a audio input(aka. microphone) widget
AudioInput: true
# Sets the audio slider to be on reveal (Just like the sensors) when true. Only affects the bar.
AudioRevealer: false
# Sets the rate of change of the slider on each scroll. In Percent
AudioScrollSpeed: 5
# Display numbers instead of a slider for the two audio widgets. Doesn't affect the audio flyin
AudioNumbers: false
# Command that is run to check if there are out-of-date packages.
# The script should return *ONLY* a number. If it doesn't output a number, updates are no longer checked.
# Default value is applicable for Arch Linux. (See data/update.sh for a human-readable version)
CheckPackagesCommand: p="$(checkupdates)"; e=$?; if [ $e -eq 127 ] ; then exit 127; fi; if [ $e -eq 2 ] ; then echo "0" && exit 0; fi; echo "$p" | wc -l
# How often to check for updates. In seconds
CheckUpdateInterval: 300
# Limits the range of the audio slider. Only works for audio output.
# Slider "empty" is AudioMinVolume, Slider "full" is AudioMaxVolume
# AudioMinVolume: 30 # Audio can't get below 30%
# AudioMaxVolume: 120 # Audio can't get above 120%
# The network adapter to use. You can query /sys/class/net for all possible values
NetworkAdapter: wlan0
# Disables the network widget when set to false
NetworkWidget: true
# The card to poll when using AMDGPU. If you don't have an AMD card, you can skip this config.
# Possible values can be found by querying /sys/class/drm
DrmAmdCard: card1
# Use tooltips instead of sliders for the sensors
SensorTooltips: false
# The size of the of the circular sensors
SensorSize: 24
# The size of the network icon
NetworkIconSize: 24
# Enables tray icons
EnableSNI: true
# SNIIconSize sets the icon size for a SNI icon.
# SNIPaddingTop Can be used to push the Icon down. Negative values are allowed
# SNIIconName overrides what icon from an icon theme to display.
# SNIDisabled prevents an icon from being registered.
# For all SNI properties: The first parameter is a filter of the tooltip(The text that pops up, when the icon is hovered) of the icon.
# The wildcard filter '*' does not work for SNIIconName and SNIDisabled
# Scale everything down to 25 pixels ('*' as filter means everything)
#SNIIconSize: *, 25
# Explicitly make OBS a bit smaller than default
#SNIIconSize: OBS, 23
# Nudges the Discord icon a bit down
#SNIPaddingTop: Discord, 5
# Override the default icon given to gBar by discord to an icon theme supplied one (Example is from papirus theme)
#SNIIconName: Discord, discord-tray
# Prevents steam from displaying. Note: Steam doesn't have a tooltip, which means the object path is filtered instead.
#SNIDisabled: steam, true
# These set the range for the network widget. The widget changes colors at six intervals:
# - Below Min...Bytes ("under")
# - Between ]0%;25%]. 0% = Min...Bytes; 100% = Max...Bytes ("low")
# - Between ]25%;50%]. 0% = Min...Bytes; 100% = Max...Bytes ("mid-low")
# - Between ]50%;75%]. 0% = Min...Bytes; 100% = Max...Bytes ("mid-high")
# - Between ]75%;100%]. 0% = Min...Bytes; 100% = Max...Bytes ("high")
# - Above Max...Bytes ("over")
MinDownloadBytes: 0
MaxDownloadBytes: 10485760 # 10 * 1024 * 1024 = 10 MiB
MinUploadBytes: 0
MaxUploadBytes: 5242880 # 5 * 1024 * 1024 = 5 MiB

386
gBar/style.css Normal file
View file

@ -0,0 +1,386 @@
* {
all: unset;
font-family: "CaskaydiaCove NF";
}
.popup {
color: #50fa7b;
}
.bar, tooltip {
background-color: #282a36;
border-radius: 16px;
margin-left: 16px;
margin-right: 16px;
margin-top: 8px;
}
.right {
border-radius: 16px;
}
.time-text {
font-size: 16px;
}
.reboot-button {
font-size: 28px;
color: #6272a4;
}
.sleep-button {
font-size: 28px;
color: #6272a4;
}
.lock-button {
font-size: 28px;
color: #6272a4;
}
.exit-button {
font-size: 28px;
color: #6272a4;
}
.power-button {
font-size: 28px;
color: #ff5555;
}
.system-confirm {
color: #50fa7b;
}
trough {
border-radius: 3px;
border-width: 1px;
border-style: none;
background-color: #44475a;
min-width: 4px;
min-height: 4px;
}
slider {
border-radius: 0%;
border-width: 1px;
border-style: none;
margin: -9px -9px -9px -9px;
min-width: 16px;
min-height: 16px;
background-color: transparent;
}
highlight {
border-radius: 3px;
border-width: 1px;
border-style: none;
min-width: 6px;
min-height: 6px;
}
.audio-icon {
font-size: 24px;
color: #ffb86c;
}
.audio-volume {
font-size: 16px;
color: #ffb86c;
}
.audio-volume trough {
background-color: #44475a;
}
.audio-volume slider {
background-color: transparent;
}
.audio-volume highlight {
background-color: #ffb86c;
}
.mic-icon {
font-size: 24px;
color: #bd93f9;
}
.mic-volume {
font-size: 16px;
color: #bd93f9;
}
.mic-volume trough {
background-color: #44475a;
}
.mic-volume slider {
background-color: transparent;
}
.mic-volume highlight {
background-color: #bd93f9;
}
.package-outofdate {
margin: -5px -5px -5px -5px;
font-size: 24px;
color: #ff5555;
}
.bt-num {
font-size: 16px;
color: #1793D1;
}
.bt-label-on {
font-size: 20px;
color: #1793D1;
}
.bt-label-off {
font-size: 24px;
color: #1793D1;
}
.bt-label-connected {
font-size: 28px;
color: #1793D1;
}
.disk-widget * {
color: #bd93f9;
font-size: 16px;
}
.disk-util-progress {
background-color: #44475a;
}
.vram-widget * {
color: #ffb86c;
font-size: 16px;
}
.vram-util-progress {
background-color: #44475a;
}
.ram-widget * {
color: #f1fa8c;
font-size: 16px;
}
.ram-util-progress {
background-color: #44475a;
}
.gpu-widget * {
color: #8be9fd;
font-size: 16px;
}
.gpu-util-progress {
background-color: #44475a;
}
.cpu-widget * {
color: #50fa7b;
font-size: 16px;
}
.cpu-util-progress {
background-color: #44475a;
}
.battery-widget * {
color: #ff79c6;
font-size: 16px;
}
.battery-util-progress {
background-color: #44475a;
}
.battery-charging {
color: #ffb86c;
}
.network-data-text {
color: #50fa7b;
font-size: 16px;
}
.network-up-under {
color: #44475a;
}
.network-up-low {
color: #50fa7b;
}
.network-up-mid-low {
color: #f1fa8c;
}
.network-up-mid-high {
color: #ffb86c;
}
.network-up-high {
color: #bd93f9;
}
.network-up-over {
color: #ff5555;
}
.network-down-under {
color: #44475a;
}
.network-down-low {
color: #50fa7b;
}
.network-down-mid-low {
color: #f1fa8c;
}
.network-down-mid-high {
color: #ffb86c;
}
.network-down-high {
color: #bd93f9;
}
.network-down-over {
color: #ff5555;
}
.ws-dead {
color: #44475a;
font-size: 16px;
}
.ws-inactive {
color: #6272a4;
font-size: 16px;
}
.ws-visible {
color: #8be9fd;
font-size: 16px;
}
.ws-current {
color: #f1fa8c;
font-size: 16px;
}
.ws-active {
color: #50fa7b;
font-size: 16px;
}
@keyframes connectanim {
from {
background-image: radial-gradient(circle farthest-side at center, #1793D1 0%, transparent 0%, transparent 100%);
}
to {
background-image: radial-gradient(circle farthest-side at center, #1793D1 0%, #1793D1 100%, transparent 100%);
}
}
@keyframes disconnectanim {
from {
background-image: radial-gradient(circle farthest-side at center, transparent 0%, #1793D1 0%, #1793D1 100%);
}
to {
background-image: radial-gradient(circle farthest-side at center, transparent 0%, transparent 100%, #1793D1 100%);
}
}
@keyframes scanonanim {
from {
color: #f1fa8c;
}
to {
color: #50fa7b;
}
}
@keyframes scanoffanim {
from {
color: #50fa7b;
}
to {
color: #f1fa8c;
}
}
.bt-bg {
background-color: #282a36;
border-radius: 16px;
}
.bt-header-box {
margin-top: 4px;
margin-right: 8px;
margin-left: 8px;
font-size: 24px;
color: #1793D1;
}
.bt-body-box {
margin-right: 8px;
margin-left: 8px;
}
.bt-button {
border-radius: 16px;
padding-left: 8px;
padding-right: 8px;
padding-top: 4px;
padding-bottom: 4px;
margin-bottom: 4px;
margin-top: 4px;
font-size: 16px;
}
.bt-button.active {
animation-name: connectanim;
animation-duration: 50ms;
animation-timing-function: linear;
animation-fill-mode: forwards;
}
.bt-button.inactive {
animation-name: disconnectanim;
animation-duration: 50ms;
animation-timing-function: linear;
animation-fill-mode: forwards;
}
.bt-button.failed {
color: #ff5555;
}
.bt-close {
color: #ff5555;
background-color: #44475a;
border-radius: 16px;
padding: 0px 8px 0px 7px;
margin: 0px 0px 0px 8px;
}
.bt-scan {
color: #f1fa8c;
background-color: #44475a;
border-radius: 16px;
padding: 2px 11px 0px 7px;
margin: 0px 0px 0px 10px;
font-size: 18px;
}
.bt-scan.active {
animation-name: scanonanim;
animation-duration: 50ms;
animation-timing-function: linear;
animation-fill-mode: forwards;
}
.bt-scan.inactive {
animation-name: scanoffanim;
animation-duration: 50ms;
animation-timing-function: linear;
animation-fill-mode: forwards;
}

418
gBar/style.scss Normal file
View file

@ -0,0 +1,418 @@
// colorscheme(dracula)
// See https://github.com/dracula/dracula-theme/blob/master/LICENSE or dracula/LICENSE for the license
$bg: #282a36;
$fg: #f8f8f2;
$inactive: #44475a;
$darkblue: #6272a4;
$cyan: #8be9fd;
$green: #50fa7b;
$orange: #ffb86c;
$pink: #ff79c6;
$purple: #bd93f9;
$red: #ff5555;
$yellow: #f1fa8c;
$btblue: #1793D1;
$textsize: 16px;
*{
all: unset;
font-family: "CaskaydiaCove NF";
}
// debug
.cpu-box{
//background-color: #00cc00
}
.popup {
color: #50fa7b;
}
.bar,tooltip{
background-color: $bg;
border-radius: 16px;
}
.right {
border-radius: 16px;
}
.time-text {
font-size: $textsize;
}
.reboot-button {
font-size: 28px;
color: $darkblue;
}
.sleep-button {
font-size: 28px;
color: $darkblue;
}
.lock-button {
font-size: 28px;
color: $darkblue;
}
.exit-button {
font-size: 28px;
color: $darkblue;
}
.power-button {
font-size: 28px;
color: $red;
}
.power-box {
}
.power-box-expand {
}
.system-confirm {
color: $green;
}
// Common slider settings
trough {
border-radius: 3px;
border-width: 1px;
border-style: none;
background-color: $inactive;
// margin-top: 2px;
min-width: 4px;
min-height: 4px;
}
slider {
// Controls the size of the control area (set border-style to solid to see)
border-radius: 0%;
border-width: 1px;
border-style: none;
margin: -9px -9px -9px -9px;
min-width: 16px;
min-height: 16px;
background-color: transparent;
}
highlight {
border-radius: 3px;
border-width: 1px;
border-style: none;
// For vertical we need width, for horizontal we need height
// Both can coexist though
min-width: 6px;
min-height: 6px;
}
.audio-icon {
font-size: 24px;
color: $orange;
}
.audio-volume {
trough {
background-color: $inactive;
}
slider {
background-color: transparent;
}
highlight {
background-color: $orange;
}
font-size: 16px;
color: $orange;
}
.mic-icon {
font-size: 24px;
color: $purple;
// margin-right: 0px;
}
.mic-volume {
trough {
background-color: $inactive;
}
slider {
background-color: transparent;
}
highlight {
background-color: $purple;
}
font-size: 16px;
color: $purple;
}
.package-outofdate {
margin: -5px -5px -5px -5px;
font-size: 24px;
color: $red;
}
.bt-num {
font-size: $textsize;
color: $btblue;
}
.bt-label-on {
font-size: 20px;
color: $btblue;
}
.bt-label-off {
font-size: 24px;
color: $btblue;
}
.bt-label-connected {
font-size: 28px;
color: $btblue;
}
.disk-widget * {
color: $purple;
font-size: $textsize;
}
.disk-util-progress {
background-color: $inactive;
}
.vram-widget * {
color: $orange;
font-size: $textsize;
}
.vram-util-progress {
background-color: $inactive;
}
.ram-widget * {
color: $yellow;
font-size: $textsize;
}
.ram-util-progress {
background-color: $inactive;
}
.gpu-widget * {
color: $cyan;
font-size: $textsize;
}
.gpu-util-progress {
background-color: $inactive;
}
.cpu-widget * {
color: $green;
font-size: $textsize;
}
.cpu-util-progress {
background-color: $inactive;
}
.battery-widget * {
color: $pink;
font-size: $textsize;
}
.battery-util-progress {
background-color: $inactive;
}
.battery-charging {
color: $orange
}
.network-data-text {
color: $green;
font-size: $textsize;
}
// <= 0% (Below MinUploadBytes)
.network-up-under {
color: $inactive;
}
// <= 25%
.network-up-low {
color: $green;
}
// <= 50%
.network-up-mid-low {
color: $yellow;
}
// <= 75%
.network-up-mid-high {
color: $orange;
}
// <= 100%
.network-up-high {
color: $purple;
}
// > 100% (Above MaxUploadBytes)
.network-up-over {
color: $red;
}
// <= 0% (Below MinDownloadBytes)
.network-down-under {
color: $inactive;
}
// <= 25%
.network-down-low {
color: $green;
}
// <= 50%
.network-down-mid-low {
color: $yellow;
}
// <= 75%
.network-down-mid-high {
color: $orange;
}
// <= 100%
.network-down-high {
color: $purple;
}
// > 100% (Above MaxDownloadBytes)
.network-down-over {
color: $red;
}
.ws-dead {
color: $inactive;
font-size: $textsize;
}
.ws-inactive {
color: $darkblue;
font-size: $textsize;
}
.ws-visible {
color: $cyan;
font-size: $textsize;
}
.ws-current {
color: $yellow;
font-size: $textsize;
}
.ws-active {
color: $green;
font-size: $textsize;
}
// Bluetooth Widget
@keyframes connectanim {
from {
background-image: radial-gradient(circle farthest-side at center, $btblue 0%, transparent 0%, transparent 100%)
}
to {
background-image: radial-gradient(circle farthest-side at center, $btblue 0%, $btblue 100%, transparent 100%)
}
}
@keyframes disconnectanim {
from {
background-image: radial-gradient(circle farthest-side at center, transparent 0%, $btblue 0%, $btblue 100%)
}
to {
background-image: radial-gradient(circle farthest-side at center, transparent 0%, transparent 100%, $btblue 100%)
}
}
@keyframes scanonanim {
from {
color: $yellow;
}
to {
color: $green;
}
}
@keyframes scanoffanim {
from {
color: $green;
}
to {
color: $yellow;
}
}
.bt-bg {
background-color: $bg;
border-radius: 16px;
}
.bt-header-box {
margin-top: 4px;
margin-right: 8px;
margin-left: 8px;
font-size: 24px;
color: $btblue;
}
.bt-body-box {
margin-right: 8px;
margin-left: 8px;
}
.bt-button {
&.active {
animation-name: connectanim;
animation-duration: 50ms;
animation-timing-function: linear;
animation-fill-mode: forwards;
}
&.inactive {
animation-name: disconnectanim;
animation-duration: 50ms;
animation-timing-function: linear;
animation-fill-mode: forwards;
}
&.failed {
color: $red;
}
border-radius: 16px;
padding-left: 8px;
padding-right: 8px;
padding-top: 4px;
padding-bottom: 4px;
margin-bottom: 4px;
margin-top: 4px;
font-size: 16px;
// color: $green;
}
.bt-close {
color: $red;
background-color: $inactive;
border-radius: 16px;
padding: 0px 8px 0px 7px;
margin: 0px 0px 0px 8px;
}
.bt-scan {
&.active {
animation-name: scanonanim;
animation-duration: 50ms;
animation-timing-function: linear;
animation-fill-mode: forwards;
}
&.inactive {
animation-name: scanoffanim;
animation-duration: 50ms;
animation-timing-function: linear;
animation-fill-mode: forwards;
}
color: $yellow;
background-color: $inactive;
border-radius: 16px;
padding: 2px 11px 0px 7px;
margin: 0px 0px 0px 10px;
font-size: 18px;
}

24
gBar/update.sh Normal file
View file

@ -0,0 +1,24 @@
#/bin/sh
# This script is not used by default. It is a human-readable version of the default Arch-applicable
# package command with explanations
updates="$(checkupdates)";
exitCode=$?;
if [ $exitCode -eq 127 ] ; then
# checkupdates wasn't found.
# Forward the error to gBar, so gBar can shut down the widget
# This is done, so we don't bother non-Arch systems with update checking
exit 127;
fi
if [ $exitCode -eq 2 ] ; then
# Zero packages out-of-date. We need to handle this case, since 'echo "$updates" | wc -l' would return 1
echo "0" && exit 0
fi
# We need the extra newline (-n option omitted), since 'echo -n $"updates" | wc -l' is off by one,
# since 'echo -n $"updates"' has a \0 at the end
echo "$updates" | wc -l

View file

@ -2,6 +2,7 @@ file:///home/moonleay/Downloads
file:///home/moonleay/IdeaProjects
file:///home/moonleay/RiderProjects
file:///home/moonleay/RustroverProjects
file:///home/moonleay/CLionProjects
file:///home/moonleay/Documents
file:///home/moonleay/Pictures
file:///home/moonleay/Pictures/Screenshots

View file

@ -1,9 +1,10 @@
# Autorun apps
exec-once = dunst & waybar & hyprpaper
exec-once = dunst & hyprpaper # & waybar
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = hyprctl setcursor Adwaita 24
exec-once = zsh /home/moonleay/.config/hypr/hyprland/scripts/fixXwaylandVideoBridge.sh
exec-once = solaar -w hide
exec-once = setxkbmap -model 'pc105angle' -layout 'us' -variant 'cmk_ed_us' -option'' -option 'misc:extend,lv5:caps_switch_lock,grp:shifts_toggle,compose:menu,misc:cmk_curl_dh'
exec-once = flatpak run org.kde.xwaylandvideobridge
exec-once = gBar bar 0 & gBar bar 1 & gBar bar 2
# exec-once = /usr/lib/polkit-kde-authentication-agent-1