summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/get_args.py15
-rw-r--r--src/instant_rice.py3
-rw-r--r--src/update_polybar.py24
3 files changed, 24 insertions, 18 deletions
diff --git a/src/get_args.py b/src/get_args.py
index 0001abb..c4e8ade 100644
--- a/src/get_args.py
+++ b/src/get_args.py
@@ -1,10 +1,17 @@
import user_interface
def get_args(args):
- if len(args) != 2:
- pass
- elif '-r' in args:
+
+ dmenu = False
+ nolock = False
+
+ if '-r' in args:
img_path = user_interface.pickRandomWallpaper()
else:
img_path = args[1]
- return img_path
+
+ if '-dmenu' in args:
+ dmenu = True
+ if '--nolock' in args:
+ nolock = True
+ return img_path, dmenu, nolock
diff --git a/src/instant_rice.py b/src/instant_rice.py
index 6d02be6..9dcc1ec 100644
--- a/src/instant_rice.py
+++ b/src/instant_rice.py
@@ -8,7 +8,7 @@ from get_args import get_args
from paths import Paths
def main():
- img_path = get_args(sys.argv)
+ img_path, update_dmenu, i3lock = get_args(sys.argv)
hex_colors, hex_compliments = user_interface.colorPickerUI(img_path)
if 'polybar' in Paths:
@@ -16,7 +16,6 @@ def main():
if 'rofi' in Paths:
update_rofi.updateRofiTheme(Paths['rofi'], hex_colors, hex_compliments)
if 'i3' in Paths:
- update_dmenu = True if ('-dmenu' in sys.argv) else False
generate_i3lock = False if ('--nolock' in sys.argv) else True
update_i3.updatei3Theme(Paths['i3'], img_path, hex_colors, hex_compliments, generate_i3lock, update_dmenu)
diff --git a/src/update_polybar.py b/src/update_polybar.py
index ff395c6..2ea16af 100644
--- a/src/update_polybar.py
+++ b/src/update_polybar.py
@@ -7,18 +7,18 @@ def updatePolybarTheme(config_path: str, colors: list, compliments: list):
data = file.readlines()
for i,line in enumerate(data):
#update colors
- if "background =" in line and i == 19:
- data[i] = 'background = ' + colors[0] + '\n'
- if "background-alt =" in line and i == 20:
- data[i] = 'background-alt = ' + colors[1] + '\n'
- if "foreground =" in line and i == 21:
- data[i] = 'foreground = ' + compliments[0] + '\n'
- if "primary =" in line and i == 22:
- data[i] = 'primary = ' + compliments[1] + '\n'
- if "secondary =" in line and i == 23:
- data[i] = 'secondary = ' + compliments[2] + '\n'
- if "disabled =" in line and i == 25:
- data[i] = 'disabled = ' + colors[2] + '\n'
+ if "rice-background =" in line:
+ data[i] = 'rice-background = ' + colors[0] + '\n'
+ if "rice-background-alt =" in line:
+ data[i] = 'rice-background-alt = ' + colors[1] + '\n'
+ if "rice-foreground =" in line:
+ data[i] = 'rice-foreground = ' + compliments[0] + '\n'
+ if "rice-primary =" in line:
+ data[i] = 'rice-primary = ' + compliments[1] + '\n'
+ if "rice-secondary =" in line:
+ data[i] = 'rice-secondary = ' + compliments[2] + '\n'
+ if "rice-disabled =" in line:
+ data[i] = 'rice-disabled = ' + colors[2] + '\n'
with open(config_path, 'w') as file:
file.writelines(data)