diff --git a/bin/sp-launcher b/bin/sp-launcher index 9821930..ae2c2af 100755 --- a/bin/sp-launcher +++ b/bin/sp-launcher @@ -1,7 +1,6 @@ #!/bin/bash source "/usr/lib/sp-functions" -source "${conf_dir}/config" case $1 in file_manager ) diff --git a/bin/sp-lock b/bin/sp-lock index 9678b86..ef14430 100755 --- a/bin/sp-lock +++ b/bin/sp-lock @@ -7,7 +7,20 @@ unlock_script="${conf_dir}/unlockscript" if [ -f "${lock_script}" ]; then bash -c "${lock_script}" fi -gtklock -s "${HOME}/.config/gtklock/style.css" +lock_args=() +if [ -f "/usr/lib/$(uname -m)-linux-gnu/gtklock/userinfo-module.so" ];then + lock_args+=("-m") + lock_args+=("/usr/lib/$(uname -m)-linux-gnu/gtklock/userinfo-module.so") +fi +if [ -f "/usr/lib/$(uname -m)-linux-gnu/gtklock/playerctl-module.so" ];then + lock_args+=("-m") + lock_args+=("/usr/lib/$(uname -m)-linux-gnu/gtklock/playerctl-module.so") +fi +if [ ! -z "${lock_monitor}" ];then + lock_args+=("-M") + lock_args+=("${lock_monitor}") +fi +gtklock -s "${HOME}/.config/gtklock/style.css" "${lock_args[@]}" if [ -f "${unlock_script}" ]; then bash -c "${unlock_script}" fi diff --git a/debian/changelog b/debian/changelog index 05bc2f8..16ef1a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +sway-profiles (0.3.9) unstable; urgency=medium + + * support for gtklock modules + * support for gtklock preferred monitor by setting 'lock_monitor' variable in config + * support for config.d + + -- Penelope Gwen Wed, 26 Feb 2025 18:24:28 +0000 + sway-profiles (0.3.8) unstable; urgency=medium * sp-wallpaper now handles creation of lockscreen wallpapers for faster locking diff --git a/lib/sp-functions b/lib/sp-functions index 73f19a5..e5868e8 100755 --- a/lib/sp-functions +++ b/lib/sp-functions @@ -3,6 +3,10 @@ conf_dir="$HOME/.config/sway-profiles" cache_dir="$HOME/.cache/sway-profiles" +source "${conf_dir}/config" +for c in "${conf_dir}/config.d/"*;do + source "${c}" +done mkdir -p "${cache_dir}/"{displays,lock,screenshots} @@ -32,7 +36,9 @@ get_profile_id(){ } get_profile_name(){ - echo "test" + get_profile_list + [ -z "${1}" ] && p=`get_active_profile` || p="${1}" + echo "${p_name[ ${p} ]}" } get_profile_list(){