New backup 2024-06-03 20:30:00

This commit is contained in:
Penelope Gwen 2024-06-03 20:30:00 -06:00
parent 36545f4f7b
commit 77ca41e57e
12 changed files with 11 additions and 249 deletions

View file

@ -1,20 +0,0 @@
#!/bin/bash
cb_count=$(copyq count)
cb_count=10
wofilist=""
for i in $(seq $cb_count);do
cb_line="$( copyq read $((${i}-1)) | tr '\n' ' ' )"
echo "${cb_line}"
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 "${HOME}/.local/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 "${HOME}/.local/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,16 +0,0 @@
#!/bin/bash
source "${HOME}/.local/lib/sp-functions"
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="$HOME/.config/sway/assets/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
swaylock ${sl_args}

View file

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

View file

@ -1,45 +0,0 @@
#!/usr/bin/env bash
source "$HOME/.local/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 "${HOME}/.local/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,12 +0,0 @@
#!/usr/bin/env bash
source "${HOME}/.local/lib/sp-functions"
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/"* "$HOME/Pictures/Screen Capture"

View file

@ -1,10 +0,0 @@
#!/bin/bash
source "${HOME}/.local/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 "${HOME}/.local/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 "$HOME/.config/sway/assets/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,51 +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
echo "${p_icons[ $( get_profile_id ) ]}"
}

View file

@ -11,17 +11,17 @@
.config/wofi
.config/alacritty
.local/bin/randomrat
.local/lib/sp-functions
.local/bin/sp-clipboard
.local/bin/sp-global-shortcuts
.local/bin/sp-launcher
.local/bin/sp-lock
.local/bin/sp-powermenu
.local/bin/sp-profiles
.local/bin/sp-rename
.local/bin/sp-screenshot
.local/bin/sp-shortcuts
.local/bin/sp-wallpaper
#.local/lib/sp-functions
#.local/bin/sp-clipboard
#.local/bin/sp-global-shortcuts
#.local/bin/sp-launcher
#.local/bin/sp-lock
#.local/bin/sp-powermenu
#.local/bin/sp-profiles
#.local/bin/sp-rename
#.local/bin/sp-screenshot
#.local/bin/sp-shortcuts
#.local/bin/sp-wallpaper
.config/sway-profiles
.config/environment.d
.config/hyfetch.json