New backup 2024-04-15 21:00:02
This commit is contained in:
parent
98b5529ef7
commit
4bafe8cc04
3 changed files with 10 additions and 5 deletions
BIN
de/home/.config/sway/assets/wallpaper/HDMI-A-1/3.jpg
Normal file
BIN
de/home/.config/sway/assets/wallpaper/HDMI-A-1/3.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 MiB |
Binary file not shown.
Before Width: | Height: | Size: 409 KiB |
|
@ -5,15 +5,16 @@ getpids() {
|
||||||
}
|
}
|
||||||
|
|
||||||
killpids() {
|
killpids() {
|
||||||
sleep 5
|
# sleep 5
|
||||||
for i in ${pids[@]};do
|
for i in ${pids[@]};do
|
||||||
kill "${i}" && echo "killed ${i}"
|
kill "${i}" && echo "killed ${i}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
getwpno() {
|
getwpno() {
|
||||||
wpno_last="${wpno}"
|
# wpno_last="${wpno}"
|
||||||
wpno=$(printf "%02d\n" $(($(echo "$1" | awk '{print $1}' | grep -o "^[1-9]*")-1)) | cut -c 1 | sed 's/[^0-9]*//g')
|
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 "$HOME/.cache/sway-wallpaper/${2}"
|
||||||
}
|
}
|
||||||
|
|
||||||
setbg() {
|
setbg() {
|
||||||
|
@ -21,21 +22,25 @@ setbg() {
|
||||||
swaymsg output "${output}" bg "$HOME/.config/sway/assets/wallpaper/${output}/${wpno}.jpg" fill
|
swaymsg output "${output}" bg "$HOME/.config/sway/assets/wallpaper/${output}/${wpno}.jpg" fill
|
||||||
}
|
}
|
||||||
|
|
||||||
wpno_last="9"
|
#wpno_last="9"
|
||||||
|
|
||||||
getpids
|
getpids
|
||||||
|
|
||||||
output=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | {name} | "\(.name)"')
|
output=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | {name} | "\(.name)"')
|
||||||
workspace=$(swaymsg -t get_workspaces | jq -r '.[] | select(.focused) | {name} | "\(.name)"')
|
workspace=$(swaymsg -t get_workspaces | jq -r '.[] | select(.focused) | {name} | "\(.name)"')
|
||||||
getwpno "${workspace}"
|
getwpno "${workspace}" "${output}"
|
||||||
setbg "${output}" "${wpno}"
|
setbg "${output}" "${wpno}"
|
||||||
|
|
||||||
killpids
|
killpids
|
||||||
|
|
||||||
swaymsg -r -t subscribe -m '["workspace"]' | jq -rc --unbuffered 'select(.change == "focus") | .current | "\(.name) \(.output)"' | while read name output;do
|
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))
|
wsno=$(($(echo "$name" | awk '{print $1}' | grep -o "^[1-9]*")-1))
|
||||||
|
echo $name
|
||||||
|
echo $output
|
||||||
getpids
|
getpids
|
||||||
getwpno "${name}"
|
wpno_last=$(cat "$HOME/.cache/sway-wallpaper/${output}")
|
||||||
|
getwpno "${name}" "${output}"
|
||||||
|
echo "${wpno_last}"
|
||||||
|
|
||||||
if [[ "${wpno}" -ne "${wpno_last}" ]];then
|
if [[ "${wpno}" -ne "${wpno_last}" ]];then
|
||||||
echo "hi"
|
echo "hi"
|
||||||
|
|
Loading…
Add table
Reference in a new issue