Skip to content

Commit

Permalink
adding scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ArkieSoft committed Aug 22, 2024
1 parent 7293c23 commit b3061b8
Show file tree
Hide file tree
Showing 8 changed files with 245 additions and 0 deletions.
11 changes: 11 additions & 0 deletions autostart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

nwg-panel & disown nwg-panel
thunar --daemon & disown thunar
xrandr --output DP-2 --primary
#LIBVIRT_DEFAULT_URI=qemu:///system virsh net-start default
sleep 15
nextcloud & disown nextcloud
#telegram-desktop -startintray & disown telegram-desktop
#signal-desktop --start-in-tray & disown signal-desktop
#LIBVIRT_DEFAULT_URI=qemu:///system virsh start WindowsVM
10 changes: 10 additions & 0 deletions brb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/run/current-system/sw/bin/bash

play -q /etc/nixos/sounds/brb.mp3&
figlet "WE'LL" | lolcat
sleep .75s
figlet " BE" | lolcat
sleep .75s
figlet " RIGHT" | lolcat
sleep .5s
figlet " BACK" | lolcat
5 changes: 5 additions & 0 deletions dance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/run/current-system/sw/bin/bash

play -q --replay-gain track /etc/nixos/sounds/driftveil.mp3&
clear
chafa --bg 181818 -C on --scale 2 /etc/nixos/assets/toothless.gif
8 changes: 8 additions & 0 deletions hydro.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/run/current-system/sw/bin/bash

while true; do
A=$((900 + RANDOM % 900))
play /etc/nixos/sounds/alert.mp3 &
dunstify -u critical -t 5000 "Hey, Hydrate you retard!"
sleep $A
done
149 changes: 149 additions & 0 deletions nixhandle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
#!/usr/bin/env bash

platform="$(uname)"

switch() {
git add .
case $os in
m)
darwin-rebuild switch --flake .
figlet "Switched"
nixgit
;;
n)
nixos-rebuild --use-remote-sudo switch
figlet "Switched"
nixgit
;;
l)
echo "Work in Progress"
exit 1
;;
*)
echo "uhhh...."
exit 1
;;
esac
}

update() {
git add .
case $os in
m)
nix flake udpate .
figlet "Updooted"
nixgit
;;
n)
sudo nix flake update
nixos-rebuild --use-remote-sudo boot
figlet "Updooted"
nixgit

;;
l)
echo "Work in Progress"
exit 1
;;
*)
echo "uhhhh....."
exit 1
;;
esac
}

nixgit() {
echo "Do you want to make a commit? [y/N]: "
read git

if [[ $git = y ]] || [[ $git = Y ]];then
echo "What to label for commit?: "
read commit
git commit -m "$commit"
else
case $1 in
g | git)
figlet "This was an exercise in futility" | lolcat
exit 1
;;
u | update)
figlet "Updoot Complete" | lolcat
exit 1
;;
s | switch)
figlet "Switch Complete" | lolcat
exit 1
;;
*)
echo "uhhhhhh"
exit 1
;;
esac
fi

echo "Do you want to push the commit? [y/N]: "
read push

if [[ $push == y ]] || [[ $push == Y ]];then
git push
figlet "Commit Pushed"
exit 1
else
case $1 in
g | git)
figlet "Commit Made"
exit 1
;;
u | update)
figlet "Updated"
exit 1
;;
s | switch)
figlet "Switched"
exit 1
;;
*)
echo "uhhhh"
exit 1
;;
esac
fi
exit 1
}

case $platform in
Darwin)
cd $HOME/.config/nixos
os="m"
;;
Linux)
source /etc/os-release
if [[ $ID == nixos ]]; then
cd /etc/nixos
os="n"
else
cd $HOME/.config/nixos
os="l"
fi
;;
*)
echo "Wtf are you doing?"
exit 1
;;
esac

case $1 in
g | git)
nixgit
;;
u | update)
update
;;
s | switch)
switch
;;
*)
echo "No arguments, provided! g for Git, u for Update, s for Switch"
exit 1
esac

45 changes: 45 additions & 0 deletions swwwchange.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/run/current-system/sw/bin/bash

if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then
echo "Usage:
$0 /etc/nixos/wallpapers"
exit 1
fi

sleep 3

if [[ $(pidof swww-daemon) ]];then
echo "swww-daemon found, restarting process"
pkill swww-daemon
sleep 3
swww-daemon &
else
echo "swww-daemon not found, launching swww-daemon"
swww-daemon &
fi

# Edit below to control the images transition
export SWWW_TRANSITION_FPS=120
export SWWW_TRANSITION_STEP=150
export SWWW_TRANSITION_DURATION=10

# This controls (in seconds) when to switch to the next image
INTERVAL=300

while true; do
find "$1" -type f \
| while read -r img; do
echo "$((RANDOM % 1000)):$img"
done \
| sort -n | cut -d':' -f2- \
| while read -r img; do
if [[ $(pidof swww-daemon) ]];then
swww img "$img" --transition-type any
sleep $INTERVAL
else
swww-daemon &
swww img "$img" --transition-type any
sleep $INTERVAL
fi
done
done
5 changes: 5 additions & 0 deletions tbc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/run/current-system/sw/bin/bash

play -q /etc/nixos/sounds/tbc.mp3&
sleep 9.5
chafa --bg 181818 -d 5 --scale max /etc/nixos/assets/tbc.gif
12 changes: 12 additions & 0 deletions toggle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/run/current-system/sw/bin/bash

if [[ $(pgrep hydro.sh) ]];then
echo "hydro.sh found, closing"
pkill hydro.sh
dunstify -t 2000 "Hydro is off"
else
echo "Starting hydro.sh"
dunstify -t 2000 "Hydro is on"
/etc/nixos/scripts/hydro.sh &
exit
fi

0 comments on commit b3061b8

Please sign in to comment.