Made the waybar a sidebar

This commit is contained in:
Michel Fedde 2025-04-13 18:06:20 +02:00
parent 75f6e5bb47
commit 6980360fe4
10 changed files with 121 additions and 50 deletions

View file

@ -23,9 +23,9 @@ IFS=$'\n'
cacheage=$(($(date +%s) - $(stat -c '%Y' "$cachedir/$cachefile"))) cacheage=$(($(date +%s) - $(stat -c '%Y' "$cachedir/$cachefile")))
if [ $cacheage -gt 1740 ] || [ ! -s $cachedir/$cachefile ]; then if [ $cacheage -gt 1740 ] || [ ! -s $cachedir/$cachefile ]; then
data=($(curl -s https://en.wttr.in/"$city"$1\?0qnT 2>&1)) data=($(curl -s https://en.wttr.in/"$city"$1\?0qnT 2>&1))
echo ${data[0]} | cut -f1 -d, > $cachedir/$cachefile echo ${data[0]} | cut -f1 -d, >$cachedir/$cachefile
echo ${data[1]} | sed -E 's/^.{15}//' >> $cachedir/$cachefile echo ${data[1]} | sed -E 's/^.{15}//' >>$cachedir/$cachefile
echo ${data[2]} | sed -E 's/^.{15}//' >> $cachedir/$cachefile echo ${data[2]} | sed -E 's/^.{15}//' >>$cachedir/$cachefile
fi fi
weather=($(cat $cachedir/$cachefile)) weather=($(cat $cachedir/$cachefile))
@ -84,4 +84,5 @@ echo -e "{\"text\":\""$temperature $condition"\", \"alt\":\""${weather[0]}"\", \
cached_weather="$temperature \n$condition ${weather[1]}" cached_weather="$temperature \n$condition ${weather[1]}"
echo -e $cached_weather > ~/.cache/.weather_cache echo -e $cached_weather >~/.cache/.weather_cache

View file

@ -2,11 +2,6 @@
swaync-client --reload-css swaync-client --reload-css
# Reload waybar
killall waybar
killall pactl
nohup waybar &
# Reload hyprswitch # Reload hyprswitch
killall hyprswitch killall hyprswitch
nohup hyprswitch init --custom-css "$HOME/.config/hyprswitch/style.css" & nohup hyprswitch init --custom-css "$HOME/.config/hyprswitch/style.css" &

View file

@ -167,6 +167,16 @@
"interval": "once", "interval": "once",
"tooltip": false "tooltip": false
}, },
"custom/hoz-separator": {
"format": " ",
"interval": "once",
"tooltip": false
},
"custom/hoz-separator-dotted": {
"format": " ",
"interval": "once",
"tooltip": false
},
"custom/separator#line": { "custom/separator#line": {
"format": "|", "format": "|",
"interval": "once", "interval": "once",
@ -188,7 +198,14 @@
"tooltip": false "tooltip": false
}, },
"custom/pulseaudio-control": { "custom/pulseaudio-control": {
"exec": "pulseaudio-control --icons-volume ' , ' --icon-muted ' ' --node-nicknames-from 'device.nick' --node-nickname 'alsa_output.pci-0000_08_00.0.iec958-ac3-surround-51.monitor:Speaker' --node-nickname 'alsa_output.usb-Razer_Razer_Nari-00.pro-output-1:Headphones' listen", "exec": "$HOME/.config/waybar/scripts/pulseaudio.sh text",
"on-click": "pulseaudio-control --node-blacklist 'alsa_output.usb-Razer_Razer_Nari-00.pro-output-0' next-node",
"on-click-middle": "exec pavucontrol &",
"on-click-right": "pulseaudio-control togmute"
},
"custom/pulseaudio-control#icons": {
"exec": "$HOME/.config/waybar/scripts/pulseaudio.sh icons",
"on-click": "pulseaudio-control --node-blacklist 'alsa_output.usb-Razer_Razer_Nari-00.pro-output-0' next-node", "on-click": "pulseaudio-control --node-blacklist 'alsa_output.usb-Razer_Razer_Nari-00.pro-output-0' next-node",
"on-click-middle": "exec pavucontrol &", "on-click-middle": "exec pavucontrol &",
"on-click-right": "pulseaudio-control togmute" "on-click-right": "pulseaudio-control togmute"

View file

@ -74,8 +74,7 @@
"transition-left-to-right": true "transition-left-to-right": true
}, },
"modules": [ "modules": [
"custom/pulseaudio-control", "custom/pulseaudio-control#icons",
"custom/separator#blank_2",
"pulseaudio#microphone", "pulseaudio#microphone",
] ]
}, },

