diff options
Diffstat (limited to 'env/.local/bin/system')
| -rwxr-xr-x | env/.local/bin/system/backup/backup.sh | 31 | ||||
| -rwxr-xr-x | env/.local/bin/system/backup/copy-to-git.sh | 21 | ||||
| -rwxr-xr-x | env/.local/bin/system/bri.sh | 1 | ||||
| -rwxr-xr-x | env/.local/bin/system/math.sh | 13 | ||||
| -rwxr-xr-x | env/.local/bin/system/neoboot.sh | 38 | ||||
| -rwxr-xr-x | env/.local/bin/system/restart-pipe.sh | 1 | ||||
| -rwxr-xr-x | env/.local/bin/system/set-pri-java.sh | 1 | ||||
| -rwxr-xr-x | env/.local/bin/system/start-scripts/autostart.sh | 63 | ||||
| -rwxr-xr-x | env/.local/bin/system/start-scripts/lessons-loop.sh | 7 | ||||
| -rwxr-xr-x | env/.local/bin/system/start-scripts/newsboat-fetch.sh | 16 | ||||
| -rw-r--r-- | env/.local/bin/system/stbar/config.txt | 1 | ||||
| -rwxr-xr-x | env/.local/bin/system/stbar/killbar.sh | 10 | ||||
| -rwxr-xr-x | env/.local/bin/system/stbar/stbar-awesome.sh | 87 | ||||
| -rwxr-xr-x | env/.local/bin/system/stbar/stbar.sh | 84 | ||||
| -rwxr-xr-x | env/.local/bin/system/stbar/weth_str.txt | 0 | ||||
| -rwxr-xr-x | env/.local/bin/system/url-handler.sh | 23 |
16 files changed, 397 insertions, 0 deletions
diff --git a/env/.local/bin/system/backup/backup.sh b/env/.local/bin/system/backup/backup.sh new file mode 100755 index 0000000..7cbd20b --- /dev/null +++ b/env/.local/bin/system/backup/backup.sh @@ -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 diff --git a/env/.local/bin/system/backup/copy-to-git.sh b/env/.local/bin/system/backup/copy-to-git.sh new file mode 100755 index 0000000..212abda --- /dev/null +++ b/env/.local/bin/system/backup/copy-to-git.sh @@ -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 diff --git a/env/.local/bin/system/bri.sh b/env/.local/bin/system/bri.sh new file mode 100755 index 0000000..b943f30 --- /dev/null +++ b/env/.local/bin/system/bri.sh @@ -0,0 +1 @@ +echo "$1" > /sys/class/backlight/intel_backlight/brightness diff --git a/env/.local/bin/system/math.sh b/env/.local/bin/system/math.sh new file mode 100755 index 0000000..26d4854 --- /dev/null +++ b/env/.local/bin/system/math.sh @@ -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" diff --git a/env/.local/bin/system/neoboot.sh b/env/.local/bin/system/neoboot.sh new file mode 100755 index 0000000..afe9345 --- /dev/null +++ b/env/.local/bin/system/neoboot.sh @@ -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 diff --git a/env/.local/bin/system/restart-pipe.sh b/env/.local/bin/system/restart-pipe.sh new file mode 100755 index 0000000..ec693dc --- /dev/null +++ b/env/.local/bin/system/restart-pipe.sh @@ -0,0 +1 @@ +systemctl --user restart wireplumber pipewire pipewire-pulse diff --git a/env/.local/bin/system/set-pri-java.sh b/env/.local/bin/system/set-pri-java.sh new file mode 100755 index 0000000..35a9769 --- /dev/null +++ b/env/.local/bin/system/set-pri-java.sh @@ -0,0 +1 @@ +sudo renice -20 -p $(sudo pidof java) diff --git a/env/.local/bin/system/start-scripts/autostart.sh b/env/.local/bin/system/start-scripts/autostart.sh new file mode 100755 index 0000000..3d1d1d6 --- /dev/null +++ b/env/.local/bin/system/start-scripts/autostart.sh @@ -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 diff --git a/env/.local/bin/system/start-scripts/lessons-loop.sh b/env/.local/bin/system/start-scripts/lessons-loop.sh new file mode 100755 index 0000000..b292c65 --- /dev/null +++ b/env/.local/bin/system/start-scripts/lessons-loop.sh @@ -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 diff --git a/env/.local/bin/system/start-scripts/newsboat-fetch.sh b/env/.local/bin/system/start-scripts/newsboat-fetch.sh new file mode 100755 index 0000000..5534489 --- /dev/null +++ b/env/.local/bin/system/start-scripts/newsboat-fetch.sh @@ -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 diff --git a/env/.local/bin/system/stbar/config.txt b/env/.local/bin/system/stbar/config.txt new file mode 100644 index 0000000..87af9d5 --- /dev/null +++ b/env/.local/bin/system/stbar/config.txt @@ -0,0 +1 @@ +full_stat:false diff --git a/env/.local/bin/system/stbar/killbar.sh b/env/.local/bin/system/stbar/killbar.sh new file mode 100755 index 0000000..7e76af2 --- /dev/null +++ b/env/.local/bin/system/stbar/killbar.sh @@ -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 diff --git a/env/.local/bin/system/stbar/stbar-awesome.sh b/env/.local/bin/system/stbar/stbar-awesome.sh new file mode 100755 index 0000000..ef9ecca --- /dev/null +++ b/env/.local/bin/system/stbar/stbar-awesome.sh @@ -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 diff --git a/env/.local/bin/system/stbar/stbar.sh b/env/.local/bin/system/stbar/stbar.sh new file mode 100755 index 0000000..6ca704d --- /dev/null +++ b/env/.local/bin/system/stbar/stbar.sh @@ -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 + diff --git a/env/.local/bin/system/stbar/weth_str.txt b/env/.local/bin/system/stbar/weth_str.txt new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/env/.local/bin/system/stbar/weth_str.txt diff --git a/env/.local/bin/system/url-handler.sh b/env/.local/bin/system/url-handler.sh new file mode 100755 index 0000000..54f4af4 --- /dev/null +++ b/env/.local/bin/system/url-handler.sh @@ -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 |
