Compare commits

...

14 commits
0.3.7 ... main

Author SHA1 Message Date
Penelope Gwen
39b844c850 wofi menus use static order to display options 2025-04-17 19:46:19 +00:00
Penelope Gwen
492bd9b0e1 3.14 2025-03-14 16:03:47 -07:00
Penelope Gwen
984bff1c74 original 3.13 2025-03-14 16:01:12 -07:00
Penelope Gwen
e19fdbe368 0.3.13 2025-03-14 15:53:53 -07:00
Penelope Gwen
1882b58821 fix variable substitution in configs 2025-02-28 10:32:11 +00:00
Penelope Gwen
c73f984982 proper array implementation, browser-newtab added 2025-02-28 00:05:16 -08:00
Penelope Gwen
4075d29444 0.3.11 2025-02-28 07:31:19 +00:00
Penelope Gwen
f2fb841deb implement get_profile_name functionality 2025-02-28 07:31:01 +00:00
Penelope Gwen
41d0a72bbd merge 0.3.9 original commits 2025-02-28 07:27:48 +00:00
Penelope Gwen
7279d4685c 0.3.9 2025-02-28 07:26:01 +00:00
Penelope Gwen
1357d1ca01 version 0.3.9, 0.3.10 2025-02-28 00:50:52 +00:00
Penelope Gwen
f65b512bfc 0.3.8 2025-01-04 18:38:57 -08:00
Penelope Gwen
18a199cf11 revised locking for version 0.3.8 2025-01-04 18:38:46 -08:00
Penelope Gwen
3f86dd0848 clean build files 2025-01-04 18:22:37 -08:00
36 changed files with 95 additions and 452 deletions

View file

@ -3,6 +3,6 @@
source "/usr/lib/sp-functions" source "/usr/lib/sp-functions"
options=$( ls "${conf_dir}/global-shortcuts/" ) options=$( ls "${conf_dir}/global-shortcuts/" )
op=$( echo -e "${options}" | wofi -i --dmenu | awk '{print}' ) op=$( echo -e "${options}" | wofi -i --dmenu -k /dev/null | awk '{print}' )
"${conf_dir}/global-shortcuts/${op}" "${conf_dir}/global-shortcuts/${op}"

View file

@ -1,17 +1,22 @@
#!/bin/bash #!/bin/bash
source "/usr/lib/sp-functions" source "/usr/lib/sp-functions"
source "${conf_dir}/config"
case $1 in case $1 in
file_manager ) file_manager )
launch_exec=${filemanager_cmd} launch_exec=${filemanager_cmd}
launch_arg=$( jq -r .[].home_directory "${conf_dir}/profiles/$( get_profile_id )/vars.json" ) launch_arg=($( jq -r .[].home_directory "${conf_dir}/profiles/$( get_profile_id )/vars.json" | envsubst ))
;; ;;
browser ) browser )
launch_exec=${browser_cmd} launch_exec=${browser_cmd}
launch_arg=$( jq -r .[].browser_profile "${conf_dir}/profiles/$( get_profile_id )/vars.json" ) launch_arg=($( jq -r .[].browser_profile "${conf_dir}/profiles/$( get_profile_id )/vars.json" ))
;;
browser-newtab )
launch_exec=${browser_cmd}
launch_arg=($( jq -r .[].browser_profile "${conf_dir}/profiles/$( get_profile_id )/vars.json" ))
launch_arg+=( "--new-tab" )
launch_arg+=($( jq -r .[].browser_newtab_url "${conf_dir}/profiles/$( get_profile_id )/vars.json" ))
;; ;;
esac esac
bash -c "${launch_exec} ${launch_arg}" ${launch_exec} "${launch_arg[@]}"

View file

@ -4,21 +4,19 @@ source "/usr/lib/sp-functions"
lock_script="${conf_dir}/lockscript" lock_script="${conf_dir}/lockscript"
unlock_script="${conf_dir}/unlockscript" unlock_script="${conf_dir}/unlockscript"
outputs=( $(swaymsg -t get_outputs | jq -r '.[] | {name} | "\(.name)"') )
for o in ${outputs[@]};do
workspace=$(swaymsg -t get_workspaces | jq -r '.[] | select(.output) | {name} | "\(.name)"')
wpno=$(cat "${cache_dir}/displays/${o}")
wp_imgpath="${conf_dir}/wallpaper/${o}/${wpno}.jpg"
sl_imgpath="${cache_dir}/lock/${o}.jpg"
convert -scale 10% -blur 0x3 -resize 500% "${wp_imgpath}" "${sl_imgpath}"
sl_args="${sl_args}--image ${o}:${sl_imgpath} "
done
if [ -f "${lock_script}" ]; then if [ -f "${lock_script}" ]; then
bash -c "${lock_script}" bash -c "${lock_script}"
fi fi
gtklock -s "${HOME}/.config/gtklock/style.css" lock_args=()
for s in "/usr/lib/$(uname -m)-linux-gnu/gtklock/"*"-module.so";do
lock_args+=("-m")
lock_args+=("${s}")
done
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 if [ -f "${unlock_script}" ]; then
bash -c "${unlock_script}" bash -c "${unlock_script}"
fi fi

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
op=$( echo -e "⏻ Poweroff\n Reboot\n Suspend\n🔒 Lock\n Logout" | wofi -i --dmenu -a | awk '{print tolower($2)}' ) op=$( echo -e "⏻ Poweroff\n Reboot\n Suspend\n Lock\n Logout" | wofi -i --dmenu -a -k /dev/null | awk '{print tolower($2)}' )
case $op in case $op in
poweroff) poweroff)
;& ;&

5
bin/sp-profile Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
source "/usr/lib/sp-functions"
get_profile_name `cat ~/.cache/sway-profiles/active_profile`

View file

@ -5,7 +5,7 @@ source "/usr/lib/sp-functions"
get_profile_list get_profile_list
case $1 in case $1 in
next|prev) next|prev|reload)
current_profile=$(cat "${cache_dir}/active_profile") current_profile=$(cat "${cache_dir}/active_profile")
echo ${current_profile} echo ${current_profile}
;;& ;;&
@ -17,7 +17,10 @@ case $1 in
new_profile=$(( ${current_profile}-1 )) new_profile=$(( ${current_profile}-1 ))
[[ "$new_profile" -eq "-1" ]] && new_profile=3 [[ "$new_profile" -eq "-1" ]] && new_profile=3
;;& ;;&
prev|next) reload)
new_profile=${current_profile}
;;&
prev|next|reload)
op=$(printf "%01d\n" ${new_profile}) op=$(printf "%01d\n" ${new_profile})
;; ;;
*) *)

View file

@ -3,7 +3,7 @@
source "/usr/lib/sp-functions" source "/usr/lib/sp-functions"
source "${conf_dir}/config" source "${conf_dir}/config"
op=$( echo -e "Output\nWindow\nRegion" | wofi -i --dmenu --width 250 --height 260 | awk '{print tolower($1)}' ) op=$( echo -e "Output\nWindow\nRegion" | wofi -i --dmenu --width 250 --height 260 -k /dev/null | awk '{print tolower($1)}' )
echo "$op" echo "$op"

View file

@ -5,6 +5,6 @@ source "/usr/lib/sp-functions"
current_profile=$( get_profile_id ) current_profile=$( get_profile_id )
profile_scripts=$( ls "${conf_dir}/profiles/${current_profile}/shortcuts/" ) profile_scripts=$( ls "${conf_dir}/profiles/${current_profile}/shortcuts/" )
op=$( echo -e "${profile_scripts}" | wofi -w 2 -i --dmenu | awk '{print}' ) op=$( echo -e "${profile_scripts}" | wofi -w 2 -i --dmenu -k /dev/null | awk '{print}' )
"${conf_dir}/profiles/${current_profile}/shortcuts/${op}" "${conf_dir}/profiles/${current_profile}/shortcuts/${op}"

View file

