From 6f296f2705a106241ca9b1a83130f0920f3249ad Mon Sep 17 00:00:00 2001 From: elwld Date: Sat, 6 Aug 2022 16:23:02 +0500 Subject: [PATCH] edit docs --- README.md | 89 +++---------------------------- docs/README.md | 1 - docs/english.md | 86 +++++++++++++++++++++++++++++ docs/{README_ru.md => russian.md} | 59 +++++++++++--------- src/wallpyperFuncs.py | 6 +-- 5 files changed, 129 insertions(+), 112 deletions(-) delete mode 120000 docs/README.md create mode 100644 docs/english.md rename docs/{README_ru.md => russian.md} (56%) diff --git a/README.md b/README.md index 68d0d45..8a0a068 100644 --- a/README.md +++ b/README.md @@ -7,90 +7,13 @@ WallPyPer - is small utility, work via WallPyPer can work with images and gifs. -## Install - -Dependencies: - -* [feh](https://github.com/derf/feh) -* [foo-Wallpaper-Feh-Gif ](https://github.com/thomas10-10/foo-Wallpaper-Feh-Gif) -* [apscheduler](https://github.com/agronholm/apscheduler) - -**feh** is most likely already in your list of repositories. - -Debiadn/Ubuntu: -``` -sudo apt install feh -``` -Arch: -``` -pacman -S feh -``` - +## Tutorial +[English tutorial](docs/english.md) +[Русский туториал](docs/russian.md) --- -**foo-Wallpaper-feh-gif** is just bash script, you can download it [here](https://github.com/thomas10-10/foo-Wallpaper-Feh-Gif/blob/master/back4.sh) -``` -curl -L https://raw.githubusercontent.com/thomas10-10/foo-Wallpaper-Feh-Gif/master/install.sh | bash -``` +Author - Karimullin Arthur and elwld ---- +License: GPL-3.0 -Install apscheduler -``` -pip install apscheduler -``` - ---- - -Then download WallPyPer and make main.py an run file. -``` -git clone https://github.com/KarimullinArthur/WallPyPer.git - -cd WallPyPer - -chmod +x main.py -``` - -And after create symbolic a link in one of the PATH var. -For example -``` -cd /usr/local/bin/ - -ln -s /main.py wallpyper -``` - -The absolute path you can get via command *pwd* - -## Configuration - -Create conifg in *~/.config/wallpyper/config* -and put this: -``` -{ - "path_to_wallpapers":"your_path", - "second":"0", - "minute":"*", - "hour":"*" -} -``` - -Where *path_to_wallpapers* is *absolute* path to wallpapers. -*second*, *minute* and *hour* set auto change via cron. - - -[More infarmation about cron](https://en.wikipedia.org/wiki/Cron) - -[crontab.guru](https://crontab.guru) - -## Auto Start - -For **i3wm** add in your ~/.conifg/i3/config one string: -``` -exec wallpyper -``` ---- - -Author - Karimullin Arthur - - -Mail - KarimullinArthur@riseup.net +Mail - KarimullinArthur@riseup.net \ No newline at end of file diff --git a/docs/README.md b/docs/README.md deleted file mode 120000 index 32d46ee..0000000 --- a/docs/README.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file diff --git a/docs/english.md b/docs/english.md new file mode 100644 index 0000000..12744cd --- /dev/null +++ b/docs/english.md @@ -0,0 +1,86 @@ +# WallPyper + +WallPyPer - is small utility, work via +[foo-Wallpaper-Feh-Gif ](https://github.com/thomas10-10/foo-Wallpaper-Feh-Gif) and [feh](https://github.com/derf/feh). + +[](https://user-images.githubusercontent.com/51211371/177040973-fca8885d-167e-4945-a4b6-48336e92e3c1.gif) + +WallPyPer can work with images and gifs. + +## Install + +Dependencies: + +* [feh](https://github.com/derf/feh) +* [foo-Wallpaper-Feh-Gif ](https://github.com/thomas10-10/foo-Wallpaper-Feh-Gif) +* [pytomlpp](https://github.com/bobfang1992/pytomlpp) + +**feh** is most likely already in your list of repositories. + +Debiadn/Ubuntu: +``` +sudo apt install feh +``` +Arch: +``` +pacman -S feh +``` + +--- + +**foo-Wallpaper-feh-gif** is just bash script, you can download it [here](https://github.com/thomas10-10/foo-Wallpaper-Feh-Gif/blob/master/back4.sh) +``` +curl -L https://raw.githubusercontent.com/thomas10-10/foo-Wallpaper-Feh-Gif/master/install.sh | bash +``` + +--- + +Install pytomlpp +``` +pip install pytomlpp +``` + +--- + +Then download WallPyPer and install it. +``` +git clone https://github.com/KarimullinArthur/WallPyPer.git + +cd WallPyPer + +chmod +x install.sh + +./install.sh +``` + +## Configuration + +Create conifg in *~/.config/wallpyper/config* + +Example: +``` +# WallPyPer + +default_theme = "main" + +[new] +type = "static" +random = true +path = "~/.bg/" + +[main] +type = "static" +url = "~/.bg/1.jpg" + +[dynamic] +type = "dynamic" +path = "~/.bg/" +delay = "10:00" +``` + +## Auto Start + +For **i3wm** add in your ~/.conifg/i3/config one string: +``` +exec wallpyper +``` \ No newline at end of file diff --git a/docs/README_ru.md b/docs/russian.md similarity index 56% rename from docs/README_ru.md rename to docs/russian.md index 8d952d0..e347515 100644 --- a/docs/README_ru.md +++ b/docs/russian.md @@ -11,6 +11,7 @@ WallPyPer умеет работать как с картинками так с * [feh](https://github.com/derf/feh) * [foo-Wallpaper-Feh-Gif ](https://github.com/thomas10-10/foo-Wallpaper-Feh-Gif) +* [pytomlpp](https://github.com/bobfang1992/pytomlpp) **feh** скорее всего уже есть в вашем списке репозиториев. @@ -28,46 +29,54 @@ pacman -S feh curl -L https://raw.githubusercontent.com/thomas10-10/foo-Wallpaper-Feh-Gif/master/install.sh | bash ``` -После этого скачайте WallPyPer и сделайте main.py исполняемым файлом. +--- + +Установите pytomlpp +``` +pip install pytomlpp +``` + +--- + +После этого скачайте WallPyPer и установите его. ``` git clone https://github.com/KarimullinArthur/WallPyPer.git cd WallPyPer -chmod +x main.py -``` +chmod +x install.sh -И после этого создайте ссылку в одном из каталогов перменной PATH. -например +./install.sh ``` -cd /usr/local/bin/ - -ln -s <абсолютный_путь_к_скачанному_репозиторию>/main.py wallpyper -``` - -Абсолютный путь можно получить командной pwd в катологе WallPyPery. ## Настройка Создайте конфигурационный факл в ~/.config/wallpyper/config -И запиши туда этот конфиг: -``` -{ - "path_to_wallpapers":"твой_путь", - "second":"0", - "minute":"*", - "hour":"*" -} -``` -Где *path_to_wallpapers* это *абсолютный* путь к твоим обоям. -*second*, *minute* и *hour* устанавливают интервал изменения с помощью крона. -(Больше информации о Cron)[https://ru.wikipedia.org/wiki/Cron] -(crontab.guru)[https://crontab.guru] +Пример: +``` +# WallPyPer + +default_theme = "main" + +[new] +type = "static" +random = true +path = "~/.bg/" + +[main] +type = "static" +url = "~/.bg/1.jpg" + +[dynamic] +type = "dynamic" +path = "~/.bg/" +delay = "10:00" +``` ## Автозагрузка Для **i3wm** добавте в свой ~/.config/i3/config строчку: ``` exec wallpyper -``` +``` \ No newline at end of file diff --git a/src/wallpyperFuncs.py b/src/wallpyperFuncs.py index 87f0cc8..22a2d53 100644 --- a/src/wallpyperFuncs.py +++ b/src/wallpyperFuncs.py @@ -66,7 +66,7 @@ def setRandomWallpaper(path): setWallpaper(wallpaperName) -def setDinamicWallpaper(path, delay): +def setDynamicWallpaper(path, delay): while True: setRandomWallpaper(path) sleep(delay) @@ -90,7 +90,7 @@ def setTheme(themeName = None): except KeyError: setWallpaper(theme["url"]) - elif theme["type"] == "dinamic": + elif theme["type"] == "dynamic": delay = list(map(int,theme["delay"].split(":"))) delay.reverse() while len(delay) < 3: @@ -98,7 +98,7 @@ def setTheme(themeName = None): delay = delay[0] + delay[1]*60 + delay[2]*3600 - wallpyperThread = Thread(target=setDinamicWallpaper, args=(theme["path"],delay,)) + wallpyperThread = Thread(target=setDynamicWallpaper, args=(theme["path"],delay,)) wallpyperThread.start() else: