From d7ff1c1dea16619a38f35536a5c00685d848abce Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 10 May 2024 02:03:31 +0900 Subject: Initial Push - Moving to Wallust from Pywal --- config/hypr/hyprlock.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'config/hypr/hyprlock.conf') diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf index 38c927a0..a4a8c19c 100644 --- a/config/hypr/hyprlock.conf +++ b/config/hypr/hyprlock.conf @@ -2,7 +2,8 @@ # Hyprlock # Original config submitted by https://github.com/SherLock707 -source = $HOME/.cache/wal/colors-hyprland +# Sourcing colors generated by wallust +source = $HOME/.config/hypr/wallust/wallust-hyprland.conf general { grace = 1 -- cgit v1.2.3 From 4ff5b6fb30c83fe1e1b5652a759105858756f4b1 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 10 May 2024 02:39:55 +0900 Subject: adjusted hyprlock --- config/hypr/hyprlock.conf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'config/hypr/hyprlock.conf') diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf index a4a8c19c..f41d646a 100644 --- a/config/hypr/hyprlock.conf +++ b/config/hypr/hyprlock.conf @@ -34,7 +34,7 @@ input-field { dots_center = true outer_color = $color1 inner_color = $color0 - font_color = $color7 + font_color = $color12 fade_on_empty = true placeholder_text = Password... # Text rendered in the input box when it's empty. hide_input = false @@ -48,7 +48,7 @@ input-field { label { monitor = text = cmd[update:18000000] echo " "$(date +'%A, %-d %B %Y')" " - color = $color1 + color = $color9 font_size = 34 font_family = JetBrains Mono Nerd Font 10 @@ -61,7 +61,7 @@ label { label { monitor = text = cmd[update:18000000] echo " "$(date +'Week %U')" " - color = $color7 + color = $color5 font_size = 24 font_family = JetBrains Mono Nerd Font 10 position = 0, -250 @@ -74,7 +74,7 @@ label { monitor = # text = cmd[update:1000] echo " $(date +"%I:%M:%S %p") " # AM/PM text = cmd[update:1000] echo " $(date +"%H:%M:%S") " # 24H - color = $color7 + color = $color15 font_size = 94 font_family = JetBrains Mono Nerd Font 10 @@ -87,7 +87,7 @@ text = cmd[update:1000] echo " $(date +"%H:%M:%S") " # 24H label { monitor = text =  $USER - color = $color7 + color = $color9 font_size = 18 font_family = Inter Display Medium @@ -112,7 +112,7 @@ label { label { monitor = text = cmd[update:3600000] [ -f ~/.cache/.weather_cache ] && cat ~/.cache/.weather_cache - color = $color10 + color = $color12 font_size = 24 font_family = JetBrains Mono Nerd Font 10 position = 50, 0 @@ -127,7 +127,7 @@ image { size = 230 rounding = -1 border_size = 4 - border_color = $color2 + border_color = $color1 rotate = 0 reload_time = -1 position = 0, 300 -- cgit v1.2.3 From 4cd64ff0b907f8d8d6503bcb7c858ca25494d1cb Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Fri, 10 May 2024 12:16:30 +0530 Subject: hyprlock: use UptimeNixOS script to get the output if uptime -p not available --- config/hypr/hyprlock.conf | 3 ++- config/hypr/scripts/UptimeNixOS.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 config/hypr/scripts/UptimeNixOS.sh (limited to 'config/hypr/hyprlock.conf') diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf index f41d646a..eec6d31f 100644 --- a/config/hypr/hyprlock.conf +++ b/config/hypr/hyprlock.conf @@ -4,6 +4,7 @@ # Sourcing colors generated by wallust source = $HOME/.config/hypr/wallust/wallust-hyprland.conf +$Scripts = $HOME/.config/hypr/scripts general { grace = 1 @@ -99,7 +100,7 @@ label { # uptime label { monitor = - text = cmd[update:60000] echo " "$(uptime -p)" " + text = cmd[update:60000] echo " "$(uptime -p || $Scripts/UptimeNixOS.sh)" " color = $color12 font_size = 24 font_family = JetBrains Mono Nerd Font 10 diff --git a/config/hypr/scripts/UptimeNixOS.sh b/config/hypr/scripts/UptimeNixOS.sh new file mode 100644 index 00000000..654ae2c8 --- /dev/null +++ b/config/hypr/scripts/UptimeNixOS.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Script parses /proc/uptime to get the system uptime +# and prints it in a human-readable format +# This is a workaround for system where `uptime` command is taken from coreutils +# where `uptime -p` is not supported + +if [[ -r /proc/uptime ]]; then + s=$(< /proc/uptime) + s=${s/.*} +else + echo "Error UptimeNixOS.sh: Uptime could not be determined." >&2 + exit 1 +fi + +d="$((s / 60 / 60 / 24)) days" +h="$((s / 60 / 60 % 24)) hours" +m="$((s / 60 % 60)) minutes" + +# Remove plural if < 2. +((${d/ *} == 1)) && d=${d/s} +((${h/ *} == 1)) && h=${h/s} +((${m/ *} == 1)) && m=${m/s} + +# Hide empty fields. +((${d/ *} == 0)) && unset d +((${h/ *} == 0)) && unset h +((${m/ *} == 0)) && unset m + +uptime=${d:+$d, }${h:+$h, }$m +uptime=${uptime%', '} +uptime=${uptime:-$s seconds} + +echo "up $uptime" -- cgit v1.2.3