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

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

25.09.2023

format to ext4 and delete journal
thnx to mikeslr

mkfs.ext4 /dev/sdg1
tune2fs -o journal_data_writeback /dev/sdg1
tune2fs -O ^has_journal /dev/sdg1

24.09.2023

Linux autologin without DM (tested on Fedora 38)

tty autologin
• install mingetty
• sudo nano /etc/systemd/system/getty.target.wants/getty@tty1.service
• go to [Service] and change ExecStart=... to:
ExecStart=-/sbin/mingetty --autologin user_name %I
and (optional) Type=... to:
Type=simple

autostart X
echo -en 'if [ -z "${DISPLAY}" ] && [ "\n{XDG_VTNR}" -eq 1 ]; then\n  startx\nfi'>>.bash_profile

start openbox
echo openbox-session>.xinitrc

13.04.2023

temperature for conky (gismmeteo):
${font :style=Bold:size=22}${execi 300 curl -s -A Tormozilla1.0 https://www.gismeteo.ru/weather-moscow-4368/|grep -oP 'temperatureAir"\:\[\K.*?(?=])'} ${font :size=16}${execi 300 curl -s -A Tormozilla1.0 https://www.gismeteo.ru/weather-moscow-4368/10-days/|grep -oP 'temperature_c"\K.*?(?=<)'|sed -n 2,3p|sed 's/−/-/g'|sed 's/>/ /g'|tr -d '\n'}

06.07.2022

visual fix for RSS Feed Reader extension

* {
background: #000!important;
color: #ddd!important;
border: none!important;
outline: none!important;
box-shadow: none!important;
}