refactor: move scripts to be tracked by stow

This commit is contained in:
jabuxas 2024-11-16 13:13:00 -03:00
parent 35d9ea4ce4
commit ec6c3a92fd
35 changed files with 81 additions and 337 deletions

View File

@ -29,7 +29,7 @@ case "$CHOICE" in
~/scripts/swww.sh $EVERFOREST_WIDE_WPP $EVERFOREST_NORMAL_WPP ~/scripts/swww.sh $EVERFOREST_WIDE_WPP $EVERFOREST_NORMAL_WPP
gsettings set org.gnome.desktop.interface gtk-theme Everforest-Dark-BL gsettings set org.gnome.desktop.interface gtk-theme Everforest-Dark-BL
gsettings set org.gnome.desktop.interface icon-theme Everforest-Dark gsettings set org.gnome.desktop.interface icon-theme
ln -sf ~/.config/tmux/themes/tmux-everforest.conf ~/.config/tmux/theme.conf ln -sf ~/.config/tmux/themes/tmux-everforest.conf ~/.config/tmux/theme.conf
tmux source-file ~/.config/tmux/tmux.conf tmux source-file ~/.config/tmux/tmux.conf

View File

@ -0,0 +1,40 @@
#!/usr/bin/env fish
set CURRENT_THEME (cat ~/colorscheme)
echo $CURRENT_THEME
set wpp1_white ~/pics/wallpapers/wh1.png
set wpp2_white ~/pics/wallpapers/wh2.jpg
set wpp1_solarized ~/pics/wallpapers/b1.png
set wpp2_solarized ~/pics/wallpapers/b2.png
swaymsg reload
switch $CURRENT_THEME
case black
echo changing to white ...
gsettings set org.gnome.desktop.interface gtk-theme "Windows-95"
gsettings set org.gnome.desktop.interface icon-theme "nineicons-redux-v0.6"
swaymsg shadows enable
sed -i 's|black.toml|white.toml|' ~/.config/alacritty/alacritty.toml
pkill waybar; waybar -s ~/.config/waybar/style-white.css &> /dev/null & disown
~/scripts/swww.sh $wpp1_white $wpp2_white
ln -sf ~/.config/tmux/themes/tmux-white.conf ~/.config/tmux/theme.conf
tmux source ~/.config/tmux/tmux.conf
echo white > ~/colorscheme
case white
echo changing to black...
gsettings set org.gnome.desktop.interface gtk-theme "Material-Black-Blueberry-LA"
gsettings set org.gnome.desktop.interface icon-theme "We10X-black-dark"
swaymsg shadows disable
swaymsg client.focused "#ffffff #ffffff #c1c1c1"
swaymsg client.focused_inactive "#c1c1c1 #212121 #cecece"
sed -i 's|white.toml|black.toml|' ~/.config/alacritty/alacritty.toml
pkill waybar; waybar &> /dev/null & disown
~/scripts/swww.sh $wpp1_solarized $wpp2_solarized
ln -sf ~/.config/tmux/themes/tmux-monochrome.conf ~/.config/tmux/theme.conf
tmux source ~/.config/tmux/tmux.conf
echo black > ~/colorscheme
case '*'
echo mmmm what?
end

View File

@ -11,26 +11,26 @@ if [[ -z "$1" ]]; then
red) red)
FIRST=~/pics/wallpapers/bm5.jpg FIRST=~/pics/wallpapers/bm5.jpg
SECOND=~/pics/wallpapers/bm3.png SECOND=~/pics/wallpapers/bm3.png
;; ;;
melange) melange)
FIRST=~/pics/wallpapers/melange2.png FIRST=~/pics/wallpapers/melange2.png
SECOND=~/pics/wallpapers/melange1.jpg SECOND=~/pics/wallpapers/melange1.jpg
;; ;;
white) # todo white)
FIRST=~/pics/wallpapers/sl3.jpg FIRST=~/pics/wallpapers/wh1.png
SECOND=~/pics/wallpapers/sl2.png SECOND=~/pics/wallpapers/wh2.jpg
;; ;;
solarized) solarized)
FIRST=~/pics/wallpapers/solarized5.jpg FIRST=~/pics/wallpapers/sl6.jpg
SECOND=~/pics/wallpapers/solarized4.png SECOND=~/pics/wallpapers/sl7.jpg
;; ;;
monochrome) monochrome)
FIRST=~/pics/wallpapers/monochrome-1.png FIRST=~/pics/wallpapers/monochrome-1.png
SECOND=~/pics/wallpapers/monochrome-1.jpg SECOND=~/pics/wallpapers/monochrome-1.jpg
;; ;;
forest) forest)
FIRST=~/pics/wallpapers/ef1.jpg FIRST=~/pics/wallpapers/ef1.jpg
SECOND=~/pics/wallpapers/ef2.jpg SECOND=~/pics/wallpapers/ef2.jpg
esac esac
else else
FIRST=$1 FIRST=$1
@ -43,4 +43,4 @@ sleep 0.3
swww img -o HDMI-A-1 $FIRST swww img -o HDMI-A-1 $FIRST
swww img -o DP-2 $SECOND swww img -o DP-2 $SECOND
swww img -o DP-3 ~/pics/wallpapers/cottage.jpg swww img -o DP-3 ~/pics/wallpapers/sl4.jpg

View File

@ -0,0 +1,22 @@
#!/usr/bin/env fish
# Check if alacritty.toml exists; if not, raise an alert and exit
if not test -f ~/.config/alacritty/alacritty.toml
notify-send "alacritty.toml does not exist"
exit 0
end
# Fetch opacity from alacritty.toml
set opacity (awk '$1 == "opacity" && $2 == "=" {print $3; exit}' ~/.config/alacritty/alacritty.toml)
# Assign toggle opacity value
switch $opacity
case 1
set toggle_opacity 0.93
case '*'
set toggle_opacity 1
end
# Replace opacity value in alacritty.toml
sed -i -- "s/opacity = $opacity/opacity = $toggle_opacity/" ~/.config/alacritty/alacritty.toml

View File

@ -1,47 +0,0 @@
#!/bin/bash
sh ~/scripts/screenlayout.sh
nitrogen --restore &
nvidia-settings --load-config-only
setxkbmap br abnt2
xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Profile Enabled' 0, 1
xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Speed' 0.1
#pulseaudio --start
#picom &
/home/klein/.local/bin/picom-pijulius -b --experimental-backends --animations --animation-for-open-window zoom --vsync &
# /home/klein/.local/bin/picom-jonaburg &
numlockx on
mpd &
dunst &
lxqt-policykit-agent &
touch ~/tmp/touchy
rm -rf ~/tmp/*
#killall pasystray; pasystray & # killlall is needed in case you reset dwm, it will just spawn infinites pasystrays
/usr/bin/emacs --daemon &
#/home/lucas/.local/bin/idle &
#urxvtd --quiet --opendisplay --fork
#xrdb -merge ~/.Xresources
#otd &
#discord & # If using regular discord.
#flatpak run com.discordapp.Discord & # If using flatpak
#steam &
#nohup xwinwrap -g 1920x1080 -s -b -un -nf -ni -fdt -argb -st -ov -sp -- mpv -wid WID --framedrop=vo --no-audio --really-quiet --panscan="1.0" /home/lucas/wpp\&stuff/wallpapers/Fireworks-Reflections.mp4 -loop 0 &
#nohup xwinwrap -g 1400x900+1920+180 -s -b -un -nf -ni -fdt -argb -st -ov -sp -- mpv -wid WID --framedrop=vo --no-audio --really-quiet --panscan="1.0" /home/lucas/wpp\&stuff/kyoko_animated_wallpaper.mp4 -loop 0

View File

@ -1,3 +0,0 @@
#!/bin/bash
top -bn2 | grep '%Cpu' | tail -1 | grep -P '(....|...) id,'|awk '{print "" 100-$8 "%"}'

View File

@ -1,3 +0,0 @@
#!/bin/bash
exec xautolock -detectsleep -time 10 -locker "/usr/bin/betterlockscreen -l" -notify 30 -notifier "notify-send -u critical -t 10000 -- 'LOCKING screen in 30 seconds"

View File

@ -1,12 +0,0 @@
#!/bin/bash
# More efficient version of the above.
free -h | while read What TTL Used _; do
if [ "$What" = 'Mem:' ]; then
printf '%s/%s \n' "$Used" "$TTL"
break
fi
done

View File

@ -1,9 +0,0 @@
#!/bin/bash
setxkbmap br abnt2
xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Profile Enabled' 0, 1
xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Speed' 0.1
# xinput --set-prop 'pointer:''Microsoft Microsoft Basic Optical Mouse v2.0 ' 'libinput Accel Profile Enabled' 0, 1
# xinput --set-prop 'pointer:''Microsoft Microsoft Basic Optical Mouse v2.0 ' 'libinput Accel Speed' 0.1

View File

@ -1,9 +0,0 @@
#!/bin/sh
mpt=$(mpc current -f %title%)
mpa=$(mpc current -f %artist%)
icon1=' '
icon2=''
echo "$mpt"

View File

@ -1,12 +0,0 @@
#!/bin/bash
name="$HOME/pics/screenshots/screenshot-$(date -Iseconds | cut -d '+' -f1).png"
if [[ $XDG_SESSION_TYPE == "x11" ]]; then
maim -u -n -l -c 0.157,0.333,0.466,0.4 $name
xclip -selection clipboard -t image/png $name
fi
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
grim $name
$name
fi

View File

@ -1,13 +0,0 @@
#!/bin/bash
name="$HOME/pics/screenshots/screenshot-$(date -Iseconds | cut -d '+' -f1).png"
if [[ $XDG_SESSION_TYPE == "x11" ]]; then
maim -u -s $name
xclip -selection clipboard -t image/png $name
fi
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
grim -g "$(slurp)" $name
xclip -selection clipboard -t image/png $name
wl-copy < $name
fi

View File

@ -1,11 +0,0 @@
#!/bin/bash
tmp="$HOME/tmp/tmp.png"
if [[ $XDG_SESSION_TYPE == "x11" ]]; then
maim -u -s "$tmp"
curl -F'file=@'"${tmp}" https://0x0.st | xclip -sel clip
fi
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
grim -g "$(slurp)" $tmp
curl -F'file=@'"${tmp}" -H 'X-Auth: '$(cat ~/.key) https://paste.jabuxas.xyz | wl-copy
fi

View File

@ -1,30 +0,0 @@
#!/bin/bash
swpy_dir="${XDG_CONFIG_HOME:-$HOME/.config}/swappy"
save_dir="$HOME/pics/screenshots"
save_file="screenshot-$(date -Iseconds | cut -d '+' -f1).png"
temp_screenshot="/tmp/screenshot.png"
mkdir -p $save_dir
mkdir -p $swpy_dir
echo -e "[Default]\nsave_dir=$save_dir\nsave_filename_format=$save_file" > $swpy_dir/config
if [[ $XDG_SESSION_TYPE == "x11" ]]; then
maim -i $(xdotool getactivewindow) | xclip -sel clip -t image/png
fi
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
if [[ $XDG_CURRENT_DESKTOP == "Hyprland" ]]; then
window_info=$(hyprctl activewindow)
coordinates=$(echo "$window_info" | grep -oP 'at: \K([0-9]+,[0-9]+)')
size=$(echo "$window_info" | grep -oP 'size: \K([0-9]+,[0-9]+)')
IFS=',' read -r x y <<< "$coordinates"
IFS=',' read -r width height <<< "$size"
grim -g "${x},${y} ${width}x${height}" ~/tmp/jabuxas.png
wl-copy < ~/tmp/jabuxas.png
fi
if [[ $XDG_CURRENT_DESKTOP == "sway" ]]; then
rm $temp_screenshot
grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" $temp_screenshot
wl-copy < ~/tmp/jabuxas.png
swappy -f $temp_screenshot
fi
fi

View File

@ -1,5 +0,0 @@
## Dependencies
for a x11 session, you only need xclip, xdotool and maim
for wayland session it should work on hyprland and sway

View File

@ -1,29 +0,0 @@
#!/usr/bin/env fish
set CURRENT_THEME (cat ~/colorscheme)
echo $CURRENT_THEME
set wpp1_white ~/pics/wallpapers/sl3.jpg
set wpp2_white ~/pics/wallpapers/sl2.png
set wpp1_solarized ~/pics/wallpapers/sl6.jpg
set wpp2_solarized ~/pics/wallpapers/sl7.jpg
switch $CURRENT_THEME
case solarized
echo changing to white ...
sed -i 's|solarized-dark.toml|white.toml|' ~/.config/alacritty/alacritty.toml
pkill waybar; waybar -s ~/.config/waybar/style-white.css &> /dev/null & disown
~/scripts/swww.sh $wpp1_white $wpp2_white
echo white > ~/colorscheme
case white
echo changing to solarized ...
sed -i 's|white.toml|solarized-dark.toml|' ~/.config/alacritty/alacritty.toml
pkill waybar; waybar &> /dev/null & disown
~/scripts/swww.sh $wpp1_solarized $wpp2_solarized
echo solarized > ~/colorscheme
case '*'
echo mmmm what?
end
swaymsg reload

View File

@ -1,7 +0,0 @@
#!/bin/sh
upt="$(uptime --pretty | sed -e 's/up //g' -e 's/ days/d/g' -e 's/ day/d/g' -e 's/ hours/h/g' -e 's/ hour/h/g' -e 's/ minutes/m/g' -e 's/, / /g')"
echo -e "$upt "

View File

@ -1,5 +0,0 @@
#!/bin/sh
vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')"
echo "${vol}%"

View File

@ -1,45 +0,0 @@
#!/usr/bin/env sh
swpy_dir="${XDG_CONFIG_HOME:-$HOME/.config}/swappy"
save_dir="$HOME/pics/screenshots"
save_file="screenshot-$(date -Iseconds | cut -d '+' -f1).png"
temp_screenshot="/tmp/screenshot.png"
mkdir -p $save_dir
mkdir -p $swpy_dir
echo -e "[Default]\nsave_dir=$save_dir\nsave_filename_format=$save_file" > $swpy_dir/config
upload ()
{
curl -F'file=@'"${save_dir}/${save_file}" -H 'X-Auth: '$(cat ~/.key) https://paste.jabuxas.xyz | wl-copy
}
function print_error
{
cat << "EOF"
./way-print.sh <action>
...valid actions are...
p : print all screens
s : snip current screen
m : print focused monitor
t : tmp print
cw: current window
EOF
}
case $1 in
p) # print all outputs
grim $temp_screenshot && swappy -f $temp_screenshot ;;
s) # drag to manually snip an area / click on a window to print it
grim -g "$(slurp)" $temp_screenshot && swappy -f $temp_screenshot ;;
m) # print focused monitor
grim -o $(swaymsg -t get_workspaces | jq -r '.[] | select(.focused==true).output') $temp_screenshot && swappy -f $temp_screenshot ;;
t) #upload to paste temporarily
grim -g "$(slurp)" $temp_screenshot && swappy -f $temp_screenshot && upload ;;
cw) #current window
~/.local/bin/print-window.sh ;;
*) # invalid option
print_error ;;
esac
rm "$temp_screenshot"

View File

@ -1,21 +0,0 @@
#!/bin/bash
setxkbmap br abnt2
xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Profile Enabled' 0, 1
xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Speed' 0.1
#pulseaudio --start
#picom &
#numlockx on
mpd &
touch ~/tmp/touchy
rm -rf ~/tmp/*
/usr/bin/emacs --daemon &
otd &

View File

@ -1,57 +0,0 @@
#!/bin/bash
sh ~/scripts/screenlayout.sh
nitrogen --restore &
nvidia-settings --load-config-only
trayer-srg -l --edge top --align right --SetDockType true --SetPartialStrut true \
--expand true --width 9 --tint 0xFF181814 --height 27 --transparent false --distance 2 --margin 1 &
# /usr/bin/gentoo-pipewire-launcher &
if [ -x /usr/bin/nm-applet ] ; then
nm-applet --sm-disable &
fi
setxkbmap br abnt2
xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Profile Enabled' 0, 1
xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Speed' 0.1
#pulseaudio --start
#picom &
# /home/klein/.local/bin/picom-pijulius -b --experimental-backends --animations --animation-for-open-window zoom --vsync &
/home/klein/.local/bin/picom-pijulius --experimental-backends --animations --animation-for-open-window zoom --glx-no-stencil --xrender-sync-fence -b &
# /home/klein/.local/bin/picom-jonaburg &
numlockx on
mpd &
dunst &
lxqt-policykit-agent &
touch ~/tmp/touchy
rm -rf ~/tmp/*
#killall pasystray; pasystray & # killlall is needed in case you reset dwm, it will just spawn infinites pasystrays
/usr/bin/emacs --daemon &
#/home/lucas/.local/bin/idle &
#urxvtd --quiet --opendisplay --fork
#xrdb -merge ~/.Xresources
# otd &
#discord & # If using regular discord.
#flatpak run com.discordapp.Discord & # If using flatpak
#steam &
#nohup xwinwrap -g 1920x1080 -s -b -un -nf -ni -fdt -argb -st -ov -sp -- mpv -wid WID --framedrop=vo --no-audio --really-quiet --panscan="1.0" /home/lucas/wpp\&stuff/wallpapers/Fireworks-Reflections.mp4 -loop 0 &
#nohup xwinwrap -g 1400x900+1920+180 -s -b -un -nf -ni -fdt -argb -st -ov -sp -- mpv -wid WID --framedrop=vo --no-audio --really-quiet --panscan="1.0" /home/lucas/wpp\&stuff/kyoko_animated_wallpaper.mp4 -loop 0