wip
This commit is contained in:
@@ -1,56 +1,177 @@
|
|||||||
|
# GENERAL
|
||||||
general {
|
general {
|
||||||
|
no_fade_in = true
|
||||||
|
disable_loading_bar = false
|
||||||
|
hide_cursor = true
|
||||||
ignore_empty_input = true
|
ignore_empty_input = true
|
||||||
immediate_render = true
|
text_trim = true
|
||||||
no_fade_in = tue
|
|
||||||
no_fade_out = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#BACKGROUND
|
||||||
background {
|
background {
|
||||||
blur_size = 3
|
monitor =
|
||||||
blur_passes = 1
|
# path = ~/wallpaper.png
|
||||||
|
path = screenshot
|
||||||
|
blur_passes = 2
|
||||||
|
contrast = 0.8916
|
||||||
|
brightness = 0.7172
|
||||||
|
vibrancy = 0.1696
|
||||||
|
vibrancy_darkness = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
input-field {
|
# TIME HR
|
||||||
|
label {
|
||||||
monitor =
|
monitor =
|
||||||
rounding = 0
|
text = cmd[update:1000] echo -e "$(date +"%H")"
|
||||||
size = 800, 100
|
color = rgba(255, 255, 255, 1)
|
||||||
outline_thickness = 4
|
shadow_pass = 2
|
||||||
dots_size = 0.5
|
shadow_size = 3
|
||||||
dots_rounding = 0
|
shadow_color = rgb(0,0,0)
|
||||||
dots_spacing = 0.2
|
shadow_boost = 1.2
|
||||||
dots_center = true
|
font_size = 150
|
||||||
fade_on_empty = false
|
# font_family = JetBrains Mono Nerd Font Mono ExtraBold
|
||||||
placeholder_text = LOGIN
|
font_family = Symbols Nerd Font, Geist Mono
|
||||||
hide_input = false
|
position = 0, -250
|
||||||
fail_text = Wrong password!
|
halign = center
|
||||||
position = 0, 0
|
valign = top
|
||||||
dots_fade_time = 0
|
}
|
||||||
dots_text_format = 0
|
|
||||||
|
# TIME
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
text = cmd[update:1000] echo -e "$(date +"%M")"
|
||||||
|
# color = 0xff$color0
|
||||||
|
color = rgba(255, 255, 255, 1)
|
||||||
|
font_size = 150
|
||||||
|
# font_family = JetBrains Mono Nerd Font Mono ExtraBold
|
||||||
|
font_family = Symbols Nerd Font, Geist Mono
|
||||||
|
position = 0, -420
|
||||||
|
halign = center
|
||||||
|
valign = top
|
||||||
|
}
|
||||||
|
|
||||||
|
# DATE
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
text = cmd[update:1000] echo -e "$(LC_TIME=lv_LV.UTF-8 date +"%A, %-d. %B" | sed 's/./\U&/1')"
|
||||||
|
color = rgba(255, 255, 255, 1)
|
||||||
|
font_size = 14
|
||||||
|
font_family = Symbols Nerd Font, Geist
|
||||||
|
position = 0, -130
|
||||||
halign = center
|
halign = center
|
||||||
valign = center
|
valign = center
|
||||||
font_family = Geist Mono
|
|
||||||
outer_color = rgba(0, 0, 0, 0)
|
|
||||||
inner_color = rgba(0, 0, 0, 0)
|
|
||||||
font_color = rgb(255, 0, 0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
label {
|
# Music
|
||||||
text = cmd[update:1000] if [[ $ATTEMPTS -gt 0 ]]; then echo "Password hint: Favourite Regretevator character"; else echo "$TIME - $LAYOUT"; fi
|
image {
|
||||||
font_family = Geist
|
monitor =
|
||||||
color = rgb(255, 0, 0)
|
path =
|
||||||
position = 10, -10
|
size = 80 # lesser side if not 1:1 ratio
|
||||||
|
rounding = 5 # negative values mean circle
|
||||||
|
border_size = 0
|
||||||
|
rotate = 0 # degrees, counter-clockwise
|
||||||
|
reload_time = 2
|
||||||
|
reload_cmd = bash ~/config/scripts/modules/hyprlock/info.sh --arturl
|
||||||
|
position = -150, -300
|
||||||
halign = center
|
halign = center
|
||||||
font_size = 12
|
valign = center
|
||||||
valign = top
|
opacity=0.5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# PLAYER TITTLE
|
||||||
label {
|
label {
|
||||||
text = cmd[update:1000] playerctl metadata -sf "{{artist}} - {{title}}<br/>{{album}}"
|
monitor =
|
||||||
font_family = Geist
|
# text = cmd[update:1000] echo "$(playerctl metadata --format "{{ xesam:title }}" 2>/dev/null | cut -c1-25)"
|
||||||
color = rgb(255, 0, 0)
|
text = cmd[update:1000] echo "$(bash ~/config/scripts/modules/hyprlock/info.sh --title)"
|
||||||
position = 10, -10
|
color = rgba(255, 255, 255, 0.8)
|
||||||
halign = left
|
|
||||||
font_size = 12
|
font_size = 12
|
||||||
valign = top
|
font_family = Symbols Nerd Font, Geist
|
||||||
|
position = 880, -290
|
||||||
|
halign = left
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
|
||||||
|
# PLAYER Length
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
# text= cmd[update:1000] echo "$(( $(playerctl metadata --format "{{ mpris:length }}" 2>/dev/null) / 60000000 ))m"
|
||||||
|
text = cmd[update:1000] echo "$(bash ~/config/scripts/modules/hyprlock/info.sh --length) "
|
||||||
|
color = rgba(255, 255, 255, 1)
|
||||||
|
font_size = 11
|
||||||
|
font_family = Symbols Nerd Font, Geist
|
||||||
|
position = -730, -310
|
||||||
|
halign = right
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
|
||||||
|
# PLAYER STATUS
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
# text= cmd[update:1000] echo "$(( $(playerctl metadata --format "{{ mpris:length }}" 2>/dev/null) / 60000000 ))m"
|
||||||
|
text = cmd[update:1000] echo "$(bash ~/config/scripts/modules/hyprlock/info.sh --status)"
|
||||||
|
color = rgba(255, 255, 255, 1)
|
||||||
|
font_size = 14
|
||||||
|
font_family = Symbols Nerd Font, Geist
|
||||||
|
position = -740, -290
|
||||||
|
halign = right
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
# PLAYER SOURCE
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
# text= cmd[update:1000] echo "$(playerctl metadata --format "{{ mpris:trackid }}" 2>/dev/null | grep -Eo "chromium|firefox|spotify")"
|
||||||
|
text = cmd[update:1000] echo "$(bash ~/config/scripts/modules/hyprlock/info.sh --source)"
|
||||||
|
color = rgba(255, 255, 255, 0.6)
|
||||||
|
font_size = 10
|
||||||
|
font_family = Symbols Nerd Font, Geist
|
||||||
|
position = -740, -330
|
||||||
|
halign = right
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
|
||||||
|
# PLAYER ALBUM
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
# text= cmd[update:1000] echo "$(~/.config/hypr/bin/album.sh)"
|
||||||
|
text = cmd[update:1000] echo "$(bash ~/config/scripts/modules/hyprlock/info.sh --album)"
|
||||||
|
color = rgba(255, 255, 255, 1)
|
||||||
|
font_size = 10
|
||||||
|
font_family = Symbols Nerd Font, Geist
|
||||||
|
position = 880, -330
|
||||||
|
halign = left
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
# PLAYER Artist
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
# text = cmd[update:1000] echo "$(playerctl metadata --format "{{ xesam:artist }}" 2>/dev/null | cut -c1-30)"
|
||||||
|
text = cmd[update:1000] echo "$(bash ~/config/scripts/modules/hyprlock/info.sh --artist)"
|
||||||
|
color = rgba(255, 255, 255, 0.8)
|
||||||
|
font_size = 10
|
||||||
|
font_family = Symbols Nerd Font, Geist
|
||||||
|
position = 880, -310
|
||||||
|
halign = left
|
||||||
|
valign = center
|
||||||
|
}
|
||||||
|
|
||||||
|
# INPUT FIELD
|
||||||
|
input-field {
|
||||||
|
monitor =
|
||||||
|
size = 250, 60
|
||||||
|
outline_thickness = 0
|
||||||
|
outer_color = rgba(0, 0, 0, 1)
|
||||||
|
dots_size = 0.1 # Scale of input-field height, 0.2 - 0.8
|
||||||
|
dots_spacing = 1 # Scale of dots' absolute size, 0.0 - 1.0
|
||||||
|
dots_center = true
|
||||||
|
inner_color = rgba(0, 0, 0, 1)
|
||||||
|
font_color = rgba(200, 200, 200, 1)
|
||||||
|
fade_on_empty = false
|
||||||
|
font_family = Symbols Nerd Font, Geist Mono
|
||||||
|
placeholder_text = <span foreground="##cdd6f4"> $USER</span>
|
||||||
|
hide_input = false
|
||||||
|
position = 0, -470
|
||||||
|
halign = center
|
||||||
|
valign = center
|
||||||
|
zindex = 10
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
111
scripts/modules/hyprlock/info.sh
Executable file
111
scripts/modules/hyprlock/info.sh
Executable file
@@ -0,0 +1,111 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# https://gist.github.com/ashish-kus/dd562b0bf5e8488a09e0b9c289f4574c
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
echo "Usage: $0 --title | --arturl | --artist | --length | --album | --source"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Function to get metadata using playerctl
|
||||||
|
get_metadata() {
|
||||||
|
key=$1
|
||||||
|
playerctl metadata --format "{{ $key }}" 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check for arguments
|
||||||
|
|
||||||
|
# Function to determine the source and return an icon and text
|
||||||
|
get_source_info() {
|
||||||
|
trackid=$(get_metadata "mpris:trackid")
|
||||||
|
if [[ "$trackid" == *"firefox"* ]]; then
|
||||||
|
echo -e "Firefox "
|
||||||
|
elif [[ "$trackid" == *"spotify"* ]]; then
|
||||||
|
echo -e "Spotify "
|
||||||
|
elif [[ "$trackid" == *"chromium"* ]]; then
|
||||||
|
echo -e "Chrome "
|
||||||
|
elif [[ "$trackid" == *"cider"* ]]; then
|
||||||
|
echo -e "Apple Music " # added
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse the argument
|
||||||
|
case "$1" in
|
||||||
|
--title)
|
||||||
|
title=$(get_metadata "xesam:title")
|
||||||
|
if [ -z "$title" ]; then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo "${title:0:28}" # Limit the output to 50 characters
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
--arturl)
|
||||||
|
url=$(get_metadata "mpris:artUrl")
|
||||||
|
if [ -z "$url" ]; then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
if [[ "$url" == file://* ]]; then
|
||||||
|
url=${url#file://}
|
||||||
|
elif [[ "$url" == http* ]]; then
|
||||||
|
url="${url/640x640/1024x1024}"
|
||||||
|
hash=$(echo -n "$url" | sha256sum | awk '{print $1}')
|
||||||
|
file_path="/tmp/${hash}.jpg"
|
||||||
|
if [[ ! -f "$file_path" ]]; then
|
||||||
|
curl -s --compressed --connect-timeout 2 -m 5 -o "$file_path" "$url" &
|
||||||
|
fi
|
||||||
|
url="file://$file_path"
|
||||||
|
fi
|
||||||
|
echo "$url"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
--artist)
|
||||||
|
artist=$(get_metadata "xesam:artist")
|
||||||
|
if [ -z "$artist" ]; then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo "${artist:0:30}" # Limit the output to 50 characters
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
--length)
|
||||||
|
length=$(get_metadata "mpris:length")
|
||||||
|
if [ -z "$length" ]; then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
# Convert length from microseconds to a more readable format (seconds)
|
||||||
|
echo "$(echo "scale=2; $length / 1000000 / 60" | bc) m"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
--status)
|
||||||
|
status=$(playerctl status 2>/dev/null)
|
||||||
|
if [[ $status == "Playing" ]]; then
|
||||||
|
echo ""
|
||||||
|
elif [[ $status == "Paused" ]]; then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
--album)
|
||||||
|
album=$(playerctl metadata --format "{{ xesam:album }}" 2>/dev/null)
|
||||||
|
if [[ -n $album ]]; then
|
||||||
|
echo "$album"
|
||||||
|
else
|
||||||
|
status=$(playerctl status 2>/dev/null)
|
||||||
|
if [[ -n $status ]]; then
|
||||||
|
echo "Not album"
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
--source)
|
||||||
|
get_source_info
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid option: $1"
|
||||||
|
echo "Usage: $0 --title | --url | --artist | --length | --album | --source"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
Reference in New Issue
Block a user