add batman beyond config
This commit is contained in:
@@ -0,0 +1,339 @@
|
||||
;==========================================================
|
||||
;
|
||||
;
|
||||
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
|
||||
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
|
||||
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
|
||||
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
|
||||
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
|
||||
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
|
||||
;
|
||||
;
|
||||
; To learn more about how to configure Polybar
|
||||
; go to https://github.com/polybar/polybar
|
||||
;
|
||||
; The README contains a lot of information
|
||||
;
|
||||
;==========================================================
|
||||
|
||||
[colors]
|
||||
background = #FF0000
|
||||
background-alt = #000000
|
||||
foreground = #000000
|
||||
foreground-alt = #FF0000
|
||||
primary = #00FF00
|
||||
secondary = #0000FF
|
||||
alert = #FF0000
|
||||
white = #FFFFFF
|
||||
|
||||
[bar/example]
|
||||
monitor = ${env:MONITOR:}
|
||||
width = 100%
|
||||
height = 22
|
||||
radius = 9.0
|
||||
fixed-center = true
|
||||
top = yes
|
||||
bottom = no
|
||||
override-redirect = false
|
||||
|
||||
foreground = ${colors.foreground-alt}
|
||||
background = ${colors.background-alt}
|
||||
|
||||
; Under-/overline pixel size and argb color
|
||||
; Individual values can be defined using:
|
||||
; {overline,underline}-size
|
||||
; {overline,underline}-color
|
||||
line-size = 1
|
||||
line-color = #dfdfdf
|
||||
|
||||
border-top-size = 0
|
||||
border-bottom-size = 0
|
||||
border-left-size = 0
|
||||
border-right-size = 0
|
||||
|
||||
padding-left = 0
|
||||
padding-right = 0
|
||||
|
||||
module-margin-left = 0
|
||||
module-margin-right = 0
|
||||
|
||||
font-0 = Hack:pixelsize=9;3
|
||||
font-2 = "Wuncon Siji:pixelsize=10;3"
|
||||
font-1 = Weather Icons:style=Regular:size=10;2
|
||||
font-3 = FontAwesome5Free:style=Solid:pixelsize=10;3
|
||||
font-4 = FontAwesome5Brands:style=Solid:pixelsize=10;3
|
||||
font-5 = "batman logo evolution tfb:style=Regular:pixelsize=25;3"
|
||||
font-6 = "Material Design Icons:style=Regular:pixelsize=15;3"
|
||||
|
||||
modules-left = i3 sp0
|
||||
modules-right = network sp1 battery sp2 temp sp1 linux-ver sp2 date sp2
|
||||
;modules-right = volume sp1 network sp1 battery sp2 temp sp1 linux-ver sp2 date sp2
|
||||
modules-center = bb
|
||||
|
||||
tray-position = right
|
||||
tray-padding = 0
|
||||
tray-detached = false
|
||||
tray-maxsize = 14
|
||||
tray-scale = 1.0
|
||||
tray-background = ${colors.background-alt}
|
||||
tray-foreground = ${colors.foreground-alt}
|
||||
tray-offset-x = 0
|
||||
tray-offset-y = 0
|
||||
|
||||
wm-restack = i3
|
||||
|
||||
scroll-up = #i3.next
|
||||
scroll-down = #i3.prev
|
||||
|
||||
cursor-click = pointer
|
||||
|
||||
[module/sp0]
|
||||
type = custom/text
|
||||
content = "| "
|
||||
content-foreground = #93A1A1
|
||||
content-background = ${colors.background-alt}
|
||||
|
||||
[module/sp1]
|
||||
type = custom/text
|
||||
content = " | "
|
||||
content-foreground = #93A1A1
|
||||
content-background = ${colors.background-alt}
|
||||
|
||||
[module/sp2]
|
||||
type = custom/text
|
||||
content = " |"
|
||||
content-foreground = #93A1A1
|
||||
content-background = ${colors.background-alt}
|
||||
|
||||
[module/bb]
|
||||
type = custom/text
|
||||
label = %{T6}O%{T-}
|
||||
click-left = sleep 0.1 && i3lock -i ~/Downloads/bb.jpeg -F --verif-text="" --ring-color=ff000030 --ringver-color=00000000 --insidever-color=00000000 --keyhl-color=00000090 --bshl-color=666666ff --time-pos="ix:iy+150" --noinput-text=""
|
||||
|
||||
|
||||
[module/i3]
|
||||
type = internal/i3
|
||||
format = <label-state> <label-mode>
|
||||
index-sort = true
|
||||
wrapping-scroll = false
|
||||
strip-wsnumbers = false
|
||||
enable-click = false
|
||||
enable-scroll = false
|
||||
|
||||
label-mode = %mode%
|
||||
label-mode-padding = 1
|
||||
label-mode-foreground = ${colors.foreground-alt}
|
||||
label-mode-background = ${colors.background-alt}
|
||||
|
||||
; focused = Active workspace on focused monitor
|
||||
label-focused = %index%
|
||||
label-focused-foreground = ${colors.foreground}
|
||||
label-focused-background = ${colors.background}
|
||||
label-focused-underline = ${colors.foreground-alt}
|
||||
label-focused-padding = 1
|
||||
|
||||
; unfocused = Inactive workspace on any monitor
|
||||
label-unfocused = %index%
|
||||
label-unfocused-padding = ${self.label-focused-padding}
|
||||
label-unfocused-foreground = ${colors.foreground-alt}
|
||||
label-unfocused-background = ${colors.background-alt}
|
||||
|
||||
; visible = Active workspace on unfocused monitor
|
||||
label-visible = %index%
|
||||
label-visible-foreground = ${self.label-focused-background}
|
||||
label-visible-background = ${self.label-focused-foreground}
|
||||
label-visible-underline = ${self.label-focused-underline}
|
||||
label-visible-padding = ${self.label-focused-padding}
|
||||
|
||||
; urgent = Workspace with urgency hint set
|
||||
label-urgent = %index%
|
||||
label-urgent-foreground = ${colors.foreground}
|
||||
label-urgent-background = ${colors.alert}
|
||||
label-urgent-padding = 1
|
||||
|
||||
; Separator in between workspaces
|
||||
label-separator =
|
||||
label-separator-padding = 0
|
||||
label-separator-foreground = #fff
|
||||
|
||||
[module/linux-ver]
|
||||
type = custom/script
|
||||
exec = uname -r
|
||||
interval = 600
|
||||
|
||||
[module/battery]
|
||||
type = internal/battery
|
||||
full-at = 85
|
||||
low-at = 10
|
||||
battery = BAT0
|
||||
adapter = AC
|
||||
poll-interval = 5
|
||||
|
||||
format-discharging = <label-discharging> <ramp-capacity>
|
||||
label-discharging = %percentage%%
|
||||
ramp-capacity-0 =
|
||||
ramp-capacity-0-foreground = #FFFFFF
|
||||
ramp-capacity-1 =
|
||||
ramp-capacity-1-foreground = #FFFFFF
|
||||
ramp-capacity-2 =
|
||||
ramp-capacity-2-foreground = #FFFFFF
|
||||
ramp-capacity-3 =
|
||||
ramp-capacity-3-foreground = #FFFFFF
|
||||
ramp-capacity-4 =
|
||||
ramp-capacity-4-foreground = #FFFFFF
|
||||
ramp-capacity-5 =
|
||||
ramp-capacity-5-foreground = #FFFFFF
|
||||
ramp-capacity-6 =
|
||||
ramp-capacity-6-foreground = #FFFFFF
|
||||
ramp-capacity-7 =
|
||||
ramp-capacity-7-foreground = #FFFFFF
|
||||
ramp-capacity-8 =
|
||||
ramp-capacity-8-foreground = #FFFFFF
|
||||
ramp-capacity-9 =
|
||||
ramp-capacity-9-foreground = #FFFFFF
|
||||
|
||||
format-charging = <label-charging> <animation-charging>
|
||||
label-charging = %percentage%%
|
||||
animation-charging-0 =
|
||||
animation-charging-0-foreground = #FFFFFF
|
||||
animation-charging-1 =
|
||||
animation-charging-1-foreground = #FFFFFF
|
||||
animation-charging-2 =
|
||||
animation-charging-2-foreground = #FFFFFF
|
||||
animation-charging-3 =
|
||||
animation-charging-3-foreground = #FFFFFF
|
||||
animation-charging-4 =
|
||||
animation-charging-4-foreground = #FFFFFF
|
||||
animation-charging-5 =
|
||||
animation-charging-5-foreground = #FFFFFF
|
||||
animation-charging-6 =
|
||||
animation-charging-6-foreground = #FFFFFF
|
||||
animation-charging-7 =
|
||||
animation-charging-7-foreground = #FFFFFF
|
||||
animation-charging-8 =
|
||||
animation-charging-8-foreground = #FFFFFF
|
||||
animation-charging-9 =
|
||||
animation-charging-9-foreground = #FFFFFF
|
||||
animation-charging-framerate = 2000
|
||||
|
||||
format-low = <label-low> <animation-low>
|
||||
label-low = %percentage%%
|
||||
animation-low-0 =
|
||||
animation-low-1 = "%{F#00000000}%{F-}"
|
||||
animation-low-framerate = 500
|
||||
|
||||
format-full = <label-full>
|
||||
label-full = %percentage%% %{F#ffffff}%{F-}
|
||||
|
||||
[module/network]
|
||||
type = internal/network
|
||||
interface = wlan0
|
||||
|
||||
format-connected = <label-connected> <ramp-signal>
|
||||
label-connected = %essid% %{F#FFFFFF}%{F-}%netspeed%
|
||||
ramp-signal-0 =
|
||||
ramp-signal-0-foreground = #FFFFFF
|
||||
ramp-signal-1 =
|
||||
ramp-signal-1-foreground = #FFFFFF
|
||||
ramp-signal-2 =
|
||||
ramp-signal-2-foreground = #FFFFFF
|
||||
ramp-signal-3 =
|
||||
ramp-signal-3-foreground = #FFFFFF
|
||||
ramp-signal-4 =
|
||||
ramp-signal-4-foreground = #FFFFFF
|
||||
|
||||
format-disconnected = <label-disconnected>
|
||||
label-disconnected =
|
||||
|
||||
[module/tempy]
|
||||
type = internal/temperature
|
||||
interval = 0.5
|
||||
thermal-zone = 0
|
||||
zone-type = x86_pkg_temp
|
||||
hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input
|
||||
base-tempertaure = 25
|
||||
warn-temperature = 70
|
||||
units = true
|
||||
|
||||
format = <label> <ramp>
|
||||
format-warn = <label> <ramp>
|
||||
|
||||
label = %temperature-f%
|
||||
label-foreground = #FF0000
|
||||
|
||||
label-warn = %temperature-f%
|
||||
label-warn-foreground = #FF0000
|
||||
|
||||
ramp-0 =
|
||||
ramp-1 =
|
||||
ramp-2 =
|
||||
ramp-3 =
|
||||
ramp-foreground = #FFFFFF
|
||||
|
||||
[module/temp]
|
||||
type = custom/script
|
||||
format-prefix = ""
|
||||
exec = ~/.config/polybar/scripts/cpu_temp.sh
|
||||
label = %output% %{F#FFFFFF}%{F-}
|
||||
interval = 0.5
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 1
|
||||
|
||||
time = "%a %d %I:%M %P"
|
||||
|
||||
format-prefix = " "
|
||||
format-prefix-foreground = ${colors.foreground-alt}
|
||||
format-prefix-background = ${colors.background-alt}
|
||||
|
||||
label = %time%
|
||||
label-foreground = ${colors.foreground-alt}
|
||||
label-background = ${colors.background-alt}
|
||||
|
||||
[module/volume]
|
||||
type = internal/alsa
|
||||
|
||||
; Soundcard to be used
|
||||
; Usually in the format hw:# where # is the card number
|
||||
; You can find the different card numbers in `/proc/asound/cards`
|
||||
master-soundcard = default
|
||||
speaker-soundcard = default
|
||||
headphone-soundcard = default
|
||||
|
||||
; Name of the master, speaker and headphone mixers
|
||||
; Use the following command to list available mixer controls:
|
||||
; $ amixer scontrols | sed -nr "s/.*'([[:alnum:]]+)'.*/\1/p"
|
||||
; If master, speaker or headphone-soundcard isn't the default,
|
||||
; use `amixer -c # scontrols` instead where # is the number
|
||||
; of the master, speaker or headphone soundcard respectively
|
||||
;
|
||||
; Default: Master
|
||||
master-mixer = Master
|
||||
|
||||
format-volume = <label-volume> <ramp-volume>
|
||||
label-volume = %percentage%%
|
||||
|
||||
format-muted = %{F#808080}<label-muted> %{F-}
|
||||
label-muted = %percentage%%
|
||||
|
||||
ramp-volume-0 =
|
||||
ramp-volume-0-foreground = #FFFFFF
|
||||
ramp-volume-1 =
|
||||
ramp-volume-1-foreground = #FFFFFF
|
||||
ramp-volume-2 =
|
||||
ramp-volume-2-foreground = #FFFFFF
|
||||
|
||||
[settings]
|
||||
throttle-output = 5
|
||||
throttle-output-for = 10
|
||||
;throttle-input-for = 30
|
||||
screenchange-reload = true
|
||||
compositing-background = over
|
||||
compositing-foreground = over
|
||||
compositing-overline = over
|
||||
compositing-border = over
|
||||
|
||||
[global/wm]
|
||||
margin-top = 5
|
||||
margin-bottom = 5
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Wait for audio
|
||||
until pactl info >/dev/null 2>&1; do
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
# Terminate already running bar instances
|
||||
killall -q polybar
|
||||
|
||||
# Wait until the processes have been shut down
|
||||
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||
|
||||
# for multimonitor
|
||||
if type "xrandr"; then
|
||||
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||
MONITOR=$m polybar --reload example & disown
|
||||
done
|
||||
else
|
||||
polybar --reload example & disown
|
||||
fi
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
|
||||
updates_arch=0
|
||||
fi
|
||||
|
||||
if ! updates_aur=$(paru -Qum | wc -l); then
|
||||
# if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then
|
||||
# if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
|
||||
updates_aur=0
|
||||
fi
|
||||
|
||||
updates=$(("$updates_arch" + "$updates_aur"))
|
||||
|
||||
#if [ "$updates" -gt 0 ]; then
|
||||
# echo "# $updates"
|
||||
#else
|
||||
# echo ""
|
||||
#fi
|
||||
|
||||
|
||||
re='^[0-9]+$'
|
||||
if ! [[ $updates_arch =~ $re ]] ; then
|
||||
updates_aur=999; exit 1
|
||||
fi
|
||||
|
||||
if ! [[ $updates_arch =~ $re ]] ; then
|
||||
updates_aur=999; exit 1
|
||||
fi
|
||||
|
||||
echo "P:$updates_arch Y:$updates_aur"
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#awk '{printf " %.1f°F\n", ($1/1000)*9/5+32}' /sys/class/hwmon/hwmon*/temp1_input 2>/dev/null | head -n1
|
||||
awk '{printf " %.1f°F\n", ($1/1000)*9/5+32; exit}' /sys/class/hwmon/hwmon*/temp1_input 2>/dev/null
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# not useful unless exec commands can be placed in internal polybar modules
|
||||
# or I can do the low discharging animation from here
|
||||
|
||||
|
||||
BATRAW=$( cat /sys/class/power_supply/BAT0/capacity )
|
||||
#STATUS=$( cat /sys/class/power_supply/BAT0/status )
|
||||
STATUS="Charging"
|
||||
|
||||
BATADJ=$(( 9 + 100 * $BATRAW / 80 ))
|
||||
STEP=$(( $BATADJ / 10 ))
|
||||
|
||||
CHARGING=( "" "" "" "" "" "" "" "" "" "" )
|
||||
DISCHARGING=( "" "" "" "" "" "" "" "" "" "" )
|
||||
|
||||
if test $STATUS = "Discharging"; then
|
||||
echo ${DISCHARGING[$STEP]}
|
||||
elif test $STATUS = "Charging"; then
|
||||
echo ${CHARGING[$STEP]}
|
||||
fi
|
||||
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
# shellcheck disable=SC2016,SC2059
|
||||
|
||||
KEYBOARD_ID="Keyboard K380 Keyboard"
|
||||
|
||||
# cpm: characters per minute
|
||||
# wpm: words per minute (1 word = 5 characters)
|
||||
METRIC=cpm
|
||||
FORMAT="# %d $METRIC"
|
||||
|
||||
INTERVAL=20
|
||||
|
||||
# If you have a keyboard layout that is not listed here yet, create a condition
|
||||
# yourself. $3 is the key index. Use `xinput test "AT Translated Set 2 keyboard"`
|
||||
# to see key codes in real time. Be sure to open a pull request for your
|
||||
# layout's condition!
|
||||
LAYOUT=qwerty
|
||||
|
||||
case "$LAYOUT" in
|
||||
qwerty) CONDITION='($3 >= 10 && $3 <= 19) || ($3 >= 24 && $3 <= 33) || ($3 >= 37 && $3 <= 53) || ($3 >= 52 && $3 <= 58)'; ;;
|
||||
azerty) CONDITION='($3 >= 10 && $3 <= 19) || ($3 >= 24 && $3 <= 33) || ($3 >= 37 && $3 <= 54) || ($3 >= 52 && $3 <= 57)'; ;;
|
||||
dontcare) CONDITION='1'; ;; # Just register all key presses, not only letters and numbers
|
||||
*) echo "# Unsupported layout \"$LAYOUT\""; exit 1; ;;
|
||||
esac
|
||||
|
||||
# We have to account for the fact we're not listening a whole minute
|
||||
multiply_by=60
|
||||
divide_by=$INTERVAL
|
||||
|
||||
case "$METRIC" in
|
||||
wpm) divide_by=$((divide_by * 5)); ;;
|
||||
cpm) ;;
|
||||
*) echo "Unsupported metric \"$METRIC\""; exit 1; ;;
|
||||
esac
|
||||
|
||||
hackspeed_cache="$(mktemp -p '' hackspeed_cache.XXXXX)"
|
||||
trap 'rm "$hackspeed_cache"' EXIT
|
||||
|
||||
# Write a dot to our cache for each key press
|
||||
printf '' > "$hackspeed_cache"
|
||||
xinput test "$KEYBOARD_ID" | \
|
||||
stdbuf -o0 awk '$1 == "key" && $2 == "press" && ('"$CONDITION"') {printf "."}' >> "$hackspeed_cache" &
|
||||
|
||||
while true; do
|
||||
# Ask the kernel how big the file is with the command `stat`. The number we
|
||||
# get is the file size in bytes, which equals the amount of dots the file
|
||||
# contains, and hence how much keys were pressed since the file was last
|
||||
# cleared.
|
||||
lines=$(stat --format %s "$hackspeed_cache")
|
||||
|
||||
# Truncate the cache file so that in the next iteration, we count only new
|
||||
# keypresses
|
||||
printf '' > "$hackspeed_cache"
|
||||
|
||||
# The shell only does integer operations, so make sure to first multiply and
|
||||
# then divide
|
||||
value=$((lines * multiply_by / divide_by))
|
||||
|
||||
printf "$FORMAT\\n" "$value"
|
||||
|
||||
sleep $INTERVAL
|
||||
done
|
||||
@@ -0,0 +1,13 @@
|
||||
#test-fonts.pl
|
||||
use strict;
|
||||
use warnings;
|
||||
use Font::FreeType;
|
||||
my ($char) = @ARGV;
|
||||
foreach my $font_def (`fc-list`) {
|
||||
my ($file, $name) = split(/: /, $font_def);
|
||||
my $face = Font::FreeType->new->face($file);
|
||||
my $glyph = $face->glyph_from_char($char);
|
||||
if ($glyph) {
|
||||
print $font_def;
|
||||
}
|
||||
}
|
||||
Executable
+88
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
get_icon() {
|
||||
case $1 in
|
||||
01d) icon="🟠";;
|
||||
01n) icon="⚫";;
|
||||
02d) icon="⛅";;
|
||||
02n) icon="⛅";;
|
||||
04d) icon="🌥️";;
|
||||
04n) icon="🌥️";;
|
||||
09d) icon="🌧️";;
|
||||
09n) icon="🌧️";;
|
||||
10d) icon="🌦️";;
|
||||
10n) icon="🌦️";;
|
||||
11d) icon="🌩️";;
|
||||
11n) icon="🌩️";;
|
||||
13d) icon="❄️";;
|
||||
13n) icon="❄️";;
|
||||
50d) icon="🌫️";;
|
||||
50n) icon="🌫️";;
|
||||
*) icon="☁️";
|
||||
esac
|
||||
|
||||
echo $icon
|
||||
}
|
||||
|
||||
get_duration() {
|
||||
|
||||
osname=$(uname -s)
|
||||
|
||||
case $osname in
|
||||
*BSD) date -r "$1" -u +%H:%M;;
|
||||
*) date --date="@$1" -u +%H:%M;;
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
KEY=""
|
||||
CITY=""
|
||||
UNITS="metric"
|
||||
SYMBOL="°"
|
||||
|
||||
API="https://api.openweathermap.org/data/2.5"
|
||||
|
||||
if [ ! -z $CITY ]; then
|
||||
if [ "$CITY" -eq "$CITY" ] 2>/dev/null; then
|
||||
CITY_PARAM="id=$CITY"
|
||||
else
|
||||
CITY_PARAM="q=$CITY"
|
||||
fi
|
||||
|
||||
current=$(curl -sf "$API/weather?appid=$KEY&$CITY_PARAM&units=$UNITS")
|
||||
#curl -s "https://api.openweathermap.org/data/2.5/onecall?lat=0&lon=0&appid=TOKEN&units=metric" | jq -r '.daily[1].temp.day'
|
||||
forecast=$(curl -sf "$API/forecast?appid=$KEY&$CITY_PARAM&units=$UNITS&cnt=1")
|
||||
else
|
||||
location=$(curl -sf https://location.services.mozilla.com/v1/geolocate?key=geoclue)
|
||||
|
||||
if [ ! -z "$location" ]; then
|
||||
location_lat="$(echo "$location" | jq '.location.lat')"
|
||||
location_lon="$(echo "$location" | jq '.location.lng')"
|
||||
|
||||
current=$(curl -sf "$API/weather?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS")
|
||||
forecast=$(curl -sf "$API/forecast?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS&cnt=1")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -z "$current" ] && [ ! -z "$forecast" ]; then
|
||||
current_temp=$(printf "%.0f" $(echo "$current" | jq ".main.temp"))
|
||||
current_icon=$(echo "$current" | jq -r ".weather[0].icon")
|
||||
|
||||
forecast_temp=$(printf "%.0f" $(echo "$forecast" | jq ".list[].main.temp"))
|
||||
forecast_icon=$(echo "$forecast" | jq -r ".list[].weather[0].icon")
|
||||
|
||||
sun_rise=$(echo "$current" | jq ".sys.sunrise")
|
||||
sun_set=$(echo "$current" | jq ".sys.sunset")
|
||||
now=$(date +%s)
|
||||
|
||||
if [ "$sun_rise" -gt "$now" ]; then
|
||||
daytime="🌅 $(get_duration "$((sun_rise-now))")"
|
||||
elif [ "$sun_set" -gt "$now" ]; then
|
||||
daytime="🌇 $(get_duration "$((sun_set-now))")"
|
||||
else
|
||||
daytime="🌅 $(get_duration "$((sun_rise-now))")"
|
||||
fi
|
||||
|
||||
echo "$(get_icon "$current_icon") $current_temp$SYMBOL $(get_icon "$forecast_icon") $forecast_temp$SYMBOL $daytime"
|
||||
fi
|
||||
Reference in New Issue
Block a user