stable ver start
This commit is contained in:
parent
c125d5bdbd
commit
1e395280e4
4 changed files with 33 additions and 13 deletions
26
func.py
Normal file
26
func.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
import os
|
||||
import random
|
||||
|
||||
PATH = '/home/arthur/img/Wallpapers/media/'# path to media
|
||||
|
||||
files = os.listdir(PATH)
|
||||
|
||||
media = random.choices(files)[0]
|
||||
|
||||
def run(command,output=False):
|
||||
devNull = ">/dev/null"
|
||||
if output == True:
|
||||
os.system(command)
|
||||
else:
|
||||
os.system(command + devNull)
|
||||
|
||||
def kill():
|
||||
with open('/tmp/wallpyper','r') as file:
|
||||
for pid in file:
|
||||
run(f'kill {pid}')
|
||||
|
||||
def setWallPeper():
|
||||
if media[-4:] != '.gif':
|
||||
run(f"feh --bg-scale {PATH}{media}")
|
||||
else:
|
||||
run(f"back4.sh auto {PATH}{media} & echo $! > /tmp/wallpyper",True)
|
Loading…
Add table
Add a link
Reference in a new issue