add dynamic config commands
This commit is contained in:
BIN
res/autumn.gif
Normal file
BIN
res/autumn.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
42
res/iloveseason.py
Executable file
42
res/iloveseason.py
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Akbar Rahman <hi@alv.cx>
|
||||
#
|
||||
|
||||
import sys
|
||||
from datetime import datetime as dt
|
||||
|
||||
|
||||
def get_args():
|
||||
""" Get command line arguments """
|
||||
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser()
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main(args):
|
||||
""" Entry point for script """
|
||||
now = dt.now()
|
||||
|
||||
template = ""
|
||||
if now.month in [3, 4, 5]:
|
||||
template = './res/spring.gif'
|
||||
if now.month in [6, 7, 8]:
|
||||
template = './res/summer.gif'
|
||||
if now.month in [9, 10, 11]:
|
||||
template = './res/autumn.gif'
|
||||
if now.month in [12, 1, 2]:
|
||||
template = './res/winter.gif'
|
||||
|
||||
print(f'template = "{template}"')
|
||||
print()
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
sys.exit(main(get_args()))
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(0)
|
||||
BIN
res/spring.gif
Normal file
BIN
res/spring.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
res/summer.gif
Normal file
BIN
res/summer.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
BIN
res/winter.gif
Normal file
BIN
res/winter.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Reference in New Issue
Block a user