diff --git a/hyprlock.conf b/hyprlock.conf new file mode 100644 index 0000000..c2523ee --- /dev/null +++ b/hyprlock.conf @@ -0,0 +1,162 @@ +source = ~/.config/hypr/scheme/current.conf + +$outline = rgba($mauvedd) +$secondary_text = rgb($lavender) + +$font_family = JetBrains Mono Nerd Font Bold +$font_family_clock = JetBrains Mono Nerd Font Bold + +animation { + bezier = linear, 1, 1, 0, 0 + animation = fadeIn, 1, 5, linear + animation = fadeOut, 1, 3, linear + animation = inputField, 1, 2, linear + animation = inputFieldColors, 1, 3, linear +} + +background { + color = rgb($crust) + path = $HOME/.cache/caelestia/wallpaper/current +} + +shape { + monitor = + size = 1200, 100% + color = rgba($base50) + border_size = 2 + border_color = rgb($text) + + shadow_passes = 2 + shadow_color = rgb($mantle) + + position = 0, 0 + halign = center + valign = center +} + +input-field { + monitor = + size = 320, 60 + outline_thickness = 4 + dots_size = 0.225 + dots_spacing = 0.2 + outer_color = $outline + inner_color = rgba($based7) + font_color = rgb($text) + check_color = rgb($sky) + fail_color = rgb($red) + fade_on_empty = false + placeholder_text = 󰌾 Logged in as $USER + fail_text = $FAIL ($ATTEMPTS) + + position = 0, 100 + halign = center + valign = bottom +} + +image { # Face + monitor = + path = $HOME/.face + size = 100 + border_color = $outline + + position = 0, 200 + halign = center + valign = bottom +} + +label { # Top left clock framing + monitor = + text = ⌜ + color = $outline + font_size = 140 + font_family = $font_family_clock + + position = -470, 70 + halign = center + valign = center +} + +label { # Bottom right clock framing + monitor = + text = ⌟ + color = $outline + font_size = 140 + font_family = $font_family_clock + + position = 475, 50 + halign = center + valign = center +} + +label { # Clock + monitor = + text = cmd[update:1000] date +'%I:%M:%S %p' + color = rgb($text) + font_size = 100 + font_family = $font_family_clock + + position = 0, 60 + halign = center + valign = center +} + +label { # Date + monitor = + text = cmd[update:43200000] date +'%A, %-d %B %Y' + color = $secondary_text + font_size = 36 + font_family = $font_family + + position = 0, -60 + halign = center + valign = top +} + +label { # Week + monitor = + text = cmd[update:43200000] date +'Week %U' + color = rgb($text) + font_size = 24 + font_family = $font_family + + position = 0, -120 + halign = center + valign = top +} + +label { # Uptime + monitor = + text = cmd[update:60000] uptime -p + color = $secondary_text + font_size = 24 + font_family = $font_family + + position = -20, 20 + halign = right + valign = bottom +} + +label { # Battery + monitor = + text = cmd[update:5000] ~/.config/hypr/scripts/battery.fish + color = $secondary_text + font_size = 24 + font_family = $font_family + + position = 20, 20 + halign = left + valign = bottom +} + +label { # Weather if no battery + monitor = + text = cmd[update:90000] ~/.config/hypr/scripts/battery.fish > /dev/null || ~/.config/hypr/scripts/weather.fish + color = $secondary_text + font_size = 24 + font_family = $font_family + + position = 20, 20 + halign = left + valign = bottom +} diff --git a/scripts/battery.fish b/scripts/battery.fish new file mode 100755 index 0000000..a400ad3 --- /dev/null +++ b/scripts/battery.fish @@ -0,0 +1,17 @@ +#!/bin/fish + +for battery in /sys/class/power_supply/*BAT* + if test -f "$battery/uevent" + set has_battery + break + end +end + +if set -q has_battery + if test "$(cat /sys/class/power_supply/*/status | head -1)" = "Charging" + echo -n "(+) " + end + echo "$(cat /sys/class/power_supply/*/capacity | head -1)% remaining" +else + exit 1 +end diff --git a/scripts/weather.fish b/scripts/weather.fish new file mode 100755 index 0000000..e576710 --- /dev/null +++ b/scripts/weather.fish @@ -0,0 +1,14 @@ +#!/bin/fish + +set -q XDG_CACHE_HOME && set cache $XDG_CACHE_HOME || set cache ~/.cache +set cache $cache/caelestia/weather.txt + +set format '\(.weatherDesc[0].value) • \(.temp_C)°C | UV \(.uvIndex) • 💨 \(.windspeedKmph)km/h' + +set city (curl ipinfo.io | jq -r '.city') +set weather (curl "wttr.in/$city?format=j1" | jq -er '.current_condition[0] | "'$format'"' || cat $cache) + +if test -n weather + echo $weather > $cache + echo $weather +end