install scripts. reorganization. soon to be deployable
This commit is contained in:
31
env/.local/bin/system/backup/backup.sh
vendored
Executable file
31
env/.local/bin/system/backup/backup.sh
vendored
Executable file
@@ -0,0 +1,31 @@
|
||||
cd ~/
|
||||
|
||||
fsynca () {
|
||||
# t?
|
||||
rsync -RUurvn --size-only --delete-after $exclude $syncfile "$target"
|
||||
}
|
||||
|
||||
fsyncb () {
|
||||
printf "===confirm changes?\n"
|
||||
read -p "y/n: " uinput
|
||||
if [ "$uinput" != "n" ] && [ "$uinput" != "N" ]; then
|
||||
printf "\n\n\n"
|
||||
rsync -RUurv --progress --size-only --delete-after $exclude $syncfile "$target"
|
||||
printf "\n===end sync\n---------\n\n"
|
||||
fi
|
||||
}
|
||||
|
||||
syncfile="stuff .bash_profile .bashrc .surf/styles .gtkrc-2.0 .urlview .vimrc .xinitrc .Xresources .zshrc .p10k.zsh .gnupg .ssh .local/bin/lf-gadgets .config/dwm .config/wezterm .config/.profile .config/tmux .config/wireplumber .config/FreeTube .config/awesome .config/wlxoverlay .config/newsboat .var/app/dev.vencord.Vesktop/config/vesktop/themes .config/fastfetch .config/gtk-3.0 .config/rofi .config/lf .config/mutt .config/zsh .config/picom.conf .config/nvim .config/atuin .config/screenkey.json .config/vesktop/themes .keepass .config/Pinta .config/cmus .config/cava .config/hypr .config/waybar .local/share/applications/custom .local/share/osu"
|
||||
|
||||
# se shit
|
||||
syncfile="$syncfile /home/iceyrazor/.local/share/Steam/steamapps/compatdata/244850/pfx/drive_c/users/steamuser/AppData/Roaming/SpaceEngineers/Blueprints /home/iceyrazor/.local/share/Steam/steamapps/compatdata/244850/pfx/drive_c/users/steamuser/AppData/Roaming/SpaceEngineers/IngameScripts /home/iceyrazor/.local/share/Steam/steamapps/compatdata/244850/pfx/drive_c/users/steamuser/AppData/Roaming/SpaceEngineers/Saves"
|
||||
|
||||
target="/home/iceyrazor/mnt-backups/LINUX FILES/home/iceyrazor"
|
||||
exclude="--exclude node_modules --exclude node_modules_23 --exclude dontsync --exclude **/iceys-linux-stuffs --exclude **/target --exclude LinVAM/pyenv"
|
||||
|
||||
fsynca
|
||||
|
||||
printf "==CC-survival unsynced?\n\n"
|
||||
printf "==osu unsynced\n\n"
|
||||
|
||||
fsyncb
|
||||
21
env/.local/bin/system/backup/copy-to-git.sh
vendored
Executable file
21
env/.local/bin/system/backup/copy-to-git.sh
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
cd ~/
|
||||
|
||||
fsync () {
|
||||
rsync -RUurvn --delete-after $exclude $syncfile "$target"
|
||||
printf "===commit these changes?\n"
|
||||
read -p "y/n: " uinput
|
||||
if [ "$uinput" != "n" ] && [ "$uinput" != "N" ]; then
|
||||
printf "\n\n\n"
|
||||
rsync -RUurv --progress --delete-after $exclude $syncfile "$target"
|
||||
printf "\n===end sync\n---------\n\n"
|
||||
fi
|
||||
}
|
||||
|
||||
syncfile=".urlview .vimrc .Xresources .bashrc .zshrc .p10k.zsh .config/.profile .config/wezterm .config/dwm .config/tmux .config/awesome .config/rofi .config/lf .config/cava .config/hypr .config/waybar .config/picom.conf .config/nvim .config/atuin .config/screenkey.json .config/fastfetch stuff/manual-programs/suckless"
|
||||
|
||||
syncfile="$syncfile stuff/scripts/system/stbar stuff/scripts/system/url-handler.sh stuff/scripts/system/backup/copy-to-git.sh stuff/scripts/system/backup/backup.sh"
|
||||
syncfile="$syncfile stuff/scripts/system/neoboot.sh stuff/scripts/system/math.sh stuff/scripts/system/bri.sh stuff/scripts/system/restart-pipe.sh stuff/scripts/system/set-pri-java.sh"
|
||||
target=~/stuff/iceys-linux-stuffs
|
||||
exclude="--exclude check_weth.sh --exclude awesome/default --exclude lua-ls-cc-tweaked --exclude .config/nvim/plugin"
|
||||
|
||||
fsync
|
||||
1
env/.local/bin/system/bri.sh
vendored
Executable file
1
env/.local/bin/system/bri.sh
vendored
Executable file
@@ -0,0 +1 @@
|
||||
echo "$1" > /sys/class/backlight/intel_backlight/brightness
|
||||
13
env/.local/bin/system/math.sh
vendored
Executable file
13
env/.local/bin/system/math.sh
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
expression=$1
|
||||
precision=$2
|
||||
|
||||
if [ "$precision" == "" ]; then
|
||||
precision=1;
|
||||
fi;
|
||||
|
||||
# Perform arithmetic operation using awk
|
||||
result=$(awk "BEGIN {printf \"%.${precision}f\n\", $expression}" | sed 's/\.0$//')
|
||||
|
||||
# Print the result
|
||||
echo "$result"
|
||||
38
env/.local/bin/system/neoboot.sh
vendored
Executable file
38
env/.local/bin/system/neoboot.sh
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
normal_old() {
|
||||
randnum=$(($RANDOM % 2))
|
||||
|
||||
if [ "$randnum" == "1" ]; then
|
||||
fastfetch --localip-show-ipv4 0 | lolcat -S 100 # | lolcat -as 10000 -S 100
|
||||
# fortune | cowsay -f fox | lolcat
|
||||
else
|
||||
# fortune | cowsay -f dragon | lolcat
|
||||
uwufetch | lolcat
|
||||
fi
|
||||
printf "\n--------------------------------------------------------\n" | lolcat
|
||||
lsblk --filter 'NAME=~"sd[abcde]"' -o NAME,MOUNTPOINTS | lolcat
|
||||
}
|
||||
|
||||
normal() {
|
||||
fastfetch -c $HOME/.config/fastfetch/compact.jsonc
|
||||
printf "\n"
|
||||
}
|
||||
|
||||
laptop() {
|
||||
if [ "$(($RANDOM % 2))" == "1" ]; then
|
||||
fastfetch --localip-show-ipv4 0 | lolcat -as 10000 -S 100
|
||||
else
|
||||
# uwufetch | lolcat -as 10000 -S 100
|
||||
fastfetch --localip-show-ipv4 0 | lolcat -as 10000 -S 100
|
||||
fi
|
||||
printf "\n--------------------------------------------------------\n" | lolcat -S 100
|
||||
lsblk --filter 'NAME=~"sd[abcde]"' -o NAME,MOUNTPOINTS | lolcat -as 10000 -S 100
|
||||
}
|
||||
|
||||
if [ -z $(pgrep VRChat) ]; then
|
||||
if [[ "$(cat /etc/hostname)" == "Witchen" ]]; then
|
||||
normal
|
||||
else
|
||||
normal
|
||||
fi
|
||||
fi
|
||||
1
env/.local/bin/system/restart-pipe.sh
vendored
Executable file
1
env/.local/bin/system/restart-pipe.sh
vendored
Executable file
@@ -0,0 +1 @@
|
||||
systemctl --user restart wireplumber pipewire pipewire-pulse
|
||||
1
env/.local/bin/system/set-pri-java.sh
vendored
Executable file
1
env/.local/bin/system/set-pri-java.sh
vendored
Executable file
@@ -0,0 +1 @@
|
||||
sudo renice -20 -p $(sudo pidof java)
|
||||
63
env/.local/bin/system/start-scripts/autostart.sh
vendored
Executable file
63
env/.local/bin/system/start-scripts/autostart.sh
vendored
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
extra=0
|
||||
if [ "$(cat /etc/hostname)" == "Kasino" ]; then
|
||||
extra=0
|
||||
fi
|
||||
if [ "$(cat /etc/hostname)" == "Witchen" ]; then
|
||||
extra=1
|
||||
fi
|
||||
|
||||
sleep 0.1
|
||||
xset s 0
|
||||
nitrogen --restore &
|
||||
if [ $extra == 1 ]; then
|
||||
xrandr --dpi 90 &
|
||||
xrandr --output Virtual-1 --mode 1920x1080
|
||||
fi
|
||||
|
||||
if [ -z "$WAYLAND_DISPLAY "]; then
|
||||
xcompmgr &
|
||||
fi
|
||||
|
||||
if [ $extra == 1 ]; then
|
||||
if [ -z $(pgrep -f stbar.sh) ]; then
|
||||
# ~/stuff/scripts/system/stbar/stbar.sh &
|
||||
echo hall
|
||||
fi
|
||||
fi
|
||||
|
||||
pipewire & disown
|
||||
if [ -z $(pgrep wireplumber) ]; then
|
||||
wireplumber & disown
|
||||
fi
|
||||
pipewire-pulse & disown
|
||||
sleep 0.5s
|
||||
|
||||
if [ -z $(pgrep -f newsboat-fetch.sh) ]; then
|
||||
~/.config/dwm/newsboat-fetch.sh &
|
||||
fi
|
||||
if [ -z $(pgrep -f lessons-loop.sh) ]; then
|
||||
~/.config/dwm/lessons-loop.sh &
|
||||
fi
|
||||
|
||||
if [ -z $(pgrep wezterm) ]; then
|
||||
sleep 2
|
||||
wezterm -e ~/stuff/scripts/system/task.sh &
|
||||
fi
|
||||
|
||||
if [ "$(cat /etc/hostname)" == "Kasino" ]; then
|
||||
if [ -z "$(pgrep vesktop)" ]; then
|
||||
sleep 2s
|
||||
flatpak run dev.vencord.Vesktop & disown
|
||||
fi
|
||||
|
||||
if [ -z "$(pgrep gajim)" ]; then
|
||||
sleep 2s
|
||||
gajim & disown
|
||||
fi
|
||||
|
||||
if [ -z "$(pgrep steam)" ]; then
|
||||
sleep 3s
|
||||
steam & disown
|
||||
fi
|
||||
fi
|
||||
7
env/.local/bin/system/start-scripts/lessons-loop.sh
vendored
Executable file
7
env/.local/bin/system/start-scripts/lessons-loop.sh
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
newsboat_loop(){
|
||||
notify-send -t 6000 -i '/home/iceyrazor/stuff/media/saved gifs/duolingo-crop-s.jpg' "Anki" "did you do your japanese lessons today?"
|
||||
sleep 2h
|
||||
newsboat_loop
|
||||
}
|
||||
newsboat_loop
|
||||
16
env/.local/bin/system/start-scripts/newsboat-fetch.sh
vendored
Executable file
16
env/.local/bin/system/start-scripts/newsboat-fetch.sh
vendored
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
newsboat_loop(){
|
||||
newsboat -x reload
|
||||
#newsboat -x print-unread | xargs -0 notify-send "newsboat feed"
|
||||
|
||||
unreads=$(newsboat -x print-unread)
|
||||
unreadnum=$(printf "$unreads" | sed 's/ .*//g')
|
||||
|
||||
if (( $unreadnum > 0 )); then
|
||||
notify-send "newsboat feed" "$unreads"
|
||||
fi
|
||||
notify-send "Vitamins!" "take them"
|
||||
sleep 2h
|
||||
newsboat_loop
|
||||
}
|
||||
newsboat_loop
|
||||
1
env/.local/bin/system/stbar/config.txt
vendored
Normal file
1
env/.local/bin/system/stbar/config.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
full_stat:false
|
||||
10
env/.local/bin/system/stbar/killbar.sh
vendored
Executable file
10
env/.local/bin/system/stbar/killbar.sh
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
pids=$(ps -AO pid | awk '/stbar.sh|newsboat-fetch.sh/ {print $1}')
|
||||
# pids=$(pstree -pla | grep stbar | sed 's,|,,g' | sed 's/ //g' | sed 's/^ //g' | sed 's/ .*//' | sed 's/[^0-9]*//g')
|
||||
# pids2=$(ps -AO pid | grep "sh ./newsboat-fetch.sh" | sed 's/S.*//g' | sed 's/^ *//g')
|
||||
|
||||
|
||||
echo $pids
|
||||
$(sleep 3 && xsetroot -name "") & disown
|
||||
|
||||
sudo kill -KILL $pids
|
||||
doas kill -KILL $pids
|
||||
87
env/.local/bin/system/stbar/stbar-awesome.sh
vendored
Executable file
87
env/.local/bin/system/stbar/stbar-awesome.sh
vendored
Executable file
@@ -0,0 +1,87 @@
|
||||
#!/bin/bash
|
||||
delim='|'
|
||||
|
||||
curr_dir="$(cd "$(dirname "$0")" && pwd)"
|
||||
#wifi_device=$(cat $curr_dir/config.txt | grep wifi_device | sed 's/wifi_device://')
|
||||
wifi_device="wlan0"
|
||||
# curr_dir/check_weth.sh "$cur_dir" &
|
||||
|
||||
|
||||
|
||||
status(){
|
||||
|
||||
echo " "
|
||||
|
||||
#wifi up or no
|
||||
sed "s/down/\:\(/;s/up/\:\)/" /sys/class/net/$wifi_device/operstate
|
||||
|
||||
echo "$delim"
|
||||
|
||||
if [ "$(ls /sys/class/power_supply/BAT0/)" ]; then
|
||||
bat_power=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
|
||||
echo $bat_is_flash
|
||||
if (( $bat_power < 15 )); then
|
||||
bat_power=$bat_power%!!!!!!!!!!!
|
||||
else
|
||||
bat_power=$bat_power%
|
||||
fi
|
||||
|
||||
echo $bat_power
|
||||
|
||||
echo "$delim"
|
||||
fi
|
||||
|
||||
#mic
|
||||
|
||||
[ "$(pactl get-source-mute @DEFAULT_SOURCE@)" == "Mute: no" ] && echo || echo
|
||||
|
||||
echo "$delim"
|
||||
|
||||
#rss
|
||||
|
||||
echo $(newsboat -x print-unread|sed "s/\s.*//; s/Error:/IA/")
|
||||
|
||||
echo "$delim"
|
||||
|
||||
if [ "$(cat $curr_dir/config.txt | grep full_stat)" == "full_stat:true" ]; then
|
||||
#cpu
|
||||
echo $(ps axch -o cmd:15,%cpu --sort=-%cpu | sed "1q")%
|
||||
|
||||
echo "$delim"
|
||||
|
||||
#mem
|
||||
echo $(free -mlw | grep Mem: | sed "s/Mem\:\W*[0-9]*\W*//; s/ .*//")
|
||||
echo $(ps axch -o cmd:15,%mem --sort=-%mem | sed "1q")%
|
||||
|
||||
else
|
||||
#cpu
|
||||
echo $(ps axch -o cmd:15,%cpu --sort=-%cpu | sed "1q" | sed 's/.* //')%
|
||||
|
||||
#mem
|
||||
echo $(free -mlw | grep Mem: | sed "s/Mem\:\W*[0-9]*\W*//; s/ .*//")
|
||||
|
||||
fi
|
||||
echo "$delim"
|
||||
|
||||
#space
|
||||
#echo \/$(df -h | grep /dev/nvme0n1p3 | sed "s/\/dev\/nvme0n1p3 *[0-9]*.[0-9]*. *[0-9]*.[0-9]*. *//" | sed "s/ .*//")
|
||||
|
||||
#echo \~$(df -h | grep /dev/nvme0n1p4 | sed "s/\/dev\/nvme0n1p4 *[0-9]*.[0-9]*. *[0-9]*.[0-9]*. *//" | sed "s/ .*//")
|
||||
echo $(df -h -x=used /dev/mapper/artix-root | sed '1d' | awk '{print $4}'| sed 's/[^0-9]*//g')
|
||||
|
||||
echo "$delim"
|
||||
|
||||
#weather
|
||||
|
||||
if [ "$(cat $curr_dir/weth_str.txt)" != "" ]; then
|
||||
printf "$(cat $curr_dir/weth_str.txt)"
|
||||
echo "$delim"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
#while :; do
|
||||
echo "$(status | tr '\n' ' '0)"
|
||||
# sleep 1s
|
||||
#end
|
||||
84
env/.local/bin/system/stbar/stbar.sh
vendored
Executable file
84
env/.local/bin/system/stbar/stbar.sh
vendored
Executable file
@@ -0,0 +1,84 @@
|
||||
#!/bin/bash
|
||||
delim='|'
|
||||
|
||||
curr_dir="$(cd "$(dirname "$0")" && pwd)"
|
||||
wifi_device=$(cat $curr_dir/config.txt | grep wifi_device | sed 's/wifi_device://')
|
||||
# curr_dir/check_weth.sh "$cur_dir" &
|
||||
|
||||
|
||||
|
||||
status(){
|
||||
|
||||
echo " "
|
||||
|
||||
#wifi up or no
|
||||
sed "s/down/\:\(/;s/up/\:\)/" /sys/class/net/$wifi_device/operstate
|
||||
|
||||
echo "$delim"
|
||||
|
||||
#bat
|
||||
bat_power=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
|
||||
echo $bat_is_flash
|
||||
if (( $bat_power < 15 )); then
|
||||
bat_power=$bat_power%!!!!!!!!!!!
|
||||
else
|
||||
bat_power=$bat_power%
|
||||
fi
|
||||
|
||||
echo $bat_power
|
||||
|
||||
echo "$delim"
|
||||
|
||||
#rss
|
||||
|
||||
echo RSS:$(newsboat -x print-unread|sed "s/\s.*//; s/Error:/IA/")
|
||||
|
||||
echo "$delim"
|
||||
|
||||
if [ "$(cat $curr_dir/config.txt | grep full_stat)" == "full_stat:true" ]; then
|
||||
#cpu
|
||||
echo CPU:$(ps axch -o cmd:15,%cpu --sort=-%cpu | sed "1q")%
|
||||
|
||||
echo "$delim"
|
||||
|
||||
#mem
|
||||
echo Mem:$(free -mlw | grep Mem: | sed "s/Mem\:\W*[0-9]*\W*//; s/ .*//")
|
||||
echo $(ps axch -o cmd:15,%mem --sort=-%mem | sed "1q")%
|
||||
|
||||
else
|
||||
#cpu
|
||||
echo CPU:$(ps axch -o cmd:15,%cpu --sort=-%cpu | sed "1q" | sed 's/.* //')%
|
||||
|
||||
#mem
|
||||
echo Mem:$(free -mlw | grep Mem: | sed "s/Mem\:\W*[0-9]*\W*//; s/ .*//")
|
||||
|
||||
fi
|
||||
echo "$delim"
|
||||
|
||||
#space
|
||||
echo \/$(df -h | grep /dev/nvme0n1p3 | sed "s/\/dev\/nvme0n1p3 *[0-9]*.[0-9]*. *[0-9]*.[0-9]*. *//" | sed "s/ .*//")
|
||||
|
||||
echo \~$(df -h | grep /dev/nvme0n1p4 | sed "s/\/dev\/nvme0n1p4 *[0-9]*.[0-9]*. *[0-9]*.[0-9]*. *//" | sed "s/ .*//")
|
||||
|
||||
echo "$delim"
|
||||
|
||||
#weather
|
||||
|
||||
if [ "$(cat $curr_dir/weth_str.txt)" != "" ]; then
|
||||
printf "$(cat $curr_dir/weth_str.txt)"
|
||||
echo "$delim"
|
||||
fi
|
||||
|
||||
|
||||
#date
|
||||
date '+%a %m/%d/%Y %I:%M%p'
|
||||
|
||||
}
|
||||
|
||||
|
||||
while :; do
|
||||
xsetroot -name "$(status | tr '\n' ' '0)"
|
||||
sleep 1s
|
||||
done
|
||||
|
||||
0
env/.local/bin/system/stbar/weth_str.txt
vendored
Executable file
0
env/.local/bin/system/stbar/weth_str.txt
vendored
Executable file
23
env/.local/bin/system/url-handler.sh
vendored
Executable file
23
env/.local/bin/system/url-handler.sh
vendored
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
url=$@
|
||||
prompt_message="Open with:"
|
||||
|
||||
echo $url
|
||||
|
||||
choices="
|
||||
clipboard
|
||||
browser/xdg-open
|
||||
"
|
||||
|
||||
choice=$(echo "$choices" | sed /^$/d | rofi -dmenu "$prompt_message")
|
||||
choice=$(echo "$choice" | sed -e 's/browser\/xdg-open/xdg-open/')
|
||||
|
||||
if [ "$choice" == "clipboard" ]; then
|
||||
if [ -z $WAYLAND_DISPLAY ]; then
|
||||
printf "$url" | xclip -selection clipboard
|
||||
else
|
||||
printf "$url" | wl-copy
|
||||
fi
|
||||
else
|
||||
$choice "$url" & disown
|
||||
fi
|
||||
Reference in New Issue
Block a user