From 77ca41e57e07abae2a32be0823fbd2586a343004 Mon Sep 17 00:00:00 2001 From: Penelope Gwen Date: Mon, 3 Jun 2024 20:30:00 -0600 Subject: [PATCH] New backup 2024-06-03 20:30:00 --- de/home/.local/bin/sp-clipboard | 20 ---------- de/home/.local/bin/sp-global-shortcuts | 8 ---- de/home/.local/bin/sp-launcher | 17 --------- de/home/.local/bin/sp-lock | 16 -------- de/home/.local/bin/sp-powermenu | 22 ----------- de/home/.local/bin/sp-profiles | 45 ----------------------- de/home/.local/bin/sp-rename | 7 ---- de/home/.local/bin/sp-screenshot | 12 ------ de/home/.local/bin/sp-shortcuts | 10 ----- de/home/.local/bin/sp-wallpaper | 30 --------------- de/home/.local/lib/sp-functions | 51 -------------------------- de/include | 22 +++++------ 12 files changed, 11 insertions(+), 249 deletions(-) delete mode 100755 de/home/.local/bin/sp-clipboard delete mode 100755 de/home/.local/bin/sp-global-shortcuts delete mode 100755 de/home/.local/bin/sp-launcher delete mode 100755 de/home/.local/bin/sp-lock delete mode 100755 de/home/.local/bin/sp-powermenu delete mode 100755 de/home/.local/bin/sp-profiles delete mode 100755 de/home/.local/bin/sp-rename delete mode 100755 de/home/.local/bin/sp-screenshot delete mode 100755 de/home/.local/bin/sp-shortcuts delete mode 100755 de/home/.local/bin/sp-wallpaper delete mode 100755 de/home/.local/lib/sp-functions diff --git a/de/home/.local/bin/sp-clipboard b/de/home/.local/bin/sp-clipboard deleted file mode 100755 index f2011cd..0000000 --- a/de/home/.local/bin/sp-clipboard +++ /dev/null @@ -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)) " diff --git a/de/home/.local/bin/sp-global-shortcuts b/de/home/.local/bin/sp-global-shortcuts deleted file mode 100755 index 411e4f5..0000000 --- a/de/home/.local/bin/sp-global-shortcuts +++ /dev/null @@ -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}" diff --git a/de/home/.local/bin/sp-launcher b/de/home/.local/bin/sp-launcher deleted file mode 100755 index 445843f..0000000 --- a/de/home/.local/bin/sp-launcher +++ /dev/null @@ -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}" diff --git a/de/home/.local/bin/sp-lock b/de/home/.local/bin/sp-lock deleted file mode 100755 index e2613a8..0000000 --- a/de/home/.local/bin/sp-lock +++ /dev/null @@ -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} diff --git a/de/home/.local/bin/sp-powermenu b/de/home/.local/bin/sp-powermenu deleted file mode 100755 index ad96719..0000000 --- a/de/home/.local/bin/sp-powermenu +++ /dev/null @@ -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 diff --git a/de/home/.local/bin/sp-profiles b/de/home/.local/bin/sp-profiles deleted file mode 100755 index 15b173c..0000000 --- a/de/home/.local/bin/sp-profiles +++ /dev/null @@ -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" diff --git a/de/home/.local/bin/sp-rename b/de/home/.local/bin/sp-rename deleted file mode 100755 index 9ca8757..0000000 --- a/de/home/.local/bin/sp-rename +++ /dev/null @@ -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}"'"' diff --git a/de/home/.local/bin/sp-screenshot b/de/home/.local/bin/sp-screenshot deleted file mode 100755 index cbe63d1..0000000 --- a/de/home/.local/bin/sp-screenshot +++ /dev/null @@ -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" diff --git a/de/home/.local/bin/sp-shortcuts b/de/home/.local/bin/sp-shortcuts deleted file mode 100755 index 13a3594..0000000 --- a/de/home/.local/bin/sp-shortcuts +++ /dev/null @@ -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}" diff --git a/de/home/.local/bin/sp-wallpaper b/de/home/.local/bin/sp-wallpaper deleted file mode 100755 index 0434833..0000000 --- a/de/home/.local/bin/sp-wallpaper +++ /dev/null @@ -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 diff --git a/de/home/.local/lib/sp-functions b/de/home/.local/lib/sp-functions deleted file mode 100755 index fecd998..0000000 --- a/de/home/.local/lib/sp-functions +++ /dev/null @@ -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 ) ]}" -} diff --git a/de/include b/de/include index 62f4a2b..18562a7 100644 --- a/de/include +++ b/de/include @@ -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