feat: initial commit
This commit is contained in:
commit
b802ff49ab
454 files changed
+52429
No files matched your search
@@ -0,0 +1,337 @@
|
||||
{
|
||||
// -------------------------------------------------------------------------
|
||||
// Global configuration
|
||||
// -------------------------------------------------------------------------
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
//"height": 20,
|
||||
"margin-left": 10,
|
||||
"margin-bottom": 0,
|
||||
"margin-right": 10,
|
||||
"spacing": 5, // Gaps between modules (4px)
|
||||
"modules-left": [
|
||||
//"custom/rofi",
|
||||
"hyprland/workspaces",
|
||||
//"hyprland/submap",
|
||||
//"temperature",
|
||||
//"idle_inhibitor",
|
||||
//"mpd"
|
||||
"custom/spotify"
|
||||
],
|
||||
"modules-center": [
|
||||
//"hyprland/window"
|
||||
"clock#date",
|
||||
"custom/weather"
|
||||
//"custom/gammastep"
|
||||
],
|
||||
"modules-right": [
|
||||
"backlight",
|
||||
"custom/storage",
|
||||
"memory",
|
||||
"cpu",
|
||||
"temperature",
|
||||
"battery",
|
||||
//"pulseaudio",
|
||||
"wireplumber",
|
||||
"tray",
|
||||
],
|
||||
// -------------------------------------------------------------------------
|
||||
// Modules
|
||||
// -------------------------------------------------------------------------
|
||||
"custom/sp1": {
|
||||
"format": " | ",
|
||||
"tooltip": false
|
||||
},
|
||||
"custom/sp2": {
|
||||
"format": " |",
|
||||
"tooltip": false
|
||||
},
|
||||
"custom/rofi": {
|
||||
"format": "",
|
||||
"tooltip": false,
|
||||
"on-click-right": "nwg-drawer",
|
||||
"on-click": "wofi --show run",
|
||||
"on-click-middle": "pkill -9 wofi"
|
||||
},
|
||||
"custom/screenshot_t": {
|
||||
"format": " ",
|
||||
"on-click": "~/.config/hypr/scripts/screenshot_full",
|
||||
"on-click-right": "~/.config/hypr/scripts/screenshot_area"
|
||||
},
|
||||
"clock#1": {
|
||||
"format": " {:%a}",
|
||||
"tooltip": false,
|
||||
"on-click": "gsimplecal"
|
||||
},
|
||||
"clock#2": {
|
||||
"format": " {:%d-%h-%Y}",
|
||||
"tooltip": false,
|
||||
"on-click": "gsimplecal"
|
||||
},
|
||||
"clock#3": {
|
||||
"format": " {:%H:%M:%S %p}",
|
||||
"tooltip": false,
|
||||
"on-click": "gsimplecal"
|
||||
},
|
||||
"temperature": {
|
||||
// "thermal-zone": 1,
|
||||
"interval": 4,
|
||||
"hwmon-path": "/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon2/temp1_input",
|
||||
"critical-threshold": 80,
|
||||
// "format-critical": " {temperatureC}°C",
|
||||
"format-critical": " {temperatureC}°C",
|
||||
"format": "{icon} {temperatureC}°C",
|
||||
"format-icons": [
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"max-length": 7,
|
||||
"min-length": 7,
|
||||
"on-click": "xsensors"
|
||||
},
|
||||
"memory": {
|
||||
"interval": 30,
|
||||
"format": " {used:0.2f} / {total:0.0f} GB",
|
||||
"on-click": "alacritty -e btop"
|
||||
},
|
||||
"battery": {
|
||||
"interval": 2,
|
||||
"states": {
|
||||
"good": 95,
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
},
|
||||
"format": "{icon} {capacity}%",
|
||||
"format-charging": " {capacity}%",
|
||||
"format-plugged": " {capacity}%",
|
||||
"format-icons": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
]
|
||||
},
|
||||
"network": {
|
||||
"format-wifi": " {essid} ({signalStrength}%)",
|
||||
"format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
|
||||
"format-linked": "{ifname} (No IP) ",
|
||||
"format": "",
|
||||
"format-disconnected": "",
|
||||
"format-alt": "{ifname}: {ipaddr}/{cidr}",
|
||||
"on-click": "wl-copy $(ip address show up scope global | grep inet | head -n1 | cut -d/ -f 1 | tr -d [:space:] | cut -c5-)",
|
||||
"on-click-right": "wl-copy $(ip address show up scope global | grep inet6 | head -n1 | cut -d/ -f 1 | tr -d [:space:] | cut -c6-)",
|
||||
"tooltip-format": " {bandwidthUpBits} {bandwidthDownBits}\n{ifname}\n{ipaddr}/{cidr}\n",
|
||||
"tooltip-format-wifi": " {essid} {frequency}MHz\nStrength: {signaldBm}dBm ({signalStrength}%)\nIP: {ipaddr}/{cidr}\n {bandwidthUpBits} {bandwidthDownBits}",
|
||||
"interval": 10
|
||||
},
|
||||
"custom/storage": {
|
||||
"format": " {}",
|
||||
"format-alt": "{percentage}% ",
|
||||
"format-alt-click": "click-right",
|
||||
"return-type": "json",
|
||||
"interval": 60,
|
||||
"exec": "~/.config/waybar/modules/storage.sh"
|
||||
},
|
||||
"backlight": {
|
||||
"device": "intel_backlight",
|
||||
"format": "{icon} {percent}%",
|
||||
"format-alt": "{percent}% {icon}",
|
||||
"format-alt-click": "click-right",
|
||||
//"format-icons": ["", ""],
|
||||
"format-icons": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"on-scroll-down": "brightnessctl s 5%-",
|
||||
"on-scroll-up": "brightnessctl s +5%"
|
||||
},
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
},
|
||||
"tooltip": "true"
|
||||
},
|
||||
"custom/weather": {
|
||||
"format": "{}",
|
||||
"format-alt": "{alt}: {}",
|
||||
"format-alt-click": "click-right",
|
||||
"interval": 3600,
|
||||
"exec": "curl -s 'https://wttr.in/?format=1'",
|
||||
//"return-type": "json",
|
||||
//"exec": "~/.config/waybar/modules/weather.sh",
|
||||
"exec-if": "ping wttr.in -c1"
|
||||
},
|
||||
"custom/pacman": {
|
||||
"format": "<big></big> {}",
|
||||
"interval": 3600, // every hour
|
||||
"exec": "checkupdates | wc -l", // # of updates
|
||||
"exec-if": "exit 0", // always run; consider advanced run conditions
|
||||
"on-click": "alacritty -e 'paru'; pkill -SIGRTMIN+8 waybar", // update system
|
||||
"signal": 8,
|
||||
"max-length": 5,
|
||||
"min-length": 3
|
||||
},
|
||||
"custom/spotify": {
|
||||
"exec": "~/.config/waybar/mediaplayer.py --player spotify",
|
||||
"format": "{} ",
|
||||
"return-type": "json",
|
||||
"on-click": "playerctl play-pause",
|
||||
"on-scroll-up": "playerctl next",
|
||||
"on-scroll-down": "playerctl previous"
|
||||
},
|
||||
"custom/media": {
|
||||
"format": "{0} {1}",
|
||||
"return-type": "json",
|
||||
"max-length": 40,
|
||||
"format-icons": {
|
||||
"spotify": "",
|
||||
"default": "🎜"
|
||||
},
|
||||
"escape": true,
|
||||
//"exec": "~/.config/waybar/mediaplayer.py" // Script in resources folder
|
||||
// "exec": "~/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
|
||||
},
|
||||
"custom/power": {
|
||||
"format": " ",
|
||||
"tooltip": false,
|
||||
"on-click": "wlogout"
|
||||
},
|
||||
"clock": {
|
||||
"format": " {:%H:%M %e %b}",
|
||||
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
|
||||
"today-format": "<b>{}</b>"
|
||||
},
|
||||
"clock#date": {
|
||||
"format": " {:%H:%M \n %e %b}",
|
||||
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
|
||||
"today-format": "<b>{}</b>"
|
||||
},
|
||||
"custom/gammastep": {
|
||||
"interval": 5,
|
||||
"return-type": "json",
|
||||
"exec": {
|
||||
"pre": "if unit_status=\"$(systemctl --user is-active gammastep)\"; then\nstatus=\"$unit_status ($(journalctl --user -u gammastep.service -g 'Period: ' | tail -1 | cut -d ':' -f6 | xargs))\"\nelse\nstatus=\"$unit_status\"\nfi",
|
||||
"alt": "${status:-inactive}",
|
||||
"tooltip": "Gammastep is $status",
|
||||
},
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activating": " ",
|
||||
"deactivating": " ",
|
||||
"inactive": "? ",
|
||||
"active (Night)": " ",
|
||||
"active (Nighttime)": " ",
|
||||
"active (Transition (Night)": " ",
|
||||
"active (Transition (Nighttime)": " ",
|
||||
"active (Day)": " ",
|
||||
"active (Daytime)": " ",
|
||||
"active (Transition (Day)": " ",
|
||||
"active (Transition (Daytime)": " ",
|
||||
},
|
||||
"on-click": "systemctl --user is-active gammastep && systemctl --user stop gammastep || systemctl --user start gammastep",
|
||||
},
|
||||
"cpu": {
|
||||
"interval": 1,
|
||||
"format": " {usage}%",
|
||||
//"format": "{max_frequency}GHz <span color=\"darkgray\">| {usage}%</span>",
|
||||
"max-length": 13,
|
||||
"min-length": 13
|
||||
},
|
||||
"mpd": {
|
||||
"max-length": 25,
|
||||
"format": "<span foreground='#bb9af7'></span> {title}",
|
||||
"format-paused": " {title}",
|
||||
"format-stopped": "<span foreground='#bb9af7'></span>",
|
||||
"format-disconnected": "",
|
||||
"on-click": "mpc --quiet toggle",
|
||||
"on-click-right": "mpc update; mpc ls | mpc add",
|
||||
"on-click-middle": "alacritty -e ncmpcpp",
|
||||
"on-scroll-up": "mpc --quiet prev",
|
||||
"on-scroll-down": "mpc --quiet next",
|
||||
"smooth-scrolling-threshold": 5,
|
||||
"tooltip-format": "{title} - {artist} ({elapsedTime:%M:%S}/{totalTime:%H:%M:%S})"
|
||||
},
|
||||
"custom/title": {
|
||||
"format": "{}",
|
||||
"interval": 0,
|
||||
"return-type": "json",
|
||||
//"max-length": 35,
|
||||
"tooltip": false
|
||||
},
|
||||
"custom/title#name": {
|
||||
"format": "{}",
|
||||
"interval": 0,
|
||||
"return-type": "json",
|
||||
"max-length": 35,
|
||||
"exec": "$HOME/.scripts/title"
|
||||
},
|
||||
/*"custom/keyboard": {
|
||||
"format": " {}",
|
||||
"interval": 1,
|
||||
"exec": "$HOME/.config/waybar/get_kbdlayout.sh"
|
||||
},*/
|
||||
"niri/workspaces": {
|
||||
"max-length": 100,
|
||||
"separate-outputs": true
|
||||
},
|
||||
"pulseaudio": {
|
||||
"scroll-step": 3, // %, can be a float
|
||||
"format": "{icon} {volume}% {format_source}",
|
||||
"format-bluetooth": "{volume}% {icon} {format_source}",
|
||||
"format-bluetooth-muted": " {icon} {format_source}",
|
||||
"format-muted": " {format_source}",
|
||||
//"format-source": "{volume}% ",
|
||||
//"format-source-muted": "",
|
||||
"format-source": "",
|
||||
"format-source-muted": "",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"hands-free": "",
|
||||
"headset": "",
|
||||
"phone": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"default": [
|
||||
"",
|
||||
"",
|
||||
""
|
||||
]
|
||||
},
|
||||
"on-click": "pavucontrol",
|
||||
"on-click-right": "amixer sset Master toggle"
|
||||
},
|
||||
"wireplumber": {
|
||||
"on-click": "pavucontrol",
|
||||
"on-click-right": "amixer sset Master toggle 1>/dev/null",
|
||||
//on-click: "${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||
//on-scroll-down: "${wpctl} set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 0.04+";
|
||||
//on-scroll-up: "${wpctl} set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 0.04-";
|
||||
"format": "<span foreground='#fab387'>{icon}</span> {volume}%",
|
||||
"format-muted": " ",
|
||||
"format-source": "",
|
||||
"format-source-muted": "",
|
||||
//"format-muted": "<span foreground='#fab387'> </span>",
|
||||
//"format-icons": [ "<span foreground='#fab387'></span>" ]
|
||||
"format-icons": {
|
||||
"headphone": " ",
|
||||
"hands-free": " ",
|
||||
"headset": " ",
|
||||
"phone": " ",
|
||||
"portable": " ",
|
||||
"car": " ",
|
||||
"default": [
|
||||
" ",
|
||||
" ",
|
||||
" "
|
||||
]
|
||||
},
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 15,
|
||||
"spacing": 5
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
{
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
"reload_style_on_change": true,
|
||||
"modules-left": ["custom/notification","clock","custom/pacman","tray"],
|
||||
"modules-center": ["hyprland/workspaces"],
|
||||
"modules-right": ["cpu","memory","temperature","bluetooth","network","battery", "custom/spacer"],
|
||||
"hyprland/workspaces": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"active": "",
|
||||
"default": "",
|
||||
"empty": ""
|
||||
},
|
||||
"persistent-workspaces": {
|
||||
"*": [ 1,2,3,4,5 ]
|
||||
}
|
||||
},
|
||||
"custom/notification": {
|
||||
"tooltip": false,
|
||||
"format": "",
|
||||
"on-click": "swaync-client -t -sw",
|
||||
"escape": true
|
||||
},
|
||||
"clock": {
|
||||
"format": "{:%H:%M:%S} ",
|
||||
"interval": 1,
|
||||
"tooltip-format": "<tt>{calendar}</tt>",
|
||||
"calendar": {
|
||||
"format": {
|
||||
"today": "<span color='#fAfBfC'><b>{}</b></span>"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
"on-click-right": "shift_down",
|
||||
"on-click": "shift_up"
|
||||
}
|
||||
},
|
||||
"network": {
|
||||
"format-wifi": " ",
|
||||
"format-ethernet":" ",
|
||||
"format-disconnected": " ",
|
||||
"tooltip-format-disconnected": "Error",
|
||||
"tooltip-format-wifi": "{essid} ({signalStrength}%) ",
|
||||
"tooltip-format-ethernet": "{ifname} 🖧 ",
|
||||
"on-click": "kitty nmtui"
|
||||
},
|
||||
"bluetooth": {
|
||||
"format-on": "",
|
||||
"format-off": "BT-off",
|
||||
"format-disabled": "",
|
||||
"format-connected-battery": "{device_battery_percentage}% ",
|
||||
"format-alt": "{device_alias} ",
|
||||
"tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected",
|
||||
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}",
|
||||
"tooltip-format-enumerate-connected": "{device_alias}\n{device_address}",
|
||||
"tooltip-format-enumerate-connected-battery": "{device_alias}\n{device_address}\n{device_battery_percentage}%",
|
||||
"on-click-right": "blueman-manager"
|
||||
},
|
||||
"battery": {
|
||||
"interval":30,
|
||||
"states": {
|
||||
"good": 95,
|
||||
"warning": 30,
|
||||
"critical": 20
|
||||
},
|
||||
"format": "{capacity}% {icon}",
|
||||
"format-charging": "{capacity}% ",
|
||||
"format-plugged": "{capacity}% ",
|
||||
"format-alt": "{time} {icon}",
|
||||
"format-icons": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
]
|
||||
},
|
||||
"custom/pacman": {
|
||||
"format": " {}",
|
||||
"interval": 30,
|
||||
"exec": "checkupdates | wc -l",
|
||||
"exec-if": "exit 0",
|
||||
"on-click": "kitty sh -c 'yay -Syu; echo Done - Press enter to exit; read'; pkill -SIGRTMIN+8 waybar",
|
||||
"signal": 8,
|
||||
"tooltip": false
|
||||
},
|
||||
"cpu": {
|
||||
"format": " {usage}%",
|
||||
"tooltip": true
|
||||
},
|
||||
"memory": {
|
||||
"format": " {used}GB"
|
||||
},
|
||||
"temperature": {
|
||||
"critical-threshold": 80,
|
||||
"format": " {}°C",
|
||||
"hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input"
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 14,
|
||||
"spacing": 10
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
@define-color rosewater #f5e0dc;
|
||||
@define-color flamingo #f2cdcd;
|
||||
@define-color pink #f5c2e7;
|
||||
@define-color mauve #cba6f7;
|
||||
@define-color red #f38ba8;
|
||||
@define-color maroon #eba0ac;
|
||||
@define-color peach #fab387;
|
||||
@define-color yellow #f9e2af;
|
||||
@define-color green #a6e3a1;
|
||||
@define-color teal #94e2d5;
|
||||
@define-color sky #89dceb;
|
||||
@define-color sapphire #74c7ec;
|
||||
@define-color blue #89b4fa;
|
||||
@define-color lavender #b4befe;
|
||||
@define-color text #cdd6f4;
|
||||
@define-color subtext1 #bac2de;
|
||||
@define-color subtext0 #a6adc8;
|
||||
@define-color overlay2 #9399b2;
|
||||
@define-color overlay1 #7f849c;
|
||||
@define-color overlay0 #6c7086;
|
||||
@define-color surface2 #585b70;
|
||||
@define-color surface1 #45475a;
|
||||
@define-color surface0 #313244;
|
||||
@define-color base #1e1e2e;
|
||||
@define-color mantle #181825;
|
||||
@define-color crust #11111b;
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
import imaplib
|
||||
|
||||
import mailsecrets
|
||||
|
||||
def getmails(username, password, server):
|
||||
imap = imaplib.IMAP4_SSL(server, 993)
|
||||
imap.login(username, password)
|
||||
imap.select('INBOX')
|
||||
ustatus, uresponse = imap.uid('search', None, 'UNSEEN')
|
||||
if ustatus == 'OK':
|
||||
unread_msg_nums = uresponse[0].split()
|
||||
else:
|
||||
unread_msg_nums = []
|
||||
|
||||
fstatus, fresponse = imap.uid('search', None, 'FLAGGED')
|
||||
if fstatus == 'OK':
|
||||
flagged_msg_nums = fresponse[0].split()
|
||||
else:
|
||||
flagged_msg_nums = []
|
||||
|
||||
return [len(unread_msg_nums), len(flagged_msg_nums)]
|
||||
|
||||
ping = os.system("ping " + mailsecrets.server + " -c1 > /dev/null 2>&1")
|
||||
if ping == 0:
|
||||
mails = getmails(mailsecrets.username, mailsecrets.password, mailsecrets.server)
|
||||
text = ''
|
||||
alt = ''
|
||||
|
||||
if mails[0] > 0:
|
||||
text = alt = str(mails[0])
|
||||
if mails[1] > 0:
|
||||
alt = str(mails[1]) + " " + alt
|
||||
else:
|
||||
exit(1)
|
||||
|
||||
print('{"text":"' + text + '", "alt": "' + alt + '"}')
|
||||
|
||||
else:
|
||||
exit(1)
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
class=$(playerctl metadata --player=spotify --format '{{lc(status)}}')
|
||||
icon=""
|
||||
|
||||
if [[ $class == "playing" ]]; then
|
||||
info=$(playerctl metadata --player=spotify --format '{{artist}} - {{title}}')
|
||||
if [[ ${#info} > 40 ]]; then
|
||||
info=$(echo $info | cut -c1-40)"..."
|
||||
fi
|
||||
text=$info" "$icon
|
||||
elif [[ $class == "paused" ]]; then
|
||||
text=$icon
|
||||
elif [[ $class == "stopped" ]]; then
|
||||
text=""
|
||||
fi
|
||||
|
||||
echo -e "{\"text\":\""$text"\", \"class\":\""$class"\"}"
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
mount="/"
|
||||
warning=20
|
||||
critical=10
|
||||
|
||||
df -h -P -l "$mount" | awk -v warning=$warning -v critical=$critical '
|
||||
/\/.*/ {
|
||||
text=$4
|
||||
tooltip="Filesystem: "$1"\rSize: "$2"\rUsed: "$3"\rAvail: "$4"\rUse%: "$5"\rMounted on: "$6
|
||||
use=$5
|
||||
exit 0
|
||||
}
|
||||
END {
|
||||
class=""
|
||||
gsub(/%$/,"",use)
|
||||
if ((100 - use) < critical) {
|
||||
class="critical"
|
||||
} else if ((100 - use) < warning) {
|
||||
class="warning"
|
||||
}
|
||||
print "{\"text\":\""text"\", \"percentage\":"use",\"tooltip\":\""tooltip"\", \"class\":\""class"\"}"
|
||||
}
|
||||
'
|
||||
Executable
+79
@@ -0,0 +1,79 @@
|
||||
#!/bin/bash
|
||||
|
||||
cachedir=~/.cache/rbn
|
||||
cachefile=${0##*/}-$1
|
||||
|
||||
if [ ! -d $cachedir ]; then
|
||||
mkdir -p $cachedir
|
||||
fi
|
||||
|
||||
if [ ! -f $cachedir/$cachefile ]; then
|
||||
touch $cachedir/$cachefile
|
||||
fi
|
||||
|
||||
# Save current IFS
|
||||
SAVEIFS=$IFS
|
||||
# Change IFS to new line.
|
||||
IFS=$'\n'
|
||||
|
||||
cacheage=$(($(date +%s) - $(stat -c '%Y' "$cachedir/$cachefile")))
|
||||
if [ $cacheage -gt 1740 ] || [ ! -s $cachedir/$cachefile ]; then
|
||||
data=($(curl -s https://en.wttr.in/$1\?0qnT 2>&1))
|
||||
echo ${data[0]} | cut -f1 -d, > $cachedir/$cachefile
|
||||
echo ${data[1]} | sed -E 's/^.{15}//' >> $cachedir/$cachefile
|
||||
echo ${data[2]} | sed -E 's/^.{15}//' >> $cachedir/$cachefile
|
||||
fi
|
||||
|
||||
weather=($(cat $cachedir/$cachefile))
|
||||
|
||||
# Restore IFSClear
|
||||
IFS=$SAVEIFS
|
||||
|
||||
temperature=$(echo ${weather[2]} | sed -E 's/([[:digit:]])+\.\./\1 to /g')
|
||||
|
||||
#echo ${weather[1]##*,}
|
||||
|
||||
# https://fontawesome.com/icons?s=solid&c=weather
|
||||
case $(echo ${weather[1]##*,} | tr '[:upper:]' '[:lower:]') in
|
||||
"clear" | "sunny")
|
||||
condition=""
|
||||
;;
|
||||
"partly cloudy")
|
||||
condition="杖"
|
||||
;;
|
||||
"cloudy")
|
||||
condition=""
|
||||
;;
|
||||
"overcast")
|
||||
condition=""
|
||||
;;
|
||||
"mist" | "fog" | "freezing fog")
|
||||
condition=""
|
||||
;;
|
||||
"patchy rain possible" | "patchy light drizzle" | "light drizzle" | "patchy light rain" | "light rain" | "light rain shower" | "rain")
|
||||
condition=""
|
||||
;;
|
||||
"moderate rain at times" | "moderate rain" | "heavy rain at times" | "heavy rain" | "moderate or heavy rain shower" | "torrential rain shower" | "rain shower")
|
||||
condition=""
|
||||
;;
|
||||
"patchy snow possible" | "patchy sleet possible" | "patchy freezing drizzle possible" | "freezing drizzle" | "heavy freezing drizzle" | "light freezing rain" | "moderate or heavy freezing rain" | "light sleet" | "ice pellets" | "light sleet showers" | "moderate or heavy sleet showers")
|
||||
condition="ﭽ"
|
||||
;;
|
||||
"blowing snow" | "moderate or heavy sleet" | "patchy light snow" | "light snow" | "light snow showers")
|
||||
condition="流"
|
||||
;;
|
||||
"blizzard" | "patchy moderate snow" | "moderate snow" | "patchy heavy snow" | "heavy snow" | "moderate or heavy snow with thunder" | "moderate or heavy snow showers")
|
||||
condition="ﰕ"
|
||||
;;
|
||||
"thundery outbreaks possible" | "patchy light rain with thunder" | "moderate or heavy rain with thunder" | "patchy light snow with thunder")
|
||||
condition=""
|
||||
;;
|
||||
*)
|
||||
condition=""
|
||||
echo -e "{\"text\":\""$condition"\", \"alt\":\""${weather[0]}"\", \"tooltip\":\""${weather[0]}: $temperature ${weather[1]}"\"}"
|
||||
;;
|
||||
esac
|
||||
|
||||
#echo $temp $condition
|
||||
|
||||
echo -e "{\"text\":\""$temperature $condition"\", \"alt\":\""${weather[0]}"\", \"tooltip\":\""${weather[0]}: $temperature ${weather[1]}"\"}"
|
||||
@@ -0,0 +1,158 @@
|
||||
@import "mocha.css";
|
||||
|
||||
* {
|
||||
font-size:15px;
|
||||
font-family: "FiraCode Nerd Font";
|
||||
}
|
||||
window#waybar{
|
||||
all:unset;
|
||||
}
|
||||
.modules-left {
|
||||
padding:7px;
|
||||
margin:10 0 5 10;
|
||||
border-radius:10px;
|
||||
background: alpha(@base,.6);
|
||||
box-shadow: 0px 0px 2px rgba(0, 0, 0, .6);
|
||||
}
|
||||
.modules-center {
|
||||
padding:7px;
|
||||
margin:10 0 5 0;
|
||||
border-radius:10px;
|
||||
background: alpha(@base,.6);
|
||||
box-shadow: 0px 0px 2px rgba(0, 0, 0, .6);
|
||||
}
|
||||
.modules-right {
|
||||
padding:7px;
|
||||
margin: 10 10 5 0;
|
||||
border-radius:10px;
|
||||
background: alpha(@base,.6);
|
||||
box-shadow: 0px 0px 2px rgba(0, 0, 0, .6);
|
||||
}
|
||||
tooltip {
|
||||
background:@base;
|
||||
color: @text;
|
||||
}
|
||||
#clock:hover, #custom-pacman:hover, #custom-notification:hover,#bluetooth:hover,#network:hover,#battery:hover, #cpu:hover,#memory:hover,#temperature:hover{
|
||||
transition: all .3s ease;
|
||||
color:@overlay0;
|
||||
}
|
||||
#custom-notification {
|
||||
padding: 0px 5px;
|
||||
transition: all .3s ease;
|
||||
color:@text;
|
||||
}
|
||||
#clock{
|
||||
padding: 0px 5px;
|
||||
color:@mauve;
|
||||
transition: all .3s ease;
|
||||
}
|
||||
#custom-pacman{
|
||||
padding: 0px 5px;
|
||||
transition: all .3s ease;
|
||||
color:@text;
|
||||
|
||||
}
|
||||
#workspaces {
|
||||
padding: 0px 5px;
|
||||
}
|
||||
#workspaces button {
|
||||
all:unset;
|
||||
padding: 0px 5px;
|
||||
color: alpha(@overlay0,.4);
|
||||
transition: all .2s ease;
|
||||
}
|
||||
#workspaces button:hover {
|
||||
color:rgba(0,0,0,0);
|
||||
border: none;
|
||||
text-shadow: 0px 0px 1.5px rgba(0, 0, 0, .5);
|
||||
transition: all 1s ease;
|
||||
}
|
||||
#workspaces button.active {
|
||||
color: @flamingo;
|
||||
border: none;
|
||||
text-shadow: 0px 0px 2px rgba(0, 0, 0, .5);
|
||||
}
|
||||
#workspaces button.empty {
|
||||
color: rgba(0,0,0,0);
|
||||
border: none;
|
||||
text-shadow: 0px 0px 1.5px rgba(0, 0, 0, .2);
|
||||
}
|
||||
#workspaces button.empty:hover {
|
||||
color: rgba(0,0,0,0);
|
||||
border: none;
|
||||
text-shadow: 0px 0px 1.5px rgba(0, 0, 0, .5);
|
||||
transition: all 1s ease;
|
||||
}
|
||||
#workspaces button.empty.active {
|
||||
color: @overlay0;
|
||||
border: none;
|
||||
text-shadow: 0px 0px 2px rgba(0, 0, 0, .5);
|
||||
}
|
||||
#bluetooth{
|
||||
padding: 0px 5px;
|
||||
transition: all .3s ease;
|
||||
color:@flamingo;
|
||||
}
|
||||
#network{
|
||||
padding: 0px 5px;
|
||||
transition: all .3s ease;
|
||||
color:@peach;
|
||||
}
|
||||
#battery{
|
||||
padding: 0px 5px;
|
||||
transition: all .3s ease;
|
||||
color:@sky;
|
||||
}
|
||||
#battery.charging {
|
||||
color: @green;
|
||||
}
|
||||
#battery.warning:not(.charging) {
|
||||
color: @yellow;
|
||||
}
|
||||
#battery.critical:not(.charging) {
|
||||
color: @red;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
#group-expand{
|
||||
padding: 0px 5px;
|
||||
transition: all .3s ease;
|
||||
}
|
||||
#custom-expand{
|
||||
padding: 0px 5px;
|
||||
color:alpha(@text,.2);
|
||||
text-shadow: 0px 0px 2px rgba(0, 0, 0, .7);
|
||||
transition: all .3s ease;
|
||||
}
|
||||
#custom-expand:hover{
|
||||
color:rgba(255,255,255,.2);
|
||||
text-shadow: 0px 0px 2px rgba(255, 255, 255, .5);
|
||||
}
|
||||
#custom-colorpicker{
|
||||
padding: 0px 5px;
|
||||
}
|
||||
#cpu,#memory,#temperature{
|
||||
padding: 0px 5px;
|
||||
transition: all .3s ease;
|
||||
color:@rosewater;
|
||||
}
|
||||
#custom-endpoint{
|
||||
color:transparent;
|
||||
text-shadow: 0px 0px 1.5px rgba(0, 0, 0, 1);
|
||||
}
|
||||
#tray{
|
||||
padding: 0px 5px;
|
||||
transition: all .3s ease;
|
||||
}
|
||||
#tray menu * {
|
||||
padding: 0px 5px;
|
||||
transition: all .3s ease;
|
||||
}
|
||||
|
||||
#tray menu separator {
|
||||
padding: 0px 5px;
|
||||
transition: all .3s ease;
|
||||
}
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Terminate already running bar instances
|
||||
killall -q waybar
|
||||
|
||||
# Wait until the processes have been shut down
|
||||
while pgrep -x waybar >/dev/null; do sleep 1; done
|
||||
|
||||
# Launch main
|
||||
waybar &
|
||||
Reference in new issue
Block a user