View file

@ -5,11 +5,27 @@
"layer": "overlay", "layer": "overlay",
"exclusive": false, "exclusive": false,
"position": "top", "position": "right",
"reload_style_on_change": true, "reload_style_on_change": true,
"name": "semi-hidden", "name": "semi-hidden",
"id": "semi-hidden", "id": "semi-hidden",
"start_hidden": true, "start_hidden": true,
"margin-top": 0 "margin-right": 0,
"modules-left": [
"group/app_drawer",
"custom/hoz-separator-dotted",
"group/mobo_drawer",
],
"modules-right": [
"group/laptop",
"custom/hoz-separator",
"tray",
"group/audio#pulsecontrol",
"custom/hoz-separator-dotted",
"group/status",
"custom/swaync",
],
} }

View file

@ -0,0 +1,28 @@
#!/bin/env sh
SPEAKER_ICON="󰓃 "
HEADPHONE_ICON=" "
declare -A ICON_DEVICES
ICON_DEVICES[alsa_output.usb-Razer_Razer_Nari-00.pro-output-1]=$HEADPHONE_ICON
ICON_DEVICES[alsa_output.pci-0000_08_00.0.iec958-stereo]=$SPEAKER_ICON
ICON_VOLMUES=" , "
ICON_VOLUME_MUTED=" "
NICKNAME_SOURCE="device.nick"
FORMAT_DEFAULT='$VOL_ICON ${VOL_LEVEL}% $ICON_NODE $NODE_NICKNAME'
FORMAT_ICONS='$VOL_ICON $ICON_NODE $NODE_NICKNAME'
icon_devices_parameters=""
for device in "${!ICON_DEVICES[@]}"; do
icon_devices_parameters="${icon_devices_parameters} --node-nickname "${device}:${ICON_DEVICES[$device]}""
done
format=$FORMAT_DEFAULT
if [[ $1 == 'icons' ]]; then
format=$FORMAT_ICONS
fi
pulseaudio-control ${icon_devices_parameters} --icons-volume "${ICON_VOLMUES}" --icon-muted "${ICON_VOLUME_MUTED}" --node-nicknames-from "${NICKNAME_SOURCE}" --format "${format}" --color-muted "" listen

View file

@ -107,3 +107,17 @@
#custom-updates.pending-updates { #custom-updates.pending-updates {
background-color: dodgerblue; background-color: dodgerblue;
} }
#custom-hoz-separator {
font-size: 0px;
border-radius: 0;
border-bottom: 1px solid $foreground
}
#custom-hoz-separator-dotted {
padding: 0 3px;
font-size: 0px;
border-radius: 0;
border-bottom: 1px dashed $foreground
}

View file

@ -29,15 +29,15 @@ window {
window.semi-hidden { window.semi-hidden {
background-color: transparent; background-color: transparent;
* {
border-radius: 0 0 $border-radius $border-radius;
}
.modules-left, .modules-center, .modules-right { .modules-left, .modules-center, .modules-right {
border-radius: $border-radius 0 0 $border-radius;
border-right: none;
background-color: $background; background-color: $background;
border-bottom: 1px solid rgba($foreground, 0.4); border-bottom: 1px solid rgba($foreground, 0.4);
border-left: 1px solid rgba($foreground, 0.4); border-left: 1px solid rgba($foreground, 0.4);
border-right: 1px solid rgba($foreground, 0.4); border-top: 1px solid rgba($foreground, 0.4);
} }
.modules-center { .modules-center {

View file

@ -5,13 +5,13 @@ foundSymlinks=false
for file in $(yadm diff --name-only --cached); do for file in $(yadm diff --name-only --cached); do
lsResult=$(ls -1 -l "$file") lsResult=$(ls -1 -l "$file")
if [[ $lsResult != *"->"* ]]; then if [[ $lsResult != *"->"* ]]; then
break continue
fi fi
symlinkTarget=$(echo "$lsResult" | awk '{print $NF}') symlinkTarget=$(echo "$lsResult" | awk '{print $NF}')
if [[ $lsResult != *"##"* ]]; then if [[ $lsResult != *"##"* ]]; then
break continue
fi fi
echo "$file is a YADM symlink. Telling git to ignore it..." echo "$file is a YADM symlink. Telling git to ignore it..."

1
.gitignore vendored
View file

@ -62,3 +62,4 @@
.config/waybar/Output.config.json .config/waybar/Output.config.json
.config/evremap/evremap.toml .config/evremap/evremap.toml
.config/hypr/config/Autostart.conf .config/hypr/config/Autostart.conf
.config/yadm/bootstrap.d/02-AMDGPUDrivers.sh