Skip to content

Commit

Permalink
add new year shellscript!!! :3
Browse files Browse the repository at this point in the history
ITS 2024 !!!!! (gaming)
  • Loading branch information
liaminventions committed Jan 1, 2024
1 parent 7959f46 commit 51f5f5e
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 3 deletions.
68 changes: 68 additions & 0 deletions executable_newyear.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash
set -ex
# new year drop sync script

# ___CONSTANTS___::

# music/video file:

#FILE="/home/waverider/Videos/copy_0DAE90C5-6934-4D36-8731-3956A4F830DD.mp4"
FILE="/home/waverider/Videos/NEWYEARS.mp4"

RESUMETIME="8" # seconds it takes to resume (use a stopwatch)
PREDROPTIME="55" # seconds before drop

# start at 23:59:60
HOURS="23"
MINUTES="59"
SECONDS="60"

#HOURS="23"
#MINUTES="31"
#SECONDS="60"

#SECONDS=$((SECONDS + 1))

# ___THE MATH___ ::

# start at 23:59:60
# CALCOFFSET = (take 60 and subtract the result of resume time plus the length of the song's pre-drop.)
# if "CALCOFFSET" is negative, roll back another minute and add (60 - abs(CALCOFFSET)) seconds
# or rather, 60+CALCOFFSET since it's already negative.

# BEGIN!

# CALCOFFSET = (take 60 and subtract the result of resume time plus the length of the song's pre-drop.)

TOTALOFFSET=$((RESUMETIME + PREDROPTIME)) # total offset time from midnight (before)
#CALCOFFSET=$(expr SECONDS - TOTALOFFSET) # from the text above...
# extra math to do a non-integer argument (negative numbers)
CALCOFFSET=$(printf %.0f "$((SECONDS - TOTALOFFSET))")

# if "CALCOFFSET" is negative, roll back another minute and add (60+CALCOFFSET) seconds

if [ $((CALCOFFSET <= 0)) ]
then
((MINUTES=MINUTES-1)) # roll back another minute
((SECONDS=SECONDS+CALCOFFSET)) # and add (60+CALCOFFSET) seconds. SECONDS is 60 here.
else
((SECONDS=CALCOFFSET)) # also if it's not negative, set the SECONDS to CALCOFFSET
fi

# now set time to the total timestamp.
TIME="$HOURS:$MINUTES:$SECONDS"


# now DO IT!!!!!

sleep 1
#sudo rtcwake -m disk --date "tomorrow"

sudo rtcwake -m disk --date "$TIME"
xmp ~/home/butter.xm -i nearest &
swww init & disown
cavasik & disown
eww -c ~/.config/eww/bg open clock & disown
sleep 45
mpv --fs $FILE
fg
1 change: 1 addition & 0 deletions private_dot_config/eww/bg/eww.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ $match-bg: #212121;
padding-right: 15px;
padding-left: 10px;
}

//.power {
// border-radius: 50px;
// border: 5px solid $gray;
Expand Down
4 changes: 2 additions & 2 deletions private_dot_config/eww/bg/eww.yuck
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
(box :spacing 25 :class "weather" :space-evenly false
:valign "end" :halign "start"
(weather)
(_battery :status {EWW_BATTERY.BAT0.status}
(battery :status {EWW_BATTERY.BAT0.status}
:battery {EWW_BATTERY.BAT0.capacity}
:charge "󰂄" :one "󱟢" :two "󰂂" :three "󰂀" :four "󰁾"
:five "󰁼" :six "󰁺" :seven "󰂃"))
Expand Down Expand Up @@ -149,7 +149,7 @@

(defpoll weather :interval "30m" :timeout "5s" "../iceberg/menu/scripts/weather")

(defwidget _battery [battery status one two three
(defwidget battery [battery status one two three
four five six seven charge]
(box :class "bat-box" :space-evenly false :spacing 8
(label :text {status == 'Charging' ? charge :
Expand Down
3 changes: 2 additions & 1 deletion private_dot_config/hypr/hyprland.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ exec-once = nm-applet --indicator & disown & blueman-applet & /opt/BreakTimer/br

# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=eDP-1,preferred,auto,1
#monitor=HDMI-A-1,1920x1080@60.00,0x0,1,mirror,eDP-1
#monitor=HDMI-A-1,640x480@60.00,0x0,1
monitor=HDMI-A-1,[email protected],0x0,1,mirror,eDP-1
#monitor=HDMI-A-1,[email protected],0x0,1,mirror,eDP-1

#exec-once = bash -c "~/.config/hypr/scripts/display mirror"

Expand Down

0 comments on commit 51f5f5e

Please sign in to comment.