mirror of
https://github.com/AquaMorph/dotfiles.git
synced 2025-04-29 17:25:34 +00:00
Desktop start up with additional Firefox windows
This commit is contained in:
parent
d77e129b2c
commit
650d747791
@ -1 +1 @@
|
||||
configparser todoist-python tbapy
|
||||
configparser todoist-python tbapy holidays
|
||||
|
29
scripts/launch-stocks-tracker.py
Normal file
29
scripts/launch-stocks-tracker.py
Normal file
@ -0,0 +1,29 @@
|
||||
import datetime, holidays, os
|
||||
from dateutil.tz import tzlocal
|
||||
|
||||
tz = tzlocal()
|
||||
usHolidays = holidays.US()
|
||||
def openToday(now = None):
|
||||
if not now:
|
||||
now = datetime.datetime.now(tz)
|
||||
openTime = datetime.time(hour = 9, minute = 30, second = 0)
|
||||
closeTime = datetime.time(hour = 16, minute = 0, second = 0)
|
||||
# If it is a holiday
|
||||
if now.strftime('%Y-%m-%d') in usHolidays:
|
||||
return False
|
||||
# If it is a weekend
|
||||
if now.date().weekday() > 4:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def closed():
|
||||
now = datetime.datetime.now(tz)
|
||||
closeTime = datetime.time(hour = 16, minute = 0, second = 0)
|
||||
# If before 0930 or after 1600
|
||||
if (now.time() > closeTime):
|
||||
return True
|
||||
return False
|
||||
if (openToday() and not closed()):
|
||||
print("Open")
|
||||
os.system("i3-msg 'workspace 10; exec firefox --new-window robinhood.com'")
|
@ -26,8 +26,10 @@ function fixPulse() {
|
||||
function launchi3() {
|
||||
if [ -z "$skipi3" ]; then
|
||||
echo Opening i3wm sound workspaces
|
||||
sleep .1 && i3-msg 'workspace 10; exec google-play-music-desktop-player'
|
||||
sleep .1 && i3-msg 'workspace 5; exec firefox'
|
||||
sleep .1 && i3-msg 'workspace 10; exec firefox --new-window music.youtube.com'
|
||||
sleep .1 && python python ~/.config/scripts/launch-stocks-tracker.py
|
||||
sleep .1 && i3-msg 'workspace 10; exec firefox --new-window youtube.com/feed/subscriptions'
|
||||
fi
|
||||
}
|
||||
|
||||
@ -45,7 +47,7 @@ killPulse
|
||||
|
||||
# Start up jack
|
||||
cadence-session-start --system-start &
|
||||
wait %1
|
||||
wait %1 && sleep 1
|
||||
ladish_control sload studio
|
||||
|
||||
# Make start up reliable
|
||||
|
Loading…
x
Reference in New Issue
Block a user