New beggining.
This commit is contained in:
commit
6964b2b200
33 changed files with 1281 additions and 0 deletions
27
rand-wall
Executable file
27
rand-wall
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/env python3
|
||||
|
||||
from os import listdir
|
||||
from os.path import isfile, join
|
||||
from random import choice
|
||||
from subprocess import call
|
||||
from os.path import expanduser
|
||||
from sys import exit
|
||||
|
||||
def set_random_wallapper(wallpapers, path):
|
||||
wallpaper = choice(wallpapers)
|
||||
call(['xwallpaper', '--stretch', join(path, wallpaper)])
|
||||
wallpapers.pop(wallpapers.index(wallpaper))
|
||||
|
||||
def get_list_of_wallpapers(path):
|
||||
return [f for f in listdir(path) if isfile(join(path, f))]
|
||||
|
||||
def main():
|
||||
path=expanduser("~/pics/wallpapers")
|
||||
|
||||
wallpapers = get_list_of_wallpapers(path)
|
||||
|
||||
set_random_wallapper(wallpapers, path)
|
||||
exit()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue