diff --git a/hypr/bin/hyprlock/battery-status b/hypr/bin/hyprlock/battery-status new file mode 100755 index 0000000..bcf15c9 --- /dev/null +++ b/hypr/bin/hyprlock/battery-status @@ -0,0 +1,23 @@ +#!/bin/sh + +# status="$(acpi -b | grep -ioh "\w*charging\w*")" +# level="$(acpi -b | grep -o -P "[0-9]+(?=%)")" + +status="$(cat /sys/class/power_supply/BAT1/status)" +level="$(cat /sys/class/power_supply/BAT1/capacity)" + +if [[ ("$status" == "Discharging") || ("$status" == "Full") ]]; then + if [[ "$level" -eq "0" ]]; then + printf " " + elif [[ ("$level" -ge "0") && ("$level" -le "25") ]]; then + printf " " + elif [[ ("$level" -ge "25") && ("$level" -le "50") ]]; then + printf " " + elif [[ ("$level" -ge "50") && ("$level" -le "75") ]]; then + printf " " + elif [[ ("$level" -ge "75") && ("$level" -le "100") ]]; then + printf " " + fi +elif [[ "$status" == "Charging" ]]; then + printf " " +fi diff --git a/hypr/bin/hyprlock/layout-status b/hypr/bin/hyprlock/layout-status new file mode 100755 index 0000000..3b4d11f --- /dev/null +++ b/hypr/bin/hyprlock/layout-status @@ -0,0 +1,4 @@ +#!/bin/sh + +layout="$(bat /etc/vconsole.conf | grep XKBLAYOUT | awk -F'=' '{print toupper($2)}')" +printf "%s  " "$layout" diff --git a/hypr/bin/hyprlock/network-status b/hypr/bin/hyprlock/network-status new file mode 100755 index 0000000..3b900c8 --- /dev/null +++ b/hypr/bin/hyprlock/network-status @@ -0,0 +1,27 @@ +#!/bin/sh + +status="$(nmcli general status | grep -oh "\w*connect\w*")" + +if [[ "$status" == "disconnected" ]]; then + printf "󰤮 " +elif [[ "$status" == "connecting" ]]; then + printf "󱍸 " +elif [[ "$status" == "connected" ]]; then + # strength="$(nmcli -f IN-USE,SIGNAL device wifi | grep '*' | awk '{print $2}')" + strength="$(python $HOME/.config/Scripts/wifi-conn-strength)" + if [[ "$?" == "0" ]]; then + if [[ "$strength" -eq "0" ]]; then + printf "󰤯 " + elif [[ ("$strength" -ge "0") && ("$strength" -le "25") ]]; then + printf "󰤟 " + elif [[ ("$strength" -ge "25") && ("$strength" -le "50") ]]; then + printf "󰤢 " + elif [[ ("$strength" -ge "50") && ("$strength" -le "75") ]]; then + printf "󰤥 " + elif [[ ("$strength" -ge "75") && ("$strength" -le "100") ]]; then + printf "󰤨 " + fi + else + printf "󰈀 " + fi +fi diff --git a/hypr/bin/hyprlock/song-status b/hypr/bin/hyprlock/song-status new file mode 100755 index 0000000..749aab3 --- /dev/null +++ b/hypr/bin/hyprlock/song-status @@ -0,0 +1,19 @@ +#!/bin/bash +player_name=$(playerctl metadata --format '{{playerName}}') +player_status=$(playerctl status) + +if [[ "$player_status" == "Playing" ]]; then + if [[ "$player_name" == "spotify" ]]; then + song_info=$(playerctl metadata --format '{{title}} 󰓇 {{artist}}') + elif [[ "$player_name" == "firefox" ]]; then + song_info=$(playerctl metadata --format '{{title}} 󰈹 {{artist}}') + elif [[ "$player_name" == "mpd" ]]; then + song_info=$(playerctl metadata --format '{{title}} 󰎆 {{artist}}') + elif [[ "$player_name" == "chromium" ]]; then + song_info=$(playerctl metadata --format '{{title}} 󰊯 {{artist}}') + else + song_info=$(playerctl metadata --format '{{title}} ♬ {{artist}}') + fi +fi + +echo "$song_info" diff --git a/hypr/hyprlock.conf b/hypr/hyprlock.conf index cc3b7b7..ad34f21 100644 --- a/hypr/hyprlock.conf +++ b/hypr/hyprlock.conf @@ -1,245 +1,150 @@ +general { + immediate_render = true +} + background { monitor = - path = /home/tola/Pictures/wallpaper/joshua-sortino-xZqr8WtYEJ0-unsplash.jpg + path = /home/tola/Pictures/wallpaper/robert-lukeman-zNN6ubHmruI-unsplash.jpg color = rgba(25, 20, 20, 1.0) - blur_passes = 3 - blur_size = 3 - noise = 0.0117 - contrast = 0.8916 - brightness = 0.5 - vibrancy = 0.0 + + # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations + blur_passes = 0 # 0 disables blurring + blur_size = 2 + noise = 0 + contrast = 0 + brightness = 0 + vibrancy = 0 vibrancy_darkness = 0.0 } -general { - no_fade_in = false - grace = 0 - disable_loading_bar = false - ignore_empty_input = true - # hide_cursor = true + +input-field { + monitor = + size = 300, 30 + outline_thickness = 0 + dots_size = 0.25 # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.55 # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = true + dots_rounding = -1 + outer_color = rgba(242, 243, 244, 0) + inner_color = rgba(242, 243, 244, 0) + font_color = rgba(242, 243, 244, 0.75) + fade_on_empty = false + placeholder_text = # Text rendered in the input box when it's empty. + hide_input = false + check_color = rgba(204, 136, 34, 0) + fail_color = rgba(204, 34, 34, 0) # if authentication failed, changes outer_color and fail message color + fail_text = $FAIL ($ATTEMPTS) # can be set to empty + fail_transition = 300 # transition time in ms between normal outer_color and fail_color + capslock_color = -1 + numlock_color = -1 + bothlock_color = -1 # when both locks are active. -1 means don't change outer color (same for above) + invert_numlock = false # change color if numlock is off + swap_font_color = false # see below + position = 0, -468 + halign = center + valign = center } -animations { - animation = fade, 1, 6, default - animation = fadeIn, 1, 6, default - animation = fadeOut, 1, 6, default + +label { + monitor = + text = cmd[update:1000] echo "$(~/dotfiles/hypr/bin/hyprlock/song-status)" + color = rgba(242, 243, 244, 0.75) + font_size = 14 + font_family = SF Pro Text + position = 20, 700 + halign = left + valign = center } + +label { + monitor = + text = cmd[update:1000] echo "$(~/dotfiles/hypr/bin/hyprlock/network-status)‎" + color = rgba(242, 243, 244, 0.75) + font_size = 16 + font_family = SF Pro Text + position = -35, 700 + halign = right + valign = center +} + +label { + monitor = + text = cmd[update:1000] echo "$(~/dotfiles/hypr/bin/hyprlock/battery-status)‎" + color = rgba(242, 243, 244, 0.75) + font_size = 19 + font_family = SF Pro Text + position = -93, 700 + halign = right + valign = center +} + +label { + monitor = + text = cmd[update:1000] echo "$(~/dotfiles/hypr/bin/hyprlock/layout-status)‎" + color = rgba(242, 243, 244, 0.75) + font_size = 15 + font_family = SF Pro Text + position = -150, 700 + halign = right + valign = center +} + +label { + monitor = + text = cmd[update:1000] echo "$(date +"%A, %B %d")" + color = rgba(242, 243, 244, 0.75) + font_size = 20 + font_family = SF Pro Display Bold + position = 0, 405 + halign = center + valign = center +} + +label { + monitor = + text = cmd[update:1000] echo "$(date +"%k:%M")" + color = rgba(242, 243, 244, 0.75) + font_size = 93 + font_family = SF Pro Display Bold + position = 0, 310 + halign = center + valign = center +} + + +label { + monitor = + text = WT + color = rgba(242, 243, 244, 0.75) + font_size = 12 + font_family = SF Pro Display Bold + position = 0, -407 + halign = center + valign = center +} + +label { + monitor = + text = Touch ID or Enter Password + color = rgba(242, 243, 244, 0.75) + font_size = 10 + font_family = SF Pro Display + position = 0, -438 + halign = center + valign = center +} + image { monitor = - path = ~/dotfiles/hypr/pictures/user.jpeg - border_size = 2 - border_color = rgba(255, 255, 255, 0) - size = 200 + path = ~/dotfiles/hypr/pictures/user.jpeg + border_color = 0xffdddddd + border_size = 0 + size = 73 rounding = -1 rotate = 0 reload_time = -1 reload_cmd = - position = 0, 40 + position = 0, -353 halign = center valign = center } -label { - monitor = - text = cmd[update:1000] echo "$(date +"%A %d %B %Y")" - color = rgba(200, 200, 200, 1.0) - font_size = 25 - font_family = JetBrainsMonoNerd Font Mono Bold - position = 0, 350 - halign = center - valign = center -} -label { - monitor = - text = cmd[update:1000] echo "$(date +"%H:%M")" - color = rgba(200, 200, 200, 1.0) - font_size = 120 - font_family = JetBrainsMonoNerd Font Mono Bold - position = 0, 250 - halign = center - valign = center -} -shape { - monitor = - size = 256, 48 - color = rgba(0, 0, 0, 1) - rounding = -1 - border_size = 0 - border_color = rgba(0, 0, 0, 1) - rotate = 0 - xray = false - position = 0, -130 - halign = center - valign = center -} -label { - monitor = - text = cmd[update:1000] echo " $USER@$(hostname)" - color = rgba(216, 222, 233, 0.80) - #outline_thickness = 2 - #dots_size = 0.2 - #dots_spacing = 0.2 - #dots_center = true - font_size = 18 - font_family = JetBrainsMonoNerd Font Mono Bold - position = 0, -130 - halign = center - valign = center -} -input-field { - monitor = - size = 256, 48 - outline_thickness = 0 - dots_size = 0.2 - dots_spacing = 0.5 - dots_center = true - outer_color = rgba(0, 0, 0, 0) - inner_color = rgba(0, 0, 0, 1) - font_color = rgb(200, 200, 200) - fade_on_empty = false - font_family = JetBrainsMonoNerd Font Mono Bold - placeholder_text = Enter Pass - hide_input = false - position = 0, -210 - halign = center - valign = center -} -# label { -# monitor = -# text = cmd[update:1000] echo "$(~/dotfiles/hypr/bin/songdetail.sh)" -# color = rgba(255, 255, 255, 0.6) -# font_size = 18 -# font_family = JetBrainsMonoNerd Font Mono Bold -# position = 0, 50 -# halign = center -# valign = bottom -# } -#image { -# monitor = -# path = ~/dotfiles/hypr/pictures/music.webp -# size = 100 -# rounding = 5 -# burder_size = 3 -# border_color = rgba(216, 222, 233, 0.70) -# rotate = 0 -# reload_time = 2 -# reload_cmd = ~/dotfiles/hypr/bin/hyprlock-music.sh --art -# position = 730, 57 -# halign = left -# valign = bottom -# zindex = 1 -#} -#shape { -# monitor = -# color = rgba(100, 114, 125, 0.4) -# size = 500, 140 -# rounding = 10 -# position = 0, 40 -# halign = center -# valign = bottom -# zindex = 0 -#} -#label { -# monitor = -# text = cmd[update:1000] echo "$(~/dotfiles/hypr/bin/hyprlock-music.sh --title)" -# color = rgba(216, 222, 233, 0.70) -# font_size = 16 -# font_family = SF Pro Display Heavy -# position = 55, 138 -# halign = center -# valign = bottom -# zindex = 1 -#} - -# Player source (e.g., Spotify, Firefox) -#label { -# monitor = -# text = cmd[update:1000] echo "$(~/dotfiles/hypr/bin/hyprlock-music.sh --player)" -# color = rgba(216, 222, 233, 0.70) -# font_size = 13 -# font_family = SF Pro Display Bold -# position = 205, 45 -# halign = center -# valign = bottom -# zindex = 1 -#} - -# Artist name -#label { -# monitor = -# text = cmd[update:1000] echo "󰠃 $(~/dotfiles/hypr/bin/hyprlock-music.sh --artist)" -# color = rgba(216, 222, 233, 0.70) -# font_size = 12 -# font_family = SF Pro Display Semibold -# position = 55, 118 -# halign = center -# valign = bottom -# zindex = 1 -#} -# Previous track button -#label { -# monitor = -# text = 󰒮 -# color = rgba(216, 222, 233, 0.70) -# font_size = 25 -# onclick = playerctl previous -# position = -5, 55 -# halign = center -# valign = bottom -#} - -# Play/Pause button -#label { -# monitor = -# text = cmd[update:1000] ~/dotfiles/hypr/bin/hyprlock-music.sh --status -# color = rgba(216, 222, 233, 0.70) -# font_size = 25 -# onclick = playerctl play-pause -# position = 55, 55 -# halign = center -# valign = bottom -#} - -# Next track button -#label { -# monitor = -# text = 󰒭 -# color = rgba(216, 222, 233, 0.70) -# font_size = 25 -# onclick = playerctl next -# position = 110, 55 -# halign = center -# valign = bottom -#} -# Current position timestamp -#label { -# monitor = -# text = cmd[update:1000] echo "$(~/dotfiles/hypr/bin/hyprlock-music.sh --position)" -# color = rgba(216, 222, 233, 0.70) -# font_size = 10 -# font_family = SF Pro Display Medium -# position = -100, 95 -# halign = center -# valign = bottom -#} - -# Total length timestamp -#label { -# monitor = -# text = cmd[update:1000] echo "$(~/dotfiles/hypr/bin/hyprlock-music.sh --length)" -# color = rgba(216, 222, 233, 0.70) -# font_size = 10 -# font_family = SF Pro Display Medium -# position = 210, 95 -# halign = center -# valign = bottom -#} - -# Progress bar (with Pango markup for colored segments) -#label { -# monitor = -# text = cmd[update:1000] ~/dotfiles/hypr/bin/hyprlock-music.sh --progress-bar -# color = rgba(216, 222, 233, 0.70) -# font_size = 12 -# font_family = SF Pro Display Medium -# position = 55, 95 -# halign = center -# valign = bottom -#} diff --git a/hypr/hyprlock.conf.bak b/hypr/hyprlock.conf.bak new file mode 100644 index 0000000..c173fbd --- /dev/null +++ b/hypr/hyprlock.conf.bak @@ -0,0 +1,103 @@ +background { + monitor = + path = /home/tola/Pictures/wallpaper/pexels-sebastiaan9977-1097456.jpg + color = rgba(25, 20, 20, 1.0) + blur_passes = 3 + blur_size = 3 + noise = 0.0117 + contrast = 0.8916 + brightness = 0.5 + vibrancy = 0.0 + vibrancy_darkness = 0.0 +} +general { + no_fade_in = false + grace = 0 + disable_loading_bar = false + ignore_empty_input = true + # hide_cursor = true +} +animations { + animation = fade, 1, 6, default + animation = fadeIn, 1, 6, default + animation = fadeOut, 1, 6, default +} +image { + monitor = + path = ~/dotfiles/hypr/pictures/user.jpeg + border_size = 2 + border_color = rgba(255, 255, 255, 0) + size = 200 + rounding = -1 + rotate = 0 + reload_time = -1 + reload_cmd = + position = 0, 40 + halign = center + valign = center +} +label { + monitor = + text = cmd[update:1000] echo "$(date +"%A %d %B %Y")" + color = rgba(200, 200, 200, 1.0) + font_size = 25 + font_family = JetBrainsMonoNerd Font Mono Bold + position = 0, 350 + halign = center + valign = center +} +label { + monitor = + text = cmd[update:1000] echo "$(date +"%H:%M")" + color = rgba(200, 200, 200, 1.0) + font_size = 120 + font_family = JetBrainsMonoNerd Font Mono Bold + position = 0, 250 + halign = center + valign = center +} +shape { + monitor = + size = 256, 48 + color = rgba(0, 0, 0, 1) + rounding = -1 + border_size = 0 + border_color = rgba(0, 0, 0, 1) + rotate = 0 + xray = false + position = 0, -130 + halign = center + valign = center +} +label { + monitor = + text = cmd[update:1000] echo " $USER@$(hostname)" + color = rgba(216, 222, 233, 0.80) + #outline_thickness = 2 + #dots_size = 0.2 + #dots_spacing = 0.2 + #dots_center = true + font_size = 18 + font_family = JetBrainsMonoNerd Font Mono Bold + position = 0, -130 + halign = center + valign = center +} +input-field { + monitor = + size = 256, 48 + outline_thickness = 0 + dots_size = 0.2 + dots_spacing = 0.5 + dots_center = true + outer_color = rgba(0, 0, 0, 0) + inner_color = rgba(0, 0, 0, 1) + font_color = rgb(200, 200, 200) + fade_on_empty = false + font_family = JetBrainsMonoNerd Font Mono Bold + placeholder_text = Enter Pass + hide_input = false + position = 0, -210 + halign = center + valign = center +}