From 761b4e2bac8297bf02f597fad24ebf04aef64a64 Mon Sep 17 00:00:00 2001 From: Nikolai Papin Date: Mon, 17 Nov 2025 17:50:56 +0300 Subject: [PATCH] refactor: moved useful scripts from the bspwm folder to more appropriate locations; fix: checkupdates script for fastfetch causing delays; chore: removed bspwm and picom since I haven't been using or maintaining them --- bspwm/bspwm_resize.sh | 25 -- bspwm/bspwmrc | 78 ---- bspwm/bspwmrc.save | 41 -- bspwm/capsindicator.sh | 13 - bspwm/checkupdates.sh | 20 - bspwm/games.sh | 8 - bspwm/grayscale.sh | 10 - bspwm/lockscreen.sh | 1 - bspwm/margin.sh | 11 - bspwm/marked.sh | 19 - bspwm/monocle_improved.sh | 7 - bspwm/music.sh | 14 - bspwm/polyhide.sh | 17 - bspwm/prevent_suspend.sh | 9 - bspwm/ptt.sh | 22 - bspwm/set_window_size.sh | 34 -- bspwm/shrink.sh | 26 -- bspwm/toggle-monitor-grayscale.sh | 224 ---------- bspwm/toggle-picom.sh | 8 - bspwm/touchpad.sh | 7 - fastfetch/brawl.jsonc | 2 +- fastfetch/scripts/fetch_update_count.sh | 2 + fastfetch/scripts/updates.sh | 24 + hypr/hyprland.conf | 6 +- .../proxy.sh => hypr/scripts/toggle_proxy.sh | 0 picom/picom.conf | 409 ------------------ picom/picom.conf.glsl | 18 - picom/picom.conf.old | 350 --------------- swaync/config.json | 2 +- 29 files changed, 31 insertions(+), 1376 deletions(-) delete mode 100755 bspwm/bspwm_resize.sh delete mode 100755 bspwm/bspwmrc delete mode 100755 bspwm/bspwmrc.save delete mode 100755 bspwm/capsindicator.sh delete mode 100755 bspwm/checkupdates.sh delete mode 100755 bspwm/games.sh delete mode 100755 bspwm/grayscale.sh delete mode 100755 bspwm/lockscreen.sh delete mode 100755 bspwm/margin.sh delete mode 100755 bspwm/marked.sh delete mode 100755 bspwm/monocle_improved.sh delete mode 100755 bspwm/music.sh delete mode 100755 bspwm/polyhide.sh delete mode 100755 bspwm/prevent_suspend.sh delete mode 100755 bspwm/ptt.sh delete mode 100755 bspwm/set_window_size.sh delete mode 100755 bspwm/shrink.sh delete mode 100755 bspwm/toggle-monitor-grayscale.sh delete mode 100755 bspwm/toggle-picom.sh delete mode 100755 bspwm/touchpad.sh create mode 100755 fastfetch/scripts/fetch_update_count.sh create mode 100755 fastfetch/scripts/updates.sh rename bspwm/proxy.sh => hypr/scripts/toggle_proxy.sh (100%) delete mode 100644 picom/picom.conf delete mode 100644 picom/picom.conf.glsl delete mode 100644 picom/picom.conf.old diff --git a/bspwm/bspwm_resize.sh b/bspwm/bspwm_resize.sh deleted file mode 100755 index 7b42573..0000000 --- a/bspwm/bspwm_resize.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -[ "$#" -eq 3 ] || { echo "Needs exactly three arguments."; exit 1; } - -motion="$1" -direction="$2" -size="$3" - -if [ "$motion" = 'expand' ]; then - # These expand the window's given side - case "$direction" in - north) bspc node -z top 0 -"$size" ;; - east) bspc node -z right "$size" 0 ;; - south) bspc node -z bottom 0 "$size" ;; - west) bspc node -z left -"$size" 0 ;; - esac -else - # These contract the window's given side - case "$direction" in - north) bspc node -z top 0 "$size" ;; - east) bspc node -z right -"$size" 0 ;; - south) bspc node -z bottom 0 -"$size" ;; - west) bspc node -z left "$size" 0 ;; - esac -fi diff --git a/bspwm/bspwmrc b/bspwm/bspwmrc deleted file mode 100755 index fa061d7..0000000 --- a/bspwm/bspwmrc +++ /dev/null @@ -1,78 +0,0 @@ -#! /bin/sh - -killall picom -killall uim-xim -killall uim-toolbar-gtk-systray -killall eww -exec ~/.screenlayout/dual.sh & -pgrep -x sxhkd > /dev/null || sxhkd -m -1 & -setxkbmap -layout "us,ru" -option "grp:caps_toggle" & - -bspc monitor eDP-1 -d Browsing I II III IV Coding Zettlr Messengers Admin -bspc monitor HDMI-1 -d V VI VII -bspc config border_width 3 -bspc config window_gap 28 -if [[ -e /tmp/grayscale ]] then - picom --window-shader-fg=/home/greg/.config/picom/picom.conf.glsl & - nitrogen --set-auto "/home/greg/Pictures/Wallpapers/desert_grayscale.jpg" - bspc config focused_border_color \#747474 - bspc config presel_feedback_color \#747474 - bspc config marked_border_color \#747474 -else - picom & - nitrogen --restore & - bspc config focused_border_color \#027C9B - bspc config presel_feedback_color \#027C9B - bspc config marked_border_color \#027C9B - bspc config automatic_scheme alternate -fi - -uim-xim & -uim-toolbar-gtk-systray & -xmousepasteblock & -xsel -fin /dev/null || sxhkd & -$HOME/.config/polybar/launch.sh --hack -setxkbmap -layout "us,ru" -option "grp:alt_shift_toggle,grp:caps_toggle" & -bspc monitor -d Browsing II III IV V VI Coding Zettlr Messengers Admin Gaming - -bspc config border_width 2 -bspc config window_gap 12 - -bspc config split_ratio 0.52 -bspc config borderless_monocle true -bspc config gapless_monocle true - -# Discord is an ass -bspc config ignore_ewmh_focus true - -bspc rule -a Gimp desktop='^8' state=floating follow=on -bspc rule -a Firefox desktop='^2' -bspc rule -a mplayer2 state=floating -bspc rule -a Kupfer.py focus=on -bspc rule -a Screenkey manage=off - -bspc rule -a TelegramDesktop desktop='^9' follow=off -bspc rule -a Element desktop='^9' follow=off -bspc rule -a WebCord desktop='^9' follow=off - -bspc rule -a steam desktop='^11' state=floating -~/.config/bspwm/games.sh -bspc config pointer_modifier mod4 - -if [ ! -e /tmp/startup_completed ]; then - bspc rule ... - telegram-desktop & - element-desktop & - webcord & - nextcloud & - sleep 0.25 - bspc rule ... - touch /tmp/startup_completed -fi diff --git a/bspwm/capsindicator.sh b/bspwm/capsindicator.sh deleted file mode 100755 index 61e42c4..0000000 --- a/bspwm/capsindicator.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Get the current layout -layout=$(setxkbmap -query | grep layout | awk '{print $2}') - -# Check if the layout is Russian -if [ "$layout" = "ru" ]; then - # Turn on the Caps Lock indicator (you may need to adjust this command based on your system) - xset led named "Caps Lock" -else - # Turn off the Caps Lock indicator - xset -led named "Caps Lock" -fi diff --git a/bspwm/checkupdates.sh b/bspwm/checkupdates.sh deleted file mode 100755 index 8093fdb..0000000 --- a/bspwm/checkupdates.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -upd() { - checkupdates | wc -l > /tmp/checkupdates -} - -if [[ ! -f /tmp/checkupdates ]]; then - upd -fi - -count=$(cat /tmp/checkupdates) -status="$count updates" -if [[ $count -eq 0 ]]; then - status="Up to date" -elif [[ $count == "1" ]]; then - status="$count update" -fi -echo "$status" - -upd & disown diff --git a/bspwm/games.sh b/bspwm/games.sh deleted file mode 100755 index 1f5a88c..0000000 --- a/bspwm/games.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -steamlib=/games/SteamLibrary # path to your steamlibrary -mygames=$(ls $steamlib/steamapps/appmanifest_*.acf | sed 's/[^0-9]*//g') # this sed command removes everything but the digits - -for game in $mygames; do - bspc rule -a steam_app_$game desktop=^11 state=fullscreen floating=on -done diff --git a/bspwm/grayscale.sh b/bspwm/grayscale.sh deleted file mode 100755 index 20b30b9..0000000 --- a/bspwm/grayscale.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -if [[ -e "/tmp/grayscale" ]]; then - rm /tmp/grayscale - # nitrogen --save --set-auto "/home/greg/Pictures/Wallpapers/blue_rainy_leaves.jpg" -else - touch /tmp/grayscale - # nitrogen --save --set-auto "/home/greg/Pictures/Wallpapers/berlin-tower-grayscale1.jpg" -fi -bspc wm -r diff --git a/bspwm/lockscreen.sh b/bspwm/lockscreen.sh deleted file mode 100755 index c1672ab..0000000 --- a/bspwm/lockscreen.sh +++ /dev/null @@ -1 +0,0 @@ -betterlockscreen --lock diff --git a/bspwm/margin.sh b/bspwm/margin.sh deleted file mode 100755 index 7326f57..0000000 --- a/bspwm/margin.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -if [ $( bspc config window_gap ) == 28 ]; then - bspc config window_gap 4 - exit -fi - -if [ $( bspc config window_gap ) == 4 ]; then - bspc config window_gap 28 - exit -fi diff --git a/bspwm/marked.sh b/bspwm/marked.sh deleted file mode 100755 index 75ec45c..0000000 --- a/bspwm/marked.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -while read -r line; do - case "$line" in - *'marked on') - # Get all marked windows and set their border width - for win in $(bspc query -N -n .marked); do - bspc config -n "$win" border_width 10 - done - ;; - *'marked off') - # Set border width for all windows to 2 - for win in $(bspc query -N -n .marked); do - bspc config -n "$win" border_width 2 - done - ;; - esac -done < <(bspc subscribe report node_flag) - diff --git a/bspwm/monocle_improved.sh b/bspwm/monocle_improved.sh deleted file mode 100755 index e3dedbc..0000000 --- a/bspwm/monocle_improved.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -for node_i in $(bspc query -N -n '.!focused.window' -d focused); do - bspc node $node_i -g hidden; -done - -bspc desktop -l next diff --git a/bspwm/music.sh b/bspwm/music.sh deleted file mode 100755 index 136017e..0000000 --- a/bspwm/music.sh +++ /dev/null @@ -1,14 +0,0 @@ -bspc wm -h off -kitty --single-instance btop & -sleep 0.1 -kitty --single-instance cava & -sleep 0.1 - -bspwm_resize contract north 250 -sleep 0.5 -bspwm_resize expand west 100 - -bspc node older -f -bspc wm -h on - -ncmpcpp diff --git a/bspwm/polyhide.sh b/bspwm/polyhide.sh deleted file mode 100755 index e20e427..0000000 --- a/bspwm/polyhide.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -if [ $( bspc config top_padding ) == 36 ]; then - polybar-msg cmd hide - sleep .0 - bspc config top_padding 0 - bspc config bottom_padding 0 - bspc config left_padding 0 - bspc config right_padding 0 -else - bspc config top_padding 36 - bspc config bottom_padding 9 - bspc config left_padding 11 - bspc config right_padding 11 - sleep .0 - polybar-msg cmd show -fi diff --git a/bspwm/prevent_suspend.sh b/bspwm/prevent_suspend.sh deleted file mode 100755 index 0f15597..0000000 --- a/bspwm/prevent_suspend.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Check if xset q has "timeout" equal to 0 and if so, return 1 -if xset q | grep "timeout: 0" >/dev/null; then - xset s 580 10 - echo "Suspend lock disabled" -else - xset s off - echo "Suspend lock enabled" -fi - diff --git a/bspwm/ptt.sh b/bspwm/ptt.sh deleted file mode 100755 index 4088493..0000000 --- a/bspwm/ptt.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# Replace 'F12' with your configured push-to-talk key -PUSH_TO_TALK_KEY="F7" - -# Get the window ID of the Discord application -DISCORD_WINDOW=$(xdotool search --onlyvisible --class "discord") - -# Loop to keep the script running -while true; do - # Check if the Discord window is active - if xdotool getactivewindow getwindowname | grep -q "Discord"; then - # Check if the push-to-talk key is pressed - if xinput --query-state "AT Translated Set 2 keyboard" | grep -q "key$$68$$=down"; then - # Simulate key press - xdotool keydown $PUSH_TO_TALK_KEY - sleep 0.1 # Hold the key down for a short duration - xdotool keyup $PUSH_TO_TALK_KEY - fi - fi - sleep 0.1 # Check every 100ms -done diff --git a/bspwm/set_window_size.sh b/bspwm/set_window_size.sh deleted file mode 100755 index 4ac6455..0000000 --- a/bspwm/set_window_size.sh +++ /dev/null @@ -1,34 +0,0 @@ -# Get current window size -current_size=$(bspc query -T -n focused | jq -r '.rectangle.width, .rectangle.height') - -#current_width=$(echo $current_size | head -n 1) -#current_height=$(echo $current_size | tail -n 1) -current_width=$(echo "$current_size" | sed -n '1p') -current_height=$(echo "$current_size" | sed -n '2p') - -# Define target size -target_width=$1 -target_height=$2 - -echo "Current size: $current_width x $current_height" - -# Calculate dx and dy -dx=$((target_width - current_width)) -dy=$((target_height - current_height)) - -# Resize the window horizontally -if [ $dx -gt 0 ]; then - handle="right" -else - handle="left" -fi -bspc node --resize $handle ${dx#-} 0 # Use absolute value for dx - -# Resize the window vertically -if [ $dy -gt 0 ]; then - handle="bottom" -else - handle="top" -fi -bspc node --resize $handle 0 ${dy#-} # Use absolute value for dy - diff --git a/bspwm/shrink.sh b/bspwm/shrink.sh deleted file mode 100755 index 72f5e1c..0000000 --- a/bspwm/shrink.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -if [ $( bspc config left_padding ) == 11 ]; then - bspc config left_padding 100 - bspc config right_padding 100 - exit -fi - -if [ $( bspc config left_padding ) == 100 ]; then - bspc config left_padding 200 - bspc config right_padding 200 - exit -fi - -if [ $( bspc config left_padding ) == 200 ]; then - bspc config left_padding 300 - bspc config right_padding 300 - exit -fi - -if [ $( bspc config left_padding ) == 300 ]; then - bspc config left_padding 11 - bspc config right_padding 11 - exit -fi - diff --git a/bspwm/toggle-monitor-grayscale.sh b/bspwm/toggle-monitor-grayscale.sh deleted file mode 100755 index 979f017..0000000 --- a/bspwm/toggle-monitor-grayscale.sh +++ /dev/null @@ -1,224 +0,0 @@ -#!/bin/bash - -# should also work with compositor=compton, untested -compositor=picom - -function usage { - - bin=$(basename $0) - - echo - echo "Toggle monitors between color and grayscale mode." - echo - echo "$bin [$compositor|nvidia|ddc|auto]" - echo "$bin $compositor [$compositor args]" - echo "$bin nvidia [nv mon]" - echo "$bin ddc [ddc mon]" - echo - echo "$compositor: use a GLX shader to set grayscale" - echo "nvidia: use NVIDIA proprietary driver Digital Vibrance setting to set grayscale" - echo "ddc: use DDC/CI monitor protocol to set the monitor saturation to 0 (grayscale) if supported by monitor" - echo "auto: use $compositor if running, otherwise nvidia if available, otherwise ddc if available" - echo - echo "$compositor args: in $compositor mode, optional $compositor parameters" - echo - echo "nv mon: in nvidia mode, an optional monitor name as enumerated by xrandr." - echo " if unspecified, apply to all monitors managed by the NVIDIA driver" - echo "ddc mon: in ddc mode, optional ddcutil options to identify the monitor. See 'man ddcutil'" - echo " if unspecified, apply to the first monitor detected by ddcutil" - echo "if invoked with no argument, auto is used." - echo - - exit 0 -} - -function toggle_nvidia { - - dpy=$1 - - value=$(nvidia-settings -t -q DigitalVibrance) - - # set a value in ]-1024..0[ range to desaturate colors instead of full grayscale - # -1024 => full grayscale - desaturate_value=-1024 - - if (( value == $desaturate_value )); then - value=0 - toggle_mode="color" - else - value=$desaturate_value - toggle_mode="grayscale" - fi - - if [ -n "$dpy" ]; then - param="[DPY:$dpy]/DigitalVibrance" - else - param="DigitalVibrance" - fi - - nvidia-settings -a ${param}=${value} > /dev/null -} - -function toggle_compositor { - - - if $compositor --help | grep legacy-backends > /dev/null; then - use_experimental_backends=1; - grep_string="window-shader-fg" - else - use_experimental_backends=0; - grep_string="glx-fshader-win" - fi - - if pgrep -a -x $compositor | grep $grep_string > /dev/null; then - pkill -x $compositor - sleep 1 - $compositor $* -b - toggle_mode="color" - else - pkill -x $compositor - sleep 1 - - if (( $use_experimental_backends == 1 )); then - - tmpfile=$(mktemp) - trap 'rm -f "${tmpfile}"' EXIT - - cat > ${tmpfile} < /dev/null - - else - - shader='uniform sampler2D tex; uniform float opacity; void main() { vec4 c = texture2D(tex, gl_TexCoord[0].xy); float y = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722)); gl_FragColor = opacity*vec4(y, y, y, c.a); }' - $compositor $* -b --backend glx --glx-fshader-win "${shader}" 2> /dev/null - - fi - - - toggle_mode="grayscale" - fi -} - -function toggle_ddc { - - out=($(ddcutil $* getvcp 8a -t)) - - if (( $? != 0 )); then - echo "ddc: this monitor does not support saturation control" - exit 1 - fi - - # out array: - # - # VCP 8A C 100 200 - # | | - # cur max - - if (( ${#out[@]} != 5 )); then - echo "ddc: unexpected output getting current saturation state" - exit 1 - fi - - cur_saturation=${out[3]} - max_saturation=${out[4]} - - # set a value in ]0..max/2[ range to desaturate colors instead of full grayscale - # 0 => full grayscale - desaturate_value=0 - - if (( cur_saturation == desaturate_value )); then - new_saturation=$(( max_saturation / 2 )) # nominal saturation - toggle_mode="color" - else - new_saturation=$desaturate_value - toggle_mode="grayscale" - fi - - ddcutil $* setvcp 8a $new_saturation -} - -mode=$1 - -case $mode in - - --help|-h) - usage - ;; - - $compositor) - if ! pgrep -x $compositor > /dev/null; then - echo "$compositor is not running" - exit 1 - fi - ;; - - nvidia) - if ! which nvidia-settings &> /dev/null; then - echo "nvidia-settings is not installed" - exit 1 - fi - ;; - ddc) - if ! which ddcutil &> /dev/null; then - echo "ddcutil is not installed" - exit 1 - fi - ;; - - *) - [ -z "$mode" ] && mode=auto - - if [ "$mode" = "auto" ]; then - - if pgrep -x $compositor > /dev/null; then - mode=$compositor - elif which nvidia-settings &> /dev/null; then - mode=nvidia - elif which ddcutil &> /dev/null; then - mode=ddc - else - echo "neither $compositor is running, nor nvidia-settings installed, nor ddcutil installed" - exit 1 - fi - else - usage - fi - -esac - -# pass eventual remaining arguments to toggle_* function -if (( $# > 0 )); then - shift -fi - -if [ "$mode" = "nvidia" ]; then - toggle_nvidia $* -elif [ "$mode" = "$compositor" ]; then - toggle_compositor $* -else - toggle_ddc $* -fi - -if (( $? == 0 )); then - echo "$mode: set to $toggle_mode" -else - echo "$mode: toggle failed" -fi - - diff --git a/bspwm/toggle-picom.sh b/bspwm/toggle-picom.sh deleted file mode 100755 index e4ee0c8..0000000 --- a/bspwm/toggle-picom.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -pid=$(pgrep -x picom) -if [ -z "$pid" ]; then - picom -b -else - kill $pid -fi diff --git a/bspwm/touchpad.sh b/bspwm/touchpad.sh deleted file mode 100755 index 33051b2..0000000 --- a/bspwm/touchpad.sh +++ /dev/null @@ -1,7 +0,0 @@ -i#!/bin/bash - -if [ "$(xinput list-props 13 | grep "Device Enabled" | awk '{print $NF}')" -eq 0 ]; then - xinput enable 13 -else - xinput disable 13 -fi diff --git a/fastfetch/brawl.jsonc b/fastfetch/brawl.jsonc index 23c7811..b00551c 100644 --- a/fastfetch/brawl.jsonc +++ b/fastfetch/brawl.jsonc @@ -32,7 +32,7 @@ }, { "type": "command", - "text": "~/.config/bspwm/checkupdates.sh", + "text": "~/.config/fastfetch/scripts/updates.sh", "keyIcon": "󰮯", "key": "󰮯" }, diff --git a/fastfetch/scripts/fetch_update_count.sh b/fastfetch/scripts/fetch_update_count.sh new file mode 100755 index 0000000..2a53c08 --- /dev/null +++ b/fastfetch/scripts/fetch_update_count.sh @@ -0,0 +1,2 @@ +#!/bin/bash +exec checkupdates | wc -l > /tmp/checkupdates & disown diff --git a/fastfetch/scripts/updates.sh b/fastfetch/scripts/updates.sh new file mode 100755 index 0000000..e345769 --- /dev/null +++ b/fastfetch/scripts/updates.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Always read from cache and return immediately +count=$(cat /tmp/checkupdates 2>/dev/null) +# nohup checkupdates > /tmp/checkupdates & disown +# $(checkupdates | wc -l > /tmp/checkupdates) & disown + +if [[ $? -ne 0 ]] || [[ -z "$count" ]]; then + status="Unknown" +else + if [[ $count == "Unknown" ]]; then + status="Unknown" + elif [[ $count -eq 0 ]]; then + status="Up to date" + elif [[ $count -eq 1 ]]; then + status="$count update" + else + status="$count updates" + fi +fi + +echo "$status" + +exec "$HOME/.config/fastfetch/scripts/fetch_update_count.sh" & disown diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index e51031c..198f75d 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -38,17 +38,17 @@ exec-once = gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" exec-once = swww-daemon exec-once = ~/.config/hypr/scripts/autofreeze_swww.sh exec-once = waybar & hypridle & hyprsunset & +exec-once = eww daemon exec-once = mullvad-vpn exec-once = swaync exec-once = ~/.config/hypr/scripts/random_wallpaper.sh exec-once = ~/.config/hypr/scripts/autofreezer.sh -exec-once = ~/.config/bspwm/checkupdates.sh +exec-once = ~/.config/fastfetch/scripts/fetch_update_count.sh exec-once = copyq --start-server exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & exec-once = thunar --daemon exec-once = touch /tmp/toggle_ssocks -exec-once = ~/.config/bspwm/proxy.sh & -exec-once = ~/.config/bspwm/checkupdates.sh +exec-once = ~/.config/hypr/scripts/toggle_proxy.sh exec-once = nextcloud --background & exec-once = [workspace 8 silent] Telegram # exec-once = [workspace 7 silent] superproductivity diff --git a/bspwm/proxy.sh b/hypr/scripts/toggle_proxy.sh similarity index 100% rename from bspwm/proxy.sh rename to hypr/scripts/toggle_proxy.sh diff --git a/picom/picom.conf b/picom/picom.conf deleted file mode 100644 index 94eb685..0000000 --- a/picom/picom.conf +++ /dev/null @@ -1,409 +0,0 @@ -################################# -# Shadows # -################################# - -# Enabled client-side shadows on windows. Note desktop windows -# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, -# unless explicitly requested using the wintypes option. -# -# Can be set per-window using rules. -# -# Default: false -shadow = false; - -# The blur radius for shadows, in pixels. -# -# Default: 12 -shadow-radius = 7; - -# The opacity of shadows. -# -# Range: 0.0 - 1.0 -# Default: 0.75 -# shadow-opacity = .75 - -# The left offset for shadows, in pixels. -# -# Default: -15 -shadow-offset-x = -7; - -# The top offset for shadows, in pixels. -# -# Default: -15 -shadow-offset-y = -7; - -# Hex string color value of shadow. Formatted like "#RRGGBB", e.g. "#C0FFEE". -# -# Default: #000000 -# shadow-color = "#000000" - -# Crop shadow of a window fully on a particular monitor to that monitor. This is -# currently implemented using the X RandR extension. -# -# Default: false -# crop-shadow-to-monitor = false - - -################################# -# Fading # -################################# - -# Fade windows in/out when opening/closing and when opacity changes, -# unless no-fading-openclose is used. Can be set per-window using rules. -# -# Default: false -fading = true; - -# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) -fade-in-step = 0.07; - -# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) -fade-out-step = 0.07; - -# The time between steps in fade step, in milliseconds. (> 0, defaults to 10) -# fade-delta = 10 - -# Do not fade on window open/close. -# no-fading-openclose = false - -# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc. -# no-fading-destroyed-argb = false - - -################################# -# Transparency / Opacity # -################################# - -# Opacity of window titlebars and borders. -# -# Range: 0.1 - 1.0 -# Default: 1.0 (disabled) -#frame-opacity = 0.5; - -# Use fixed inactive dim value, instead of adjusting according to window opacity. -# -# Default: false -# inactive-dim-fixed = true - -################################# -# Corners # -################################# - -# Sets the radius of rounded window corners. When > 0, the compositor will -# round the corners of windows. Does not interact well with -# `transparent-clipping`. -# -# Default: 0 (disabled) -corner-radius = 15 - -################################# -# Blur # -################################# - -blur: -{ - method = "dual_kawase"; - strength = 3; -}; - -################################# -# General Settings # -################################# - -# Enable remote control via D-Bus. See the man page for more details. -# -# Default: false -# dbus = true - -# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers. -# daemon = false - -# Specify the backend to use: `xrender`, `glx`, or `egl`. -# -# Default: "xrender" -backend = "glx" - -#deprecated -#glx-no-stencil = true; -#deprecated -#glx-no-rebind-pixmap = true; -glx-copy-from-front = true; -unredir-if-possible = false; # true for game performance, breaks overlays - - -# Use higher precision during rendering, and apply dither when presenting the -# rendered screen. Reduces banding artifacts, but may cause performance -# degradation. Only works with OpenGL. -dithered-present = false; - -# Enable/disable VSync. -# -# Default: false -vsync = true; - -# Try to detect windows with rounded corners and don't consider them -# shaped windows. The accuracy is not very high, unfortunately. -# -# Has nothing to do with `corner-radius`. -# -# Default: false -detect-rounded-corners = false; - -# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers -# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows. -# -# Default: false -detect-client-opacity = true; - -# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, -# rather than listening to 'FocusIn'/'FocusOut' event. May be more accurate, -# provided that the WM supports it. -# -# Default: false -# use-ewmh-active-win = false - -# Unredirect all windows if a full-screen opaque window is detected, -# to maximize performance for full-screen windows. Known to cause flickering -# when redirecting/unredirecting windows. -# -# Default: false -# unredir-if-possible = false - -# Delay before unredirecting the window, in milliseconds. -# -# Default: 0. -# unredir-if-possible-delay = 0 - -# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows -# in the same group focused at the same time. -# -# Default: false -detect-transient = true; - -# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same -# group focused at the same time. This usually means windows from the same application -# will be considered focused or unfocused at the same time. -# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too. -# -# Default: false -# detect-client-leader = false - -# Use of damage information for rendering. This cause the only the part of the -# screen that has actually changed to be redrawn, instead of the whole screen -# every time. Should improve performance. -# -# Default: false -use-damage = true; - -# Use X Sync fence to wait for the completion of rendering of other windows, -# before using their content to render the current screen. -# -# Required for explicit sync drivers, such as nvidia. -# -# Default: false -# xrender-sync-fence = false - -# GLX backend: Use specified GLSL fragment shader for rendering window -# contents. Read the man page for a detailed explanation of the interface. -# -# Can be set per-window using rules. -# -# window-shader-fg = "default" - -# Force all windows to be painted with blending. Useful if you -# have a `window-shader-fg` that could turn opaque pixels transparent. -# -# Default: false -# force-win-blend = false - -# Do not use EWMH to detect fullscreen windows. -# Reverts to checking if a window is fullscreen based only on its size and coordinates. -# -# Default: false -# no-ewmh-fullscreen = false - -# Dimming bright windows so their brightness doesn't exceed this set value. -# Brightness of a window is estimated by averaging all pixels in the window, -# so this could comes with a performance hit. -# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. -# -# Default: 1.0 (disabled) -# max-brightness = 1.0 - -# Make transparent windows clip other windows like non-transparent windows do, -# instead of blending on top of them. e.g. placing a transparent window on top -# of another window will cut a "hole" in that window, and show the desktop background -# underneath. -# -# Default: false -# transparent-clipping = false - -# Set the log level. Possible values are: -# "trace", "debug", "info", "warn", "error" -# in increasing level of importance. Case insensitive. -# If using the "TRACE" log level, it's better to log into a file -# using *--log-file*, since it can generate a huge stream of logs. -# -# Default: "warn" -# log-level = "warn"; - -# Set the log file. -# If *--log-file* is never specified, logs will be written to stderr. -# Otherwise, logs will to written to the given file, though some of the early -# logs might still be written to the stderr. -# When setting this option from the config file, it is recommended to use an absolute path. -# -# log-file = "/path/to/your/log/file" - -# Write process ID to a file. -# write-pid-path = "/path/to/your/log/file" - -# Rule-based per-window options. -# -# See WINDOW RULES section in the man page for how these work. -rules: ({ - match = "!focused"; -}, -{ - match = "window_type = 'tooltip'"; - fade = false; - shadow = true; - opacity = 0.75; - full-shadow = false; -}, { - match = "window_type = 'docko' || " - "window_type = 'desktop' || " - "_GTK_FRAME_EXTENTS@"; - blur-background = false; -}, { - match = "window_type != 'dock'"; - # shader = "my_shader.frag"; -}, { - match = "window_type = 'dock' || " - "window_type = 'desktop' || " - "name = 'rofi - ' || " - "name = 'rofi - ' || " - "fullscreen"; - corner-radius = 0; -}, { - match = "name = 'Notification' || " - "class_g = 'Conky' || " - "class_g ?= 'Notify-osd' || " - "class_g = 'Cairo-clock' || " - "_GTK_FRAME_EXTENTS@"; - shadow = false; -}, { - match = "window_type = 'dock'"; - blur-background = true; - shadow = false; -}, { - match = "window_type = 'dock'"; - blur-background = true; -}, { - match = "name = 'Eww - activate-linux'"; - blur-background = false; -}, { - match = "focused"; - shadow = true; -}, { - match = "window_type = 'ATOM'"; - frame = false; - blur = false; -}, { - match = "!focusedd"; -}, { - match = "class_i = 'thunar'"; - -}, { - match = "name = 'rofi - アプリ'"; - animations = ( - #{ - # triggers = [ "open" ], - # offset-x = { - # curve = "cubic-bezier(0.17, 1.15, 0.68, 1.1)"; - # end = 0; - # duration = "duration"; - # start = "- offsetx"; - # }; - # offset-y = { - # curve = "cubic-bezier(0.17, 1.15, 0.68, 1.1)"; - # end = 0; - # duration = "duration"; - # start = "- offsety"; - # }; - # shadow-offset-x = "offset-x"; - # shadow-offset-y = "offset-y * 1.1"; - # # Same as `transition-offset` - # offsetx = "window-x - 456"; - # offsety = "window-y - 0"; - # # Duration of animation in seconds - # duration = 0.35; - #}, - { - triggers = [ "open" ], - preset = "slide-in"; - direction = "left"; - duration = 0.35; - }, - { - triggers = [ "close" ], - preset = "slide-out"; - direction = "right"; - duration = 0.35; - } - ) -} -) - -# `@include` directive can be used to include additional configuration files. -# Relative paths are search either in the parent of this configuration file -# (when the configuration is loaded through a symlink, the symlink will be -# resolved first). Or in `$XDG_CONFIG_HOME/picom/include`. -# -# @include "extra.conf" - -# -# animations -# -animations = ( - { - triggers = [ "open" ]; - preset = "appear"; - duration = 0.225; - }, - { - triggers = [ "close" ]; - preset = "disappear"; - duration = 0.225; - }, - { - triggers = [ "show" ]; - preset = "appear"; - }, - { - triggers = [ "hide" ]; - preset = "disappear"; - }, - { - triggers = [ "geometry" ]; - offset-x = { - curve = "cubic-bezier(0.17, 1.15, 0.68, 1.1)"; - end = 0; - duration = "duration"; - start = "- offsetx"; - }; - offset-y = { - curve = "cubic-bezier(0.17, 1.15, 0.68, 1.1)"; - end = 0; - duration = "duration"; - start = "- offsety"; - }; - shadow-offset-x = "offset-x"; - shadow-offset-y = "offset-y * 1.1"; - # Same as `transition-offset` - offsetx = "window-x - window-x-before"; - offsety = "window-y - window-y-before"; - # Duration of animation in seconds - duration = 0.35; - } -) diff --git a/picom/picom.conf.glsl b/picom/picom.conf.glsl deleted file mode 100644 index ce74ca4..0000000 --- a/picom/picom.conf.glsl +++ /dev/null @@ -1,18 +0,0 @@ -#version 330 - -in vec2 texcoord; -uniform sampler2D tex; -uniform float opacity; - -vec4 default_post_processing(vec4 c); - -vec4 window_shader() { - vec2 texsize = textureSize(tex, 0); - vec4 color = texture2D(tex, texcoord / texsize, 0); - - color = vec4(vec3(0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b) * opacity, color.a * opacity); - // color = vec4(0.0, color.g * opacity, 0.0, color.a * opacity); - // color = vec4(color.r * opacity, 0.0, 0.0, color.a * opacity); - - return default_post_processing(color); -} diff --git a/picom/picom.conf.old b/picom/picom.conf.old deleted file mode 100644 index eaa7fb3..0000000 --- a/picom/picom.conf.old +++ /dev/null @@ -1,350 +0,0 @@ -################################# -# -# Backend -# -################################# - -# Backend to use: "xrender" or "glx". -# GLX backend is typically much faster but depends on a sane driver. - -# backend = "xrender"; -# backend = "xr_glx_hybrid"; -backend = "glx"; -vsync = true; - -################################# -# -# GLX backend -# -################################# - -glx-no-stencil = true; - -# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all. -# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified, -# but a 20% increase when only 1/4 is. -# My tests on nouveau show terrible slowdown. -# Useful with --glx-swap-method, as well. -glx-copy-from-front = false; - -# GLX backend: Use MESA_copy_sub_buffer to do partial screen update. -# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated. -# May break VSync and is not available on some drivers. -# Overrides --glx-copy-from-front. -# glx-use-copysubbuffermesa = true; - -# GLX backend: Avoid rebinding pixmap on window damage. -# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe). -# Recommended if it works. - -glx-no-rebind-pixmap = true; - - -use-damage = false; - -# Disabled to avoid artifacts painting under blur transparent windows. - -################################# -# -# Shadows -# -################################# - -# Enabled client-side shadows on windows. -shadow = true; - - -# The blur radius for shadows. (default 12) - shadow-radius = 15; -# The left offset for shadows. (default -15) -shadow-offset-x = -15; -# The top offset for shadows. (default -15) -shadow-offset-y = -15; -# The translucency for shadows. (default .75) - shadow-opacity = 1; - -# Set if you want different colour shadows -shadow-red = 0.1; -shadow-green = 0.1; -shadow-blue = 0.1; - - - -# shadow-exclude-reg = "x10+0+0"; -crop-shadow-to-monitor = false; - -# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches -# (most applications are fine, only apps that do weird things with xshapes or argb are affected). -# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes -# shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher. - -# shadow-exclude = "n:e:Notification"; - -shadow-exclude = [ - "_GTK_FRAME_EXTENTS@:c", - # Removed to avoid no-shadow in modal dialog windows. - # "! name~=''", - "name = 'Notification'", - "name = 'Plank'", - "name = 'Docky'", - "name = 'Kupfer'", - "name = 'Pensela'", - "name = 'Drawing Board'", - # - # Workaround for VirtualBox empty window at launching - "name = 'VirtualBox'", - "name = 'VirtualBoxVM'", - # - # Avoid shadow in Negatron popups - "name = 'Negatron v0.100.1' && argb", - # - # Avoid shadow for the XFCE alt tab TaskSwitcher - "name ?= 'xfwm4' && argb", - # - # "name *= 'compton'", - "class_g = 'Conky'", - "class_g = 'Kupfer'", - "class_g = 'Synapse'", - "class_g ?= 'Notify-osd'", - "class_g ?= 'Cairo-dock'", - "class_g = 'Cairo-clock'", - "class_g ?= 'Xfce4-notifyd'", - # - # Exclude special Firefox/Firefox-esr/Thunderbird dropdowns. - # Ref: https://github.com/chjj/compton/issues/247 - "class_g = 'Thunderbird' && argb", - "class_g = 'Telegram' && argb", - "name ?= 'Thunderbird' && (window_type = 'utility' || window_type = 'popup_menu')", - # - # Exclude some special popup menu shadows, but Modal Windows. - # These are more finetuning thant previous ones: - "class_g ?= 'Thunderbird' && class_i = 'Popup' && argb", - "class_g = 'firefox' && (window_type = 'utility' || window_type = 'popup_menu') && argb", - "class_g = 'Firefox' && (window_type = 'utility' || window_type = 'popup_menu') && argb", - "class_g = 'firefox-esr' && (window_type = 'utility' || window_type = 'popup_menu') && argb", - "class_g = 'Firefox-esr' && (window_type = 'utility' || window_type = 'popup_menu') && argb", - "class_g = 'Tor Browser' && (window_type = 'utility') && argb", - "class_g = 'Navegador Tor' && (window_type = 'utility' || window_type = 'popup_menu') && argb", - "class_g = 'Thunderbird' && (window_type = 'utility' || window_type = 'popup_menu') && argb", - "class_g = 'Mozilla Thunderbird' && (window_type = 'utility' || window_type = 'popup_menu') && argb", - "class_g ?= 'Xfce4-power-manager'", - # - # Exclude Vokoscreen and VokoscreenNG area selector - # - "class_g ?= 'vokoscreen' && argb", - "name = 'Área'", - "name *= 'Cuenta regresiva'", - "_NET_WM_WINDOW_TYPE:a *= '_KDE_NET_WM_WINDOW_TYPE_OVERRIDE'" -# "override_redirect = true" -]; -# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners) -# Deprecated, use --shadow-exclude 'bounding_shaped' or --shadow-exclude 'bounding_shaped && !rounded_corners' instead. -shadow-ignore-shaped = false; - - - - -################################# -# -# Opacity -# -################################# - - -inactive-opacity = 1; -active-opacity = 1; -frame-opacity = 1; -inactive-opacity-override = true; - - -# Desaturate and darken the inactive windows -# Dim inactive windows. (0.0 - 1.0) - -inactive-dim = 0.5; -inactive-dim-fixed = true; - - - - -# Do not let dimness adjust based on window opacity. -inactive-dim-fixed = false; - - -# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred. - -#blur-background = true; - - -# Blur background of opaque windows with transparent frames as well. -#blur-background-frame = true; -# Do not let blur radius adjust based on window opacity. -#blur-background-fixed = true; - -#blur-kern = "3x3box"; -blur-kern = "5x5box"; -#blur-kern = "5x5gaussian"; -#blur-kern = "9x9gaussian"; - - - - blur-background-exclude = [ - "class_g = 'Peek'", - "class_g = 'Pensela'", - "name = 'Drawing Board'", - "window_type = 'dock'", - "window_type = 'dropdown_menu'", - "window_type = 'combo'", - "window_type = 'popup_menu'", - "window_type = 'utility'", - "window_type = 'desktop'", - "_GTK_FRAME_EXTENTS@:c" - ]; -opacity-exclude = [ - "name = 'Stratagus'" -]; - - -################################# -# -# Fading -# -################################# - -#fading = true; -# fade-delta = 30; -#fade-in-step = 0.03; -#fade-out-step = 0.03; -fade-in-step = 0.07; -fade-out-step = 0.07; -# no-fading-openclose = true; -# no-fading-destroyed-argb = true; -fade-exclude = [ ]; - - - -################################# -# -# OTHER CONFIG -# -################################# - -log-level = "warn"; -# log-file = "/path/to/your/log/file"; - - -mark-wmwin-focused = true; -mark-ovredir-focused = true; -# use-ewmh-active-win = true; -detect-rounded-corners = true; -detect-client-opacity = true; -# refresh-rate = 0; - -corner-radius = 8; -rounded-corners-exclude = [ "window_type = 'dock'" ]; - -vsync = true; - - -# sw-opti = true; -# unredir-if-possible = true; -# unredir-if-possible-delay = 5000; -# unredir-if-possible-exclude = [ ]; - -focus-exclude = [ "class_g = 'Cairo-clock'" ]; - -detect-transient = true; -detect-client-leader = true; -invert-color-include = [ ]; - -resize-damage = 2; - - - - - -################################# -# -# Window type settings -# -################################# -wintypes: -{ - dock = { shadow = true; } - dnd = { shadow = false; } - popup_menu = { opacity = 1; } - dropdown_menu = { opacity = 1; } - - # This avoid problems with transparent windows while use-damage = true;. - #normal = { full-shadow = true;}; - -# tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; - - - -}; - -################################# -# -# Mine -# -################################# - -unredir-if-possible = true; -use-damage = true; -# no-ewmh-fullscreen = true; - xinerama-shadow-crop = true; -rules: ( - { match = "fullscreen"; shadow = false; } -) - -################################ -# -# Animations -# -################################ - -#animations = ({ -# triggers = [ "close", "hide" ]; -# preset = "slide-out"; -# direction = "down"; -#}) - -################################# -# -# Deprecated -# -################################# - - -# Avoid drawing shadows on dock/panel windows. -# This option is deprecated, you should use the wintypes option in your config file instead. -# no-dock-shadow = false; - - -# Don't draw shadows on DND windows. -# This option is deprecated, you should use the wintypes option in your config file instead. -# no-dnd-shadow = false; - -# Option `menu-opacity` is deprecated, and will be removed.Please use the wintype option `opacity` of `popup_menu` and `dropdown_menu` instead. -# menu-opacity = 1; - -# GLX backend: GLX buffer swap method we assume. -# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1). -# undefined is the slowest and the safest, and the default value. -# copy is fastest, but may fail on some drivers, -# 2-6 are gradually slower but safer (6 is still faster than 0). -# Usually, double buffer means 2, triple buffer means 3. -# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers. -# Useless with --glx-use-copysubbuffermesa. -# Partially breaks --resize-damage. -# Defaults to undefined. -# glx-swap-method has been deprecated since v6, your setting "undefined" should be replaced by `use-damage = true` -# glx-swap-method = "undefined"; - - -# Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows. -# "clear-shadow" is removed as an option, and is always enabled now. Consider removing it from your config file -# clear-shadow = true; - -# "alpha-step" has been removed, compton now tries to make use of all alpha values -# alpha-step = 0.06; diff --git a/swaync/config.json b/swaync/config.json index dc0d73a..a7c7051 100644 --- a/swaync/config.json +++ b/swaync/config.json @@ -134,7 +134,7 @@ { "label": "", "type": "toggle", - "command": "sh -c 'nohup ~/.config/bspwm/proxy.sh > /dev/null 2>&1 & disown'", + "command": "sh -c 'nohup ~/.config/hypr/scripts/toggle_proxy.sh > /dev/null 2>&1 & disown'", "update-command": "sh -c 'pgrep sslocal > /dev/null && echo true || echo false'" }, {