Показаны сообщения с ярлыком linux. Показать все сообщения
Показаны сообщения с ярлыком linux. Показать все сообщения

17.09.2025

#on/off second monitor

#!/bin/bash

pid=`sed '1q;d' /tmp/mon_switch.pid`

if [[ -z "$pid" ]]; then

xrandr --output DVI-I-0 --off & echo "off" > /tmp/mon_switch.pid

else

xrandr --output DVI-I-0 --auto --left-of DVI-I-1

xrandr --output DVI-I-1 --primary & echo "" > /tmp/mon_switch.pid

fi


05.05.2024

dpms off, ignoring mouse and switch composer to prevent possible glitches

xinput --disable "Logitech USB Optical Mouse"
pkill picom
sleep .1
xset dpms force off
while : ; do
status="$(xset q)"
if [[ $status == *"Monitor is On"* ]]; then
xinput --enable "Logitech USB Optical Mouse"
setsid picom
break
fi
done

03.05.2024

try to exclude ai generated from search

vivaldi "https://google.com/?q=$(xclip -o) -\"stable diffusion\" -\"ai\" -\"midjourney\" -\"open art\" -\"prompt hunt\""

08.11.2023

open/close app by pid

pid=`sed '1q;d' /tmp/conky.pid`
if [[ -z "$pid" ]]; then
setsid conky -c ~/.config/conky/.conkyrc & echo $! > /tmp/conky.pid
xdotool key Alt
else
kill -9 $pid
echo "" > /tmp/conky.pid
xdotool key Alt
fi

12.10.2023

script to run/focus/close app


#!/bin/bash

app="sakura"

if [[ "$(xdotool getwindowfocus getwindowname)" != "$app" ]]; then
wmctrl -xa $app || $app
else
pkill $app
#wmctrl -xa Vivaldi-stable
fi