Add files via upload
This commit is contained in:
235
config/bspwm/bspwmrc
Executable file
235
config/bspwm/bspwmrc
Executable file
@@ -0,0 +1,235 @@
|
||||
#! /bin/sh
|
||||
|
||||
export XDG_CURRENT_DESKTOP='bspwm'
|
||||
|
||||
# Запуск демона горячих клавиш
|
||||
pgrep -x sxhkd >/dev/null || sxhkd &
|
||||
|
||||
#Autostart
|
||||
|
||||
# Picom
|
||||
/usr/bin/compfy --daemon &
|
||||
#/usr/bin/picom --daemon &
|
||||
#########pkill "picom"
|
||||
#########picom --daemon --animations --animation-window-mass 0.5 --animation-for-open-window slide-up --animation-stiffness-in-tag 650 --animation-for-transient-window slide-up
|
||||
|
||||
###picom --experimental-backends --daemon --animations --animation-window-mass 0.5 --animation-for-open-window zoom --animation-stiffness 350 --animation-for-transient-window zoom
|
||||
######picom --experimental-backends --daemon --animations --animation-window-mass 0.5 --animation-for-open-window slide-up --animation-stiffness 550 --animation-for-transient-window slide-up
|
||||
|
||||
# Cursor
|
||||
xsetroot -cursor_name left_ptr &
|
||||
|
||||
# Set display from arandr saved script
|
||||
# 2-й монитор вертикальный
|
||||
xrandr --dpi 102x102 --output HDMI-A-0 --mode 2560x1440 --rate 75 --pos 3440x0 --rotate left --output DisplayPort-0 --primary --mode 3440x1440 --rate 100 --pos 0x560 --rotate normal
|
||||
#xrandr --dpi 102x102 --output DP-1 --primary --mode 3440x1440 --rate 100 --pos 0x560 --rotate normal --output HDMI-0 --mode 2560x1440 --rate 75 --pos 3440x0 --rotate left
|
||||
#xrandr --dpi 102x102 --output DVI-D-0 --off --output DP-0 --primary --mode 3440x1440 --rate 100 --pos0x560 --rotate normal --output HDMI-0 --mode 2560x1440 --rate 75 --pos 3440x0 --rotate left --output DP-1 --off
|
||||
#xrandr --dpi 102x102 --output DVI-D-0 --off --output HDMI-0 --mode 2560x1440 --rate 75 --pos 3440x0 --rotate left --output DP-0 --primary --mode 3440x1440 --rate 100 --pos 0x560 --rotate normal --output DP-1 --off
|
||||
#xrandr --dpi 102x102 --output DVI-D-0 --off --output DP-0 --primary --mode 3440x1440 --rate 100 --pos 0x0 --rotate normal --output HDMI-0 --mode 2560x1440 --rate 75 --pos 3440x0 --rotate right --output DP-1 --off
|
||||
####xrandr --dpi 102x102 --output DVI-D-0 --off --output DP-0 --primary --mode 3440x1440 --rate 100 --pos 0x1120 --rotate normal --output HDMI-0 --mode 2560x1440 --rate 75 --pos 3440x0 --rotate right --output DP-1 --off
|
||||
|
||||
# Пердыдущая настройка горизонтальная
|
||||
#xrandr --dpi 102x102 --output DVI-D-0 --off --output DP-0 --primary --mode 3440x1440 --rate 100 --pos 0x0 --rotate normal --output HDMI-0 --mode 2560x1440 --rate 75 --pos 3440x0 --rotate normal --output DP-1 --off
|
||||
|
||||
##xrandr --dpi 102x102 --output DVI-D-0 --mode 1920x1080 --pos 2560x600 --rotate left --output HDMI-0 --mode 1920x1080 --pos 320x0 --rotate normal --output DP-0 --primary --mode 2560x1440 --rate 75 --pos 0x1080 --rotate normal
|
||||
#xrandr --dpi 102x102 --output DVI-D-0 --off --output HDMI-0 --off --output DP-0 --primary --mode 2560x1440 --rate 75 --pos 0x0 --rotate normal --output DP-1 --off
|
||||
###sh $HOME/.screenlayout/start.sh
|
||||
|
||||
# Запуск демона оповещений
|
||||
####pkill "dunst"
|
||||
/usr/bin/dunst &
|
||||
|
||||
# Polkit
|
||||
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
|
||||
|
||||
/usr/libexec/xdg-desktop-portal-gtk &
|
||||
xdg-user-dirs-gtk-update
|
||||
snapshot-detect
|
||||
xscreensaver -no-splash &
|
||||
#/usr/local/bin/vivaldi-stop-screensaver.sh &
|
||||
#/usr/local/bin/stop-screensaver.sh &
|
||||
#xset s 0 0
|
||||
|
||||
# Wallpaper
|
||||
nitrogen --restore &
|
||||
|
||||
# Шумодав для микрофона
|
||||
#######pipewire -c filter-chain/source-rnnoise.conf &
|
||||
|
||||
# Отключение вертикальной синхронизации
|
||||
#nvidia-settings -a 'SyncToVBlank=0'
|
||||
#nvidia-settings -a "[gpu:0]/GpuPowerMizerMode=1"
|
||||
|
||||
# Start Polybar
|
||||
##if [ -x /usr/bin/polybar ]; then
|
||||
## bash $HOME/.config/polybar/launch.sh
|
||||
##fi
|
||||
|
||||
# Раскладка клавиатуры
|
||||
#setxkbmap -model pc105 -layout "us,ru" -option grp:ctrl_shift_toggle &
|
||||
setxkbmap -layout us,ru -option grp:ctrl_shift_toggle &
|
||||
# Настройка скорости повторения клавиш
|
||||
xset r 22 r rate 500 30 &
|
||||
# Отключение акселирации у мыши
|
||||
xset m 2 1 &
|
||||
# Отключение спящего режима монитора
|
||||
####xset -dpms s off
|
||||
xset -dpms &
|
||||
|
||||
bspc monitor DisplayPort-0 -n monitor0 -d I II III IV V VI VII IX X
|
||||
bspc monitor HDMI-A-0 -n monitor1 -d VIII
|
||||
#bspc monitor DVI-D-0 -d IX
|
||||
|
||||
#bspc monitor DP-0 -n monitor0 -d I II III IV V VI VII IX X
|
||||
#bspc monitor HDMI-0 -n monitor1 -d VIII
|
||||
bspc monitor DisplayPort-0 -s HDMI-A-0
|
||||
|
||||
bspc config automatic_scheme alternate
|
||||
bspc config initial_polarity second_child
|
||||
bspc config removal_adjustment true
|
||||
|
||||
#bspc config external_rules_command ~/.config/bspwm/scripts/external_rules
|
||||
bspc config border_width 2
|
||||
#bspc config window_gap 6
|
||||
bspc config window_gap 9
|
||||
bspc config split_ratio 0.50
|
||||
bspc config borderless_monocle true
|
||||
bspc config single_monocle true
|
||||
bspc config gapless_monocle true
|
||||
bspc config pointer_follows_focus false
|
||||
bspc config focus_follows_pointer true
|
||||
|
||||
# Border
|
||||
bspc config focused_border_color "#458588"
|
||||
bspc config normal_border_color "#383737"
|
||||
bspc config active_border_color "#383737"
|
||||
bspc config presel_feedback_color "#504945"
|
||||
|
||||
# remove all rules first
|
||||
bspc rule -r *:*
|
||||
|
||||
# Desktop 1
|
||||
bspc rule -a kitterm desktop='^1' focus=on
|
||||
bspc rule -a nmail desktop='^1' focus=on
|
||||
|
||||
# Desktop 2
|
||||
bspc rule -a qutebrowser desktop='^2' follow=on focus=on
|
||||
bspc rule -a Vivaldi-stable desktop='^2' follow=on focus=on
|
||||
#bspc rule -a firefox-esr desktop='^2'
|
||||
#bspc rule -a firefox-esr:*:Picture-in-Picture state=floating
|
||||
#bspc rule -a Places desktop='^2' state=floating
|
||||
|
||||
# Desktop 3
|
||||
##bspc rule -a firefox desktop='^2'
|
||||
##bspc rule -a firefox:*:Picture-in-Picture state=floating
|
||||
#bspc rule -a Cherrytree desktop='^2' focus=on
|
||||
|
||||
# Desktop 4
|
||||
#bspc rule -a Pcmanfm:Dialog state=floating center=true
|
||||
bspc rule -a TelegramDesktop desktop='^4' focus=on
|
||||
#bspc rule -a KotatogramDesktop desktop='^4' focus=on
|
||||
bspc rule -a AyuGramDesktop desktop='^4' focus=on
|
||||
#bspc rule -a Ripcord desktop='^4' focus=on
|
||||
#bspc rule -a Cawbird desktop='^4' focus=on
|
||||
#bspc rule -a Hexchat desktop='^4' focus=on
|
||||
bspc rule -a matrix desktop='^4' focus=on
|
||||
|
||||
# Desktop 5
|
||||
bspc rule -a "VirtualBox Manager" desktop='^5' focus=on
|
||||
|
||||
# Desktop 6 說
|
||||
bspc rule -a steam desktop='^5' focus=on
|
||||
bspc rule -a Gimp-3.0 desktop='^6' follow=on focus=on
|
||||
bspc rule -a Gimp-2.10 desktop='^6' follow=on focus=on
|
||||
bspc rule -a Gimp desktop='^6' follow=on focus=on
|
||||
bspc rule -a ocenaudio desktop='^6' follow=on focus=on
|
||||
#bspc rule -a Audacious desktop='^6' focus=on
|
||||
bspc rule -a Shotcut desktop='^6' focus=on
|
||||
|
||||
# Desktop 7 ﰭ
|
||||
bspc rule -a Tixati desktop='^7' focus=on
|
||||
#bspc rule -a Deluge-gtk desktop='^7' focus=on
|
||||
|
||||
# Desktop 8 藍
|
||||
#bspc rule -a Xfce4-terminal desktop='^8' focus=on
|
||||
#bspc rule -a Tilix desktop='^8' focus=on
|
||||
|
||||
# Desktop 9
|
||||
#bspc rule -a thunderbird desktop='^9' focus=on
|
||||
bspc rule -a obsidian desktop='^8' focus=on
|
||||
|
||||
# Desktop 10 (2-й монитор DELL)
|
||||
bspc rule -a obs desktop='^10' focus=on
|
||||
bspc rule -a FreeTube desktop='^10' focus=on
|
||||
bspc rule -a Grayjay desktop='^10' focus=on
|
||||
bspc rule -a WebApp-microblog desktop='^10' focus=on
|
||||
|
||||
# Без привязки
|
||||
####bspc rule -a FluffyChat state=tiled
|
||||
bspc rule -a Authpass state=tiled
|
||||
#bspc rule -a hexchat state=tiled
|
||||
bspc rule -a Yad state=floating
|
||||
bspc rule -a pavucontrol state=floating center=true
|
||||
bspc rule -a windot state=floating sticky=off center=false rectangle=988x520+1215+1000
|
||||
bspc rule -a marktext state=floating center=true
|
||||
bspc rule -a Xed state=floating center=true
|
||||
bspc rule -a nvim_notes state=floating sticky=on center=false rectangle=800x1020+2500+700
|
||||
#bspc rule -a Kupfer.py focus=on
|
||||
#bspc rule -a Screenkey manage=off
|
||||
####bspc rule -a mpv state=floating sticky=on rectangle=300x180+1060+475
|
||||
bspc rule -a dragon-drop focus=off
|
||||
#bspc rule -a KeePassXC hidden=on focus=on
|
||||
#bspc rule -a MEGAsync state=floating border=off
|
||||
#bspc rule -a Nextcloud state=floating border=off
|
||||
bspc rule -a clipse state=floating rectangle=720x800+1060+475 center=true
|
||||
|
||||
#bspc config -d mpd window_gap 262
|
||||
#bspc config -d mpd top_padding -34
|
||||
|
||||
# Move cursor center display
|
||||
######xdotool mousemove 1200 1760
|
||||
|
||||
# Autostart Applications
|
||||
redshift-gtk &
|
||||
#ayugram-desktop &
|
||||
AyuGram &
|
||||
#telegram-desktop &
|
||||
#kotatogram-desktop &
|
||||
###ripcord &
|
||||
openrgb --startminimized --profile "zloy" &
|
||||
#obsidian &
|
||||
|
||||
# Move cursor center display
|
||||
xdotool mousemove 1500 800
|
||||
|
||||
#kitty --class "nmail" --session ~/.config/kitty/session_mail.conf &
|
||||
sleep 3
|
||||
kitty --class "kitterm" --session ~/.config/kitty/session.conf &
|
||||
#kitty --class "matrix" --session ~/.config/kitty/session_matrix.conf &
|
||||
#kitty --class "clipse" --session ~/.config/kitty/session_clipse.conf &
|
||||
|
||||
#sleep 2
|
||||
#megasync &
|
||||
seafile-applet &
|
||||
alertify &
|
||||
#deluge-gtk &
|
||||
keepassxc &
|
||||
#parcellite &
|
||||
#/usr/bin/clipton watcher &
|
||||
easyeffects --gapplication-service
|
||||
blueman-applet &
|
||||
clipse --listen-shell &
|
||||
###systemctl --user start polybar.service
|
||||
#sleep 5
|
||||
|
||||
#/usr/bin/telegram-desktop -workdir /home/zloy_linux/.local/share/TelegramDesktop/ -autostart &
|
||||
#psensor &
|
||||
|
||||
# Переключение на
|
||||
sleep 3
|
||||
bspc desktop -f ^2
|
||||
|
||||
####tixati &
|
||||
|
||||
# Low battery notifier
|
||||
#~/.config/bspwm/scripts/low_bat_notifier.sh
|
||||
3
config/bspwm/scripts/clipse.sh
Executable file
3
config/bspwm/scripts/clipse.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
kitty --class clipse -e clipse keep
|
||||
9
config/bspwm/scripts/hide_win.sh
Executable file
9
config/bspwm/scripts/hide_win.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
hidden=$(bspc query -N -n .hidden -d focused)
|
||||
|
||||
if [ -z "$hidden" ]; then
|
||||
bspc node focused -g hidden=on
|
||||
else
|
||||
bspc node "$hidden" -g hidden=off
|
||||
fi
|
||||
BIN
config/bspwm/scripts/i3lock-fancy/circlelock.png
Executable file
BIN
config/bspwm/scripts/i3lock-fancy/circlelock.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
BIN
config/bspwm/scripts/i3lock-fancy/circlelockdark.png
Executable file
BIN
config/bspwm/scripts/i3lock-fancy/circlelockdark.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
141
config/bspwm/scripts/i3lock-fancy/i3lock-fancy.sh
Executable file
141
config/bspwm/scripts/i3lock-fancy/i3lock-fancy.sh
Executable file
@@ -0,0 +1,141 @@
|
||||
#!/usr/bin/env bash
|
||||
# Author: Dolores Portalatin <hello@doloresportalatin.info>
|
||||
# Dependencies: imagemagick, i3lock-color-git, scrot, wmctrl (optional)
|
||||
|
||||
# Aquired from https://github.com/meskarune/i3lock-fancy
|
||||
# Modified for use
|
||||
|
||||
set -o errexit -o noclobber -o nounset
|
||||
|
||||
hue=(-level "0%,100%,0.6")
|
||||
effect=(-filter Gaussian -resize 20% -define "filter:sigma=1.5" -resize 500.5%)
|
||||
# default system sans-serif font
|
||||
font=$(convert -list font | awk "{ a[NR] = \$2 } /family: $(fc-match sans -f "%{family}\n")/ { print a[NR-1]; exit }")
|
||||
image=$(mktemp --suffix=.png)
|
||||
shot=(import -window root)
|
||||
desktop=""
|
||||
i3lock_cmd=(i3lock -i "$image")
|
||||
shot_custom=false
|
||||
|
||||
options="Options:
|
||||
-h, --help This help menu.
|
||||
|
||||
-d, --desktop Attempt to minimize all windows before locking.
|
||||
|
||||
-g, --greyscale Set background to greyscale instead of color.
|
||||
|
||||
-p, --pixelate Pixelate the background instead of blur, runs faster.
|
||||
|
||||
-f <fontname>, --font <fontname> Set a custom font.
|
||||
|
||||
-t <text>, --text <text> Set a custom text prompt.
|
||||
|
||||
-l, --listfonts Display a list of possible fonts for use with -f/--font.
|
||||
Note: this option will not lock the screen, it displays
|
||||
the list and exits immediately.
|
||||
|
||||
-n, --nofork Do not fork i3lock after starting.
|
||||
|
||||
-- Must be last option. Set command to use for taking a
|
||||
screenshot. Default is 'import -window root'. Using 'scrot'
|
||||
or 'maim' will increase script speed and allow setting
|
||||
custom flags like having a delay."
|
||||
|
||||
# move pipefail down as for some reason "convert -list font" returns 1
|
||||
set -o pipefail
|
||||
trap 'rm -f "$image"' EXIT
|
||||
temp="$(getopt -o :hdnpglt:f: -l desktop,help,listfonts,nofork,pixelate,greyscale,text:,font: --name "$0" -- "$@")"
|
||||
eval set -- "$temp"
|
||||
|
||||
# l10n support
|
||||
text="Type password to unlock"
|
||||
case "${LANG:-}" in
|
||||
af_* ) text="Tik wagwoord om te ontsluit" ;; # Afrikaans
|
||||
de_* ) text="Bitte Passwort eingeben" ;; # Deutsch
|
||||
da_* ) text="Indtast adgangskode" ;; # Danish
|
||||
en_* ) text="Type password to unlock" ;; # English
|
||||
es_* ) text="Ingrese su contraseña" ;; # Española
|
||||
fr_* ) text="Entrez votre mot de passe" ;; # Français
|
||||
he_* ) text="הליענה לטבל המסיס דלקה" ;; # Hebrew עברית (convert doesn't play bidi well)
|
||||
hi_* ) text="अनलॉक करने के लिए पासवर्ड टाईप करें" ;; #Hindi
|
||||
id_* ) text="Masukkan kata sandi Anda" ;; # Bahasa Indonesia
|
||||
it_* ) text="Inserisci la password" ;; # Italian
|
||||
ja_* ) text="パスワードを入力してください" ;; # Japanese
|
||||
lv_* ) text="Ievadi paroli" ;; # Latvian
|
||||
nb_* ) text="Skriv inn passord" ;; # Norwegian
|
||||
pl_* ) text="Podaj hasło" ;; # Polish
|
||||
pt_* ) text="Digite a senha para desbloquear" ;; # Português
|
||||
tr_* ) text="Giriş yapmak için şifrenizi girin" ;; # Turkish
|
||||
ru_* ) text="Введите пароль" ;; # Russian
|
||||
* ) text="Type password to unlock" ;; # Default to English
|
||||
esac
|
||||
|
||||
while true ; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
printf "Usage: %s [options]\n\n%s\n\n" "${0##*/}" "$options"; exit 1 ;;
|
||||
-d|--desktop) desktop=$(command -V wmctrl) ; shift ;;
|
||||
-g|--greyscale) hue=(-level "0%,100%,0.6" -set colorspace Gray -average) ; shift ;;
|
||||
-p|--pixelate) effect=(-scale 10% -scale 1000%) ; shift ;;
|
||||
-f|--font)
|
||||
case "$2" in
|
||||
"") shift 2 ;;
|
||||
*) font=$2 ; shift 2 ;;
|
||||
esac ;;
|
||||
-t|--text) text=$2 ; shift 2 ;;
|
||||
-l|--listfonts)
|
||||
convert -list font | awk -F: '/Font: / { print $2 }' | sort -du | command -- ${PAGER:-less}
|
||||
exit 0 ;;
|
||||
-n|--nofork) i3lock_cmd+=(--nofork) ; shift ;;
|
||||
--) shift; shot_custom=true; break ;;
|
||||
*) echo "error" ; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if "$shot_custom" && [[ $# -gt 0 ]]; then
|
||||
shot=("$@");
|
||||
fi
|
||||
|
||||
command -- "${shot[@]}" "$image"
|
||||
|
||||
value="60" #brightness value to compare to
|
||||
|
||||
color=$(convert "$image" -gravity center -crop 100x100+0+0 +repage -colorspace hsb \
|
||||
-resize 1x1 txt:- | awk -F '[%$]' 'NR==2{gsub(",",""); printf "%.0f\n", $(NF-1)}');
|
||||
|
||||
if [[ $color -gt $value ]]; then #white background image and black text
|
||||
bw="black"
|
||||
icon="/home/$USER/.config/bspwm/scripts/i3lock-fancy/circlelockdark.png"
|
||||
param=("--insidecolor=0000001c" "--ringcolor=0000003e" \
|
||||
"--linecolor=00000000" "--keyhlcolor=ffffff80" "--ringvercolor=ffffff00" \
|
||||
"--separatorcolor=22222260" "--insidevercolor=ffffff1c" \
|
||||
"--ringwrongcolor=ffffff55" "--insidewrongcolor=ffffff1c" \
|
||||
"--verifcolor=ffffff00" "--wrongcolor=ff000000" "--timecolor=ffffff00" \
|
||||
"--datecolor=ffffff00" "--layoutcolor=ffffff00")
|
||||
else #black
|
||||
bw="white"
|
||||
icon="/home/$USER/.config/bspwm/scripts/i3lock-fancy/circlelock.png"
|
||||
param=("--insidecolor=ffffff1c" "--ringcolor=ffffff3e" \
|
||||
"--linecolor=ffffff00" "--keyhlcolor=00000080" "--ringvercolor=00000000" \
|
||||
"--separatorcolor=22222260" "--insidevercolor=0000001c" \
|
||||
"--ringwrongcolor=00000055" "--insidewrongcolor=0000001c" \
|
||||
"--verifcolor=00000000" "--wrongcolor=ff000000" "--timecolor=00000000" \
|
||||
"--datecolor=00000000" "--layoutcolor=00000000")
|
||||
fi
|
||||
|
||||
convert "$image" "${hue[@]}" "${effect[@]}" -font "$font" -pointsize 26 -fill "$bw" -gravity center \
|
||||
-annotate +0+160 "$text" "$icon" -gravity center -composite "$image"
|
||||
|
||||
# If invoked with -d/--desktop, we'll attempt to minimize all windows (ie. show
|
||||
# the desktop) before locking.
|
||||
${desktop} ${desktop:+-k on}
|
||||
|
||||
# try to use i3lock with prepared parameters
|
||||
if ! "${i3lock_cmd[@]}" "${param[@]}" >/dev/null 2>&1; then
|
||||
# We have failed, lets get back to stock one
|
||||
"${i3lock_cmd[@]}"
|
||||
fi
|
||||
|
||||
# As above, if we were passed -d/--desktop, we'll attempt to restore all windows
|
||||
# after unlocking.
|
||||
${desktop} ${desktop:+-k off}
|
||||
5
config/bspwm/scripts/keybindings_rofi.sh
Executable file
5
config/bspwm/scripts/keybindings_rofi.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
awk '/^[a-z]/ && last {print "<small>",$0,"\t",last,"</small>"} {last=""} /^#/{last=$0}' ~/.config/sxhkd/sxhkdrc |
|
||||
column -t -s $'\t' |
|
||||
rofi -dmenu -i -p "keybindings:" -markup-rows -no-show-icons -width 1000 -lines 15 -yoffset 40
|
||||
66
config/bspwm/scripts/low_bat_notifier.sh
Executable file
66
config/bspwm/scripts/low_bat_notifier.sh
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
|
||||
### VARIABLES
|
||||
|
||||
POLL_INTERVAL=120 # seconds at which to check battery level
|
||||
LOW_BAT=33 # lesser than this is considered low battery
|
||||
|
||||
# If BAT0 doesn't work for you, check available devices with command below
|
||||
#
|
||||
# $ ls -1 /sys/class/power_supply/
|
||||
#
|
||||
BAT_PATH=/sys/class/power_supply/BAT0
|
||||
BAT_STAT=$BAT_PATH/status
|
||||
|
||||
if [[ -f $BAT_PATH/charge_full ]]
|
||||
then
|
||||
BAT_FULL=$BAT_PATH/charge_full
|
||||
BAT_NOW=$BAT_PATH/charge_now
|
||||
elif [[ -f $BAT_PATH/energy_full ]]
|
||||
then
|
||||
BAT_FULL=$BAT_PATH/energy_full
|
||||
BAT_NOW=$BAT_PATH/energy_now
|
||||
else
|
||||
exit
|
||||
fi
|
||||
|
||||
### END OF VARIABLES
|
||||
|
||||
kill_running() { # stop older instances to not get multiple notifications
|
||||
local mypid=$$
|
||||
|
||||
declare pids=($(pgrep -f ${0##*/}))
|
||||
|
||||
for pid in ${pids[@]/$mypid/}; do
|
||||
kill $pid
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
launched=0
|
||||
|
||||
# Run only if battery is detected
|
||||
if ls -1qA /sys/class/power_supply/ | grep -q BAT
|
||||
then
|
||||
|
||||
kill_running
|
||||
|
||||
while true
|
||||
do
|
||||
bf=$(cat $BAT_FULL)
|
||||
bn=$(cat $BAT_NOW)
|
||||
bs=$(cat $BAT_STAT)
|
||||
|
||||
bat_percent=$(( 100 * $bn / $bf ))
|
||||
|
||||
if [[ $bat_percent -lt $LOW_BAT && "$bs" = "Discharging" && $launched -lt 3 ]]
|
||||
then
|
||||
notify-send --urgency=critical "$bat_percent% : Low Battery!"
|
||||
launched=$((launched+1))
|
||||
elif [[ "$bs" = "Charging" ]]
|
||||
then
|
||||
launched=0
|
||||
fi
|
||||
sleep $POLL_INTERVAL
|
||||
done
|
||||
fi
|
||||
13
config/bspwm/scripts/nvim_notes.sh
Executable file
13
config/bspwm/scripts/nvim_notes.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
#kitty --class clipse -e clipse keep
|
||||
# find existing node
|
||||
NODE=$(for id in $(bspc query -N -n .window); do
|
||||
xprop -id $id WM_CLASS 2>/dev/null | grep -q "nvim_notes" && echo $id && break
|
||||
done)
|
||||
if [ -n "$NODE" ]; then
|
||||
bspc node "$NODE" -d focused
|
||||
bspc node "$NODE" -f
|
||||
exit 0
|
||||
fi
|
||||
kitty --class nvim_notes --session ~/.config/kitty/session_nvim.conf &
|
||||
20
config/bspwm/scripts/screenshot.sh
Executable file
20
config/bspwm/scripts/screenshot.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# options to be displayed
|
||||
option0="screen"
|
||||
option1="area"
|
||||
option2="window"
|
||||
|
||||
# options to be displyed
|
||||
options="$option0\n$option1\n$option2"
|
||||
|
||||
selected="$(echo -e "$options" | rofi -lines 3 -dmenu -font "Ubuntu Medium 13" -p "scrot")"
|
||||
case $selected in
|
||||
$option0)
|
||||
cd ~/Скриншоты/ && sleep 1 && scrot '%j_%d-%m-%Y_%T'.png;;
|
||||
$option1)
|
||||
cd ~/Скриншоты/ && scrot -s '%j_%d-%m-%Y_%T'.png;;
|
||||
$option2)
|
||||
cd ~/Скриншоты/ && sleep 1 && scrot -u '%j_%d-%m-%Y_%T'.png;;
|
||||
esac
|
||||
|
||||
34
config/bspwm/scripts/toggle_note_kitty.sh
Executable file
34
config/bspwm/scripts/toggle_note_kitty.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
WIN_CLASS="nvim_notes"
|
||||
|
||||
find_node() {
|
||||
for id in $(bspc query -N -n .window); do
|
||||
xprop -id "$id" WM_CLASS 2>/dev/null | grep -q "$WIN_CLASS" && echo "$id" && return
|
||||
done
|
||||
}
|
||||
|
||||
NODE=$(find_node)
|
||||
|
||||
if [ -n "$NODE" ]; then
|
||||
# если окно скрыто — показать, иначе скрыть
|
||||
HIDDEN=$(bspc query -N -n "$NODE" --names 2>/dev/null | grep -q hidden && echo yes || echo no)
|
||||
# надёжно: проверим фокус
|
||||
FOC=$(bspc query -N -n focused.window 2>/dev/null)
|
||||
if [ "$NODE" = "$FOC" ]; then
|
||||
bspc node "$NODE" -g hidden=on
|
||||
exit 0
|
||||
fi
|
||||
# toggle hidden state
|
||||
# попробуем прочитать флаг hidden через query -T (если доступно)
|
||||
if bspc query -T -n "$NODE" 2>/dev/null | grep -q '"hidden": true'; then
|
||||
bspc node "$NODE" -g hidden=off
|
||||
bspc node "$NODE" -d focused
|
||||
bspc node "$NODE" -f
|
||||
else
|
||||
bspc node "$NODE" -g hidden=on
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# если не найден — запустить
|
||||
~/.config/bspwm/scripts/nvim_notes.sh &
|
||||
9
config/bspwm/scripts/toogle_kb.sh
Executable file
9
config/bspwm/scripts/toogle_kb.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#! /bin/bash
|
||||
|
||||
CURRENT_LAYOUT=$(setxkbmap -query|awk -F : 'NR==3{print $2}'|sed 's/ //g')
|
||||
|
||||
if [ "$CURRENT_LAYOUT" = "us" ]; then
|
||||
setxkbmap "ru"
|
||||
else
|
||||
setxkbmap "us"
|
||||
fi
|
||||
Reference in New Issue
Block a user