@ -11,6 +11,9 @@ setbg() {
for d in ${outputs[@]};do for d in ${outputs[@]};do
d_wpno=$(cat "${cache_dir}/displays/${d}") d_wpno=$(cat "${cache_dir}/displays/${d}")
swaymsg output "${d}" bg "${conf_dir}/wallpaper/${d}/${d_wpno}.jpg" fill swaymsg output "${d}" bg "${conf_dir}/wallpaper/${d}/${d_wpno}.jpg" fill
wp_imgpath="${conf_dir}/wallpaper/${d}/${d_wpno}.jpg"
sl_imgpath="${cache_dir}/lock/${d}.jpg"
convert -scale 10% -blur 0x3 -resize 500% "${wp_imgpath}" "${sl_imgpath}" &
done done
} }

View file

@ -1,59 +0,0 @@
sway-profiles (0.3.7) unstable; urgency=medium
* sp-profile-icon now returns active profile rather than active workspace profile
-- Penelope Gwen <support@pogmom.me> Tue, 29 Oct 2024 14:17:59 -0700
sway-profiles (0.3.6) unstable; urgency=medium
* make clipboard length customizable
-- Penelope Gwen <support@pogmom.me> Fri, 26 Jul 2024 13:29:45 -0600
sway-profiles (0.3.5) unstable; urgency=medium
* disable unnecessary waybar reload
-- Penelope Gwen <support@pogmom.me> Tue, 25 Jun 2024 02:32:59 -0600
sway-profiles (0.3.4) unstable; urgency=medium
* ensure that gtklock uses css file
-- Penelope Gwen <support@pogmom.me> Sat, 15 Jun 2024 22:53:59 -0600
sway-profiles (0.3.3) unstable; urgency=medium
* use gtklock instead of swaylock
-- Penelope Gwen <support@pogmom.me> Sat, 15 Jun 2024 12:15:42 -0600
sway-profiles (0.3.2) unstable; urgency=medium
* added some basic waybar integration
-- Penelope Gwen <support@pogmom.me> Tue, 11 Jun 2024 13:12:58 -0600
sway-profiles (0.3.1) unstable; urgency=medium
* added sp-lock lock scripts
-- Penelope Gwen <support@pogmom.me> Wed, 05 Jun 2024 15:44:39 -0600
sway-profiles (0.3) unstable; urgency=medium
* added sp-lock unlock scripts
-- Penelope Gwen <support@pogmom.me> Wed, 05 Jun 2024 15:29:28 -0600
sway-profiles (0.2) unstable; urgency=medium
* Remove dangling option from sp-powermenu.
-- Penelope Gwen <support@pogmom.me> Thu, 4 Jun 2024 04:08:33 -0600
sway-profiles (0.1) unstable; urgency=medium
* Initial release.
-- Penelope Gwen <support@pogmom.me> Thu, 3 Jun 2024 19:41:19 -0600

View file

@ -1,12 +0,0 @@
./bin/sp-clipboard
./bin/sp-global-shortcuts
./bin/sp-launcher
./bin/sp-lock
./bin/sp-powermenu
./bin/sp-profile-icon
./bin/sp-profiles
./bin/sp-rename
./bin/sp-screenshot
./bin/sp-shortcuts
./bin/sp-wallpaper
./lib/sp-functions

52
debian/changelog vendored
View file

@ -1,3 +1,55 @@
sway-profiles (0.3.15) unstable; urgency=medium
* all wofi menus now output cache to /dev/null to remain ordered statically
-- Penelope Gwen <support@pogmom.me> Thu, 17 Apr 2025 19:44:29 +0000
sway-profiles (0.3.14) unstable; urgency=medium
* added sp-profiles reload
-- Penelope Gwen <support@pogmom.me> Fri, 14 Mar 2025 22:52:33 +0000
sway-profiles (0.3.13) unstable; urgency=medium
* corrected lock character in sp-powermenu
-- Penelope Gwen <penelope@pogmom.me> Tue, 04 Mar 2025 22:00:00 +0000
sway-profiles (0.3.12) unstable; urgency=medium
* fix variable substitution in configs
-- Penelope Gwen <penelope@pogmom.me> Fri, 28 Feb 2025 10:30:49 +0000
sway-profiles (0.3.11) unstable; urgency=medium
* add sp-profile command which returns profile name
* add browser-newtab command to sp-launcher
-- Penelope Gwen <penelope@pogmom.me> Fri, 28 Feb 2025 07:27:58 +0000
sway-profiles (0.3.10) unstable; urgency=medium
* better support for gtklock modules
-- Penelope Gwen <penelope@pogmom.me> Fri, 28 Feb 2025 00:47:10 +0000
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 <support@pogmom.me> 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
* removed legacy swaylock code from sp-lock
-- Penelope Gwen <support@pogmom.me> Sun, 05 Jan 2025 02:36:39 +0000
sway-profiles (0.3.7) unstable; urgency=medium sway-profiles (0.3.7) unstable; urgency=medium
* sp-profile-icon now returns active profile rather than active workspace profile * sp-profile-icon now returns active profile rather than active workspace profile

View file

@ -1 +0,0 @@
sway-profiles

2
debian/files vendored
View file

@ -1,2 +0,0 @@
sway-profiles_0.3.7_all.deb X11 optional
sway-profiles_0.3.7_amd64.buildinfo X11 optional

View file

@ -1,2 +0,0 @@
misc:Depends=
misc:Pre-Depends=

View file

@ -1,14 +0,0 @@
Package: sway-profiles
Version: 0.3.7
Architecture: all
Maintainer: Penelope Gwen <support@pogmom.me>
Installed-Size: 30
Depends: swaybg, jq
Recommends: wofi, fonts-font-awesome, gtklock, imagemagick
Suggests: copyq, sway-screenshot
Section: X11
Priority: optional
Homepage: https://git.pogmom.me/pogmommy/sway-profiles
Description: Some scripts to organize workflows on sway
A handful of useful bash scripts that let you organize
your sway workspaces into profiles

View file

@ -1,15 +0,0 @@
4100fcf94c18a008155fb9c3159fcb22 usr/bin/sp-clipboard
b6f043cb7b206fa5a3c39cb27947b312 usr/bin/sp-global-shortcuts
cd67251212057f9c34530c11ac207c59 usr/bin/sp-launcher
38858053ab4812f56428cce5fe4384c2 usr/bin/sp-lock
80cab1f780c7698e1bda2372a8312d35 usr/bin/sp-powermenu
e74f597bfab09d3115a9d0d2162e132c usr/bin/sp-profile-icon
cba2c2614edb7b55e580403b4860f6be usr/bin/sp-profiles
4b6903aaee1f87fc7a9b5726f28a2c73 usr/bin/sp-rename
9a9efb90e993fdd2cafcf2477eadad6e usr/bin/sp-screenshot
a7b96bed0ed0154380fbf1812a29c087 usr/bin/sp-shortcuts
c4dc5ee97596c7e435e5cfb4bca83fec usr/bin/sp-wallpaper
0302e639499885ac8abd7d1f52f77fbd usr/lib/sp-functions
5e44407925ad33fe9b92e538ed776ac4 usr/share/doc/sway-profiles/README.Debian
764936ed964c4dc0d16343b1e063294d usr/share/doc/sway-profiles/changelog.gz
be67991063b81dfce896888bb802c2a0 usr/share/doc/sway-profiles/copyright

View file

@ -1,4 +0,0 @@
#!/bin/bash
#mkdir -p /etc/greetd
#update-alternatives --install /etc/greetd/config.toml greetd /usr/share/greetd/pogmom/config.toml 30 --force

View file

@ -1,3 +0,0 @@
#!/bin/bash
#update-alternatives --remove greetd /usr/share/greetd/pogmom/config.toml

View file

@ -1,22 +0,0 @@
#!/bin/bash
source "/usr/lib/sp-functions"
source "${conf_dir}/config"
cb_count=$(copyq count)
cb_count="${clipboard_length}"
wofilist=""
for i in $(seq $cb_count);do
cb_line="$( copyq read $((${i}-1)) | tr '\n' ' ' )"
if [[ "${cb_line}" == "" ]];then
cb_line=$( copyq read ? "$((${i}-1))" | head -n 1 )
fi
wofilist="${wofilist}${setnl}${i}. ${cb_line}"
setnl="\n"
done
selected=$( echo -e "${wofilist}" | wofi -i --dmenu -k /dev/null | cut -d. -f1)
copyq select "$(( ${selected}-1)) "

View file

@ -1,8 +0,0 @@
#!/bin/bash
source "/usr/lib/sp-functions"
options=$( ls "${conf_dir}/global-shortcuts/" )
op=$( echo -e "${options}" | wofi -i --dmenu | awk '{print}' )
"${conf_dir}/global-shortcuts/${op}"

View file

@ -1,17 +0,0 @@
#!/bin/bash
source "/usr/lib/sp-functions"
source "${conf_dir}/config"
case $1 in
file_manager )
launch_exec=${filemanager_cmd}
launch_arg=$( jq -r .[].home_directory "${conf_dir}/profiles/$( get_profile_id )/vars.json" )
;;
browser )
launch_exec=${browser_cmd}
launch_arg=$( jq -r .[].browser_profile "${conf_dir}/profiles/$( get_profile_id )/vars.json" )
;;
esac
bash -c "${launch_exec} ${launch_arg}"

View file

@ -1,24 +0,0 @@
#!/bin/bash
source "/usr/lib/sp-functions"
lock_script="${conf_dir}/lockscript"
unlock_script="${conf_dir}/unlockscript"
outputs=( $(swaymsg -t get_outputs | jq -r '.[] | {name} | "\(.name)"') )
for o in ${outputs[@]};do
workspace=$(swaymsg -t get_workspaces | jq -r '.[] | select(.output) | {name} | "\(.name)"')
wpno=$(cat "${cache_dir}/displays/${o}")
wp_imgpath="${conf_dir}/wallpaper/${o}/${wpno}.jpg"
sl_imgpath="${cache_dir}/lock/${o}.jpg"
convert -scale 10% -blur 0x3 -resize 500% "${wp_imgpath}" "${sl_imgpath}"
sl_args="${sl_args}--image ${o}:${sl_imgpath} "
done
if [ -f "${lock_script}" ]; then
bash -c "${lock_script}"
fi
gtklock -s "${HOME}/.config/gtklock/style.css"
if [ -f "${unlock_script}" ]; then
bash -c "${unlock_script}"
fi

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
op=$( echo -e "⏻ Poweroff\n Reboot\n Suspend\n🔒 Lock\n Logout" | wofi -i --dmenu -a | awk '{print tolower($2)}' )
case $op in
poweroff)
;&
reboot)
;&
suspend)
systemctl $op
;;
lock)
sp-lock
;;
logout)
swaymsg exit
;;
esac

View file

@ -1,5 +0,0 @@
#!/bin/bash
source "/usr/lib/sp-functions"
get_profile_icon `cat ~/.cache/sway-profiles/active_profile`

View file

@ -1,45 +0,0 @@
#!/usr/bin/env bash
source "/usr/lib/sp-functions"
get_profile_list
case $1 in
next|prev)
current_profile=$(cat "${cache_dir}/active_profile")
echo ${current_profile}
;;&
next)
new_profile=$(( ${current_profile}+1 ))
[[ "$new_profile" -eq "${p_count}" ]] && new_profile=0
;;&
prev)
new_profile=$(( ${current_profile}-1 ))
[[ "$new_profile" -eq "-1" ]] && new_profile=3
;;&
prev|next)
op=$(printf "%01d\n" ${new_profile})
;;
*)
for (( p="0"; p<${p_count}; p++ ));do
[[ $p -eq $(( ${p_count} - 1 )) ]] && nl="" || nl="\n"
wofilist="${wofilist}${p_icons[$p]} ${p_names[$p]}${nl}"
done
[[ -z $1 ]] && op=$( echo -e "${wofilist}" | wofi -i --dmenu --width 250 --height 320 -k /dev/null | awk '{print $2}' ) || op="${1}"
op=$(echo ${p_names[@]/$op//} | cut -d/ -f1 | wc -w | tr -d ' ')
;;
esac
[[ "$op" -gt "$(( $p_count - 1 ))" ]] && exit
[[ $op -eq "0" ]] && p_num="" || p_num="$op"
p_icon="${p_icons[$op]}"
for i in {1..10};do
[[ "$i" -eq "10" ]] && k="0" || k=$i
swaymsg 'bindsym $mod+'"$k"' workspace number "'"${p_num}${i}:${p_icon}"'"'
swaymsg 'bindsym $mod+Shift+'"$k"' move container to workspace number "'"${p_num}${i}:${p_icon}"'"'
done
moveto="${p_num}1:${p_icon}"
swaymsg 'workspace number "'"${p_num}"'"1:"'"${p_icon}"'"'
echo "${op}" > "${cache_dir}/active_profile"

View file

@ -1,7 +0,0 @@
#!/bin/bash
source "/usr/lib/sp-functions"
new_wsname="$( get_workspace_prefix )$(wofi -i --dmenu --height 1 --search $( get_workspace_name ))"
swaymsg 'rename workspace "'"$( get_workspace_fullname )"'" to "'"${new_wsname}"'"'

View file

@ -1,13 +0,0 @@
#!/usr/bin/env bash
source "/usr/lib/sp-functions"
source "${conf_dir}/config"
op=$( echo -e "Output\nWindow\nRegion" | wofi -i --dmenu --width 250 --height 260 | awk '{print tolower($1)}' )
echo "$op"
sleep 0.5
mkdir -p "${cache_dir}/screenshots/"
sway-screenshot -m $op --output-folder "${cache_dir}/screenshots/"
mv "${cache_dir}/screenshots/"* "${screenshot_dir}"

View file

@ -1,10 +0,0 @@
#!/bin/bash
source "/usr/lib/sp-functions"
current_profile=$( get_profile_id )
profile_scripts=$( ls "${conf_dir}/profiles/${current_profile}/shortcuts/" )
op=$( echo -e "${profile_scripts}" | wofi -w 2 -i --dmenu | awk '{print}' )
"${conf_dir}/profiles/${current_profile}/shortcuts/${op}"

View file

@ -1,30 +0,0 @@
#!/bin/bash
source "/usr/lib/sp-functions"
getwpno() {
wpno=$(printf "%02d\n" $(($(echo "$1" | awk '{print $1}' | grep -o "^[1-9]*")-1)) | cut -c 1 | sed 's/[^0-9]*//g')
echo "${wpno}" | tee "${cache_dir}/displays/${2}"
}
setbg() {
for d in ${outputs[@]};do
d_wpno=$(cat "${cache_dir}/displays/${d}")
swaymsg output "${d}" bg "${conf_dir}/wallpaper/${d}/${d_wpno}.jpg" fill
done
}
output=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | {name} | "\(.name)"')
outputs=( $(swaymsg -t get_outputs | jq -r '.[] | {name} | "\(.name)"') )
workspace=$(swaymsg -t get_workspaces | jq -r '.[] | select(.focused) | {name} | "\(.name)"')
getwpno "${workspace}" "${output}"
setbg "${output}" "${wpno}"
swaymsg -r -t subscribe -m '["workspace"]' | jq -rc --unbuffered 'select(.change == "focus") | .current | "\(.name) \(.output)"' | while read name output;do
wsno=$(($(echo "$name" | awk '{print $1}' | grep -o "^[1-9]*")-1))
wpno_last=$(cat "${cache_dir}/displays/${output}")
getwpno "${name}" "${output}"
if [[ "${wpno}" -ne "${wpno_last}" ]];then
setbg "${output}" "${wpno}"
fi
done

View file

@ -1,52 +0,0 @@
#!/bin/bash
conf_dir="$HOME/.config/sway-profiles"
cache_dir="$HOME/.cache/sway-profiles"
mkdir -p "${cache_dir}/"{displays,lock,screenshots}
get_workspace_id(){
workspace_id=$( printf "%02d\n" $( swaymsg -t get_workspaces | jq -r '.[] | select(.focused==true)|.name' | sed 's/:.*//' ) )
echo "${workspace_id}"
}
get_workspace_fullname(){
workspace_fullname=$( swaymsg -t get_workspaces | jq -r '.[] | select(.focused==true)|.name' )
echo "${workspace_fullname}"
}
get_workspace_prefix(){
workspace_prefix="$( grep -o '[0-9]*:[^a-zA-Z1-9]' <<< $( swaymsg -t get_workspaces | jq -r '.[] | select(.focused==true)|.name' ) )"
echo "${workspace_prefix}"
}
get_workspace_name(){
workspace_name=$( echo "$( get_workspace_fullname )" | sed 's/'"$( get_workspace_prefix )"'//' )
echo "${workspace_name}"
}
get_profile_id(){
current_workspace=$( printf "%02d\n" $(( $( swaymsg -t get_workspaces | jq -r '.[] | select(.focused==true)|.name' | sed 's/:.*//' ) - 1 )) )
echo "${current_workspace:0:1}"
}
get_profile_name(){
echo "test"
}
get_profile_list(){
p_icons=()
p_names=()
while read p;do
p_icons+=($( awk '{print $1}'<<<"${p}" ))
p_names+=($( awk '{print $2}'<<<"${p}" ))
done<"${conf_dir}/profile_list"
p_count="${#p_names[@]}"
}
get_profile_icon(){
get_profile_list
[ -z "${1}" ] && p=`get_active_profile` || p="${1}"
echo "${p_icons[ ${p} ]}"
}

View file

@ -1,6 +0,0 @@
sway-profiles for Debian
------------------------
Configuration files for sway's supporting programs
-- Penelope Gwen <support@pogmom.me>, Thu, 03 Jun 2024 19:45:09 -0600

View file

@ -1,60 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://git.pogmom.me/pogmommy/sway-profiles
Upstream-Name: sway-profiles
Upstream-Contact: Penelope Gwen <support@pogmom.me>
Files:
*
Copyright:
2024 Penelope Gwendolyn <support@pogmom.me>
License: Opinionated Queer License
PERMISSIONS
.
The creators of this Work (“The Licensor”) grant permission
to any person, group or legal entity that doesn't violate the prohibitions below (“The User”),
to do everything with this Work that would otherwise infringe their copyright or any patent claims,
subject to the following conditions:
.
OBLIGATIONS
.
The User must give appropriate credit to the Licensor,
provide a copy of this license or a (clickable, if the medium allows) link to
oql.avris.it/license/v1.1,
and indicate whether and what kind of changes were made.
The User may do so in any reasonable manner,
but not in any way that suggests the Licensor endorses the User or their use.
.
PROHIBITIONS
.
No one may use this Work for prejudiced or bigoted purposes, including but not limited to:
racism, xenophobia, queerphobia, queer exclusionism, homophobia, transphobia, enbyphobia, misogyny.
.
No one may use this Work to inflict or facilitate violence or abuse of human rights as defined in the
Universal Declaration of Human Rights.
.
No law enforcement, carceral institutions, immigration enforcement entities, military entities or military contractors
may use the Work for any reason. This also applies to any individuals employed by those entities.
.
No business entity where the ratio of pay (salaried, freelance, stocks, or other benefits)
between the highest and lowest individual in the entity is greater than 50 : 1
may use the Work for any reason.
.
No private business run for profit with more than a thousand employees
may use the Work for any reason.
.
Unless the User has made substantial changes to the Work,
or uses it only as a part of a new work (eg. as a library, as a part of an anthology, etc.),
they are prohibited from selling the Work.
That prohibition includes processing the Work with machine learning models.
.
SANCTIONS
.
If the Licensor notifies the User that they have not complied with the rules of the license,
they can keep their license by complying within 30 days after the notice.
If they do not do so, their license ends immediately.
.
WARRANTY
.
This Work is provided “as is”, without warranty of any kind, express or implied.
The Licensor will not be liable to anyone for any damages related to the Work or this license,
under any kind of legal claim as far as the law allows.

View file

@ -3,6 +3,10 @@
conf_dir="$HOME/.config/sway-profiles" conf_dir="$HOME/.config/sway-profiles"
cache_dir="$HOME/.cache/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} mkdir -p "${cache_dir}/"{displays,lock,screenshots}
@ -32,7 +36,9 @@ get_profile_id(){
} }
get_profile_name(){ get_profile_name(){
echo "test" get_profile_list
[ -z "${1}" ] && p=`get_active_profile` || p="${1}"
echo "${p_names[ ${p} ]}"
} }
get_profile_list(){ get_profile_list(){