edit docs

This commit is contained in:
elwld 2022-08-06 16:23:02 +05:00
parent c96f790fa7
commit 6f296f2705
5 changed files with 129 additions and 112 deletions

View File

@ -7,90 +7,13 @@ WallPyPer - is small utility, work via
WallPyPer can work with images and gifs. WallPyPer can work with images and gifs.
## Install ## Tutorial
[English tutorial](docs/english.md)
Dependencies: [Русский туториал](docs/russian.md)
* [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
```
--- ---
**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) Author - Karimullin Arthur and elwld
```
curl -L https://raw.githubusercontent.com/thomas10-10/foo-Wallpaper-Feh-Gif/master/install.sh | bash
```
---
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 <abs_path_to_download_repo>/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
License: GPL-3.0
Mail - KarimullinArthur@riseup.net Mail - KarimullinArthur@riseup.net

View File

@ -1 +0,0 @@
../README.md

86
docs/english.md Normal file
View File

@ -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
```

View File

@ -11,6 +11,7 @@ WallPyPer умеет работать как с картинками так с
* [feh](https://github.com/derf/feh) * [feh](https://github.com/derf/feh)
* [foo-Wallpaper-Feh-Gif ](https://github.com/thomas10-10/foo-Wallpaper-Feh-Gif) * [foo-Wallpaper-Feh-Gif ](https://github.com/thomas10-10/foo-Wallpaper-Feh-Gif)
* [pytomlpp](https://github.com/bobfang1992/pytomlpp)
**feh** скорее всего уже есть в вашем списке репозиториев. **feh** скорее всего уже есть в вашем списке репозиториев.
@ -28,42 +29,50 @@ pacman -S feh
curl -L https://raw.githubusercontent.com/thomas10-10/foo-Wallpaper-Feh-Gif/master/install.sh | bash 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 git clone https://github.com/KarimullinArthur/WallPyPer.git
cd WallPyPer 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 Создайте конфигурационный факл в ~/.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"
```
## Автозагрузка ## Автозагрузка

View File

@ -66,7 +66,7 @@ def setRandomWallpaper(path):
setWallpaper(wallpaperName) setWallpaper(wallpaperName)
def setDinamicWallpaper(path, delay): def setDynamicWallpaper(path, delay):
while True: while True:
setRandomWallpaper(path) setRandomWallpaper(path)
sleep(delay) sleep(delay)
@ -90,7 +90,7 @@ def setTheme(themeName = None):
except KeyError: except KeyError:
setWallpaper(theme["url"]) setWallpaper(theme["url"])
elif theme["type"] == "dinamic": elif theme["type"] == "dynamic":
delay = list(map(int,theme["delay"].split(":"))) delay = list(map(int,theme["delay"].split(":")))
delay.reverse() delay.reverse()
while len(delay) < 3: while len(delay) < 3:
@ -98,7 +98,7 @@ def setTheme(themeName = None):
delay = delay[0] + delay[1]*60 + delay[2]*3600 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() wallpyperThread.start()
else: else: