ой
This commit is contained in:
parent
e7754a1638
commit
a898f5edd1
@ -90,5 +90,4 @@ exec wallpyper
|
||||
```
|
||||
|
||||
Author - Karimullin Arthur
|
||||
|
||||
Mail - KarimullinArthur@riseup.net
|
||||
|
9
func.py
9
func.py
@ -21,18 +21,13 @@ def kill():
|
||||
|
||||
def configParsing():
|
||||
pathToConfig = os.path.expanduser('~')+'/.config/wallpyper/config'
|
||||
try:
|
||||
with open(pathToConfig) as file:
|
||||
contentFile = file.read()
|
||||
config = json.loads(contentFile)
|
||||
return config
|
||||
except FileNotFoundError:
|
||||
createConfig()
|
||||
|
||||
def setWallPaper():
|
||||
config = configParsing()
|
||||
|
||||
PATH = configParsing['path_to_wallpapers']
|
||||
PATH = configParsing()['path_to_wallpapers']
|
||||
files = os.listdir(PATH)
|
||||
|
||||
media = random.choices(files)[0]
|
||||
@ -42,5 +37,3 @@ def setWallPaper():
|
||||
else:
|
||||
run(f"back4.sh auto {PATH}{media} & echo $! > /tmp/back4.sh.pid",True)
|
||||
# > tmp/back4.sh.pid write PID for kill()
|
||||
|
||||
setWallPaper()
|
||||
|
Loading…
Reference in New Issue
Block a user