mirror of
https://github.com/anufrievroman/waypaper.git
synced 2024-10-05 15:18:41 +03:00
Adding screenshot
This commit is contained in:
parent
85e8aac235
commit
69317daf18
10
README.md
10
README.md
@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
GUI wallpaper setter for Wayland-based window managers such as Hyprland or Sway.
|
GUI wallpaper setter for Wayland-based window managers such as Hyprland or Sway.
|
||||||
|
|
||||||
|
![screenshot](screenshot.jpg)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
(Under construction)
|
`pip install waypaper` or in case of troubles `pipx install waypaper`. Also, install `swaybg` from your package manager.
|
||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
|
||||||
@ -24,6 +26,12 @@ To restore the chosen wallpaper at launch, add `waypaper --restore` to your star
|
|||||||
- If wallpaper does not change, make sure that `swaybg` is installed.
|
- If wallpaper does not change, make sure that `swaybg` is installed.
|
||||||
- If application does not run, much sure to install gobject library (it might be called `python-gobject` or `python3-gi` in your package manager)
|
- If application does not run, much sure to install gobject library (it might be called `python-gobject` or `python3-gi` in your package manager)
|
||||||
|
|
||||||
|
## Roadmap
|
||||||
|
|
||||||
|
- Support for other backends like `hyprpaper` and xorg backends.
|
||||||
|
- Additional options for search in subfolders, background colors etc.
|
||||||
|
- Dynamic grid of thumbnails that adopts to the application width.
|
||||||
|
|
||||||
## Contributions
|
## Contributions
|
||||||
|
|
||||||
Feel free to propose PR and suggest the improvements. However, I don't have much time to add features to this project.
|
Feel free to propose PR and suggest the improvements. However, I don't have much time to add features to this project.
|
||||||
|
BIN
screenshot.jpg
Normal file
BIN
screenshot.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 515 KiB |
7
setup.py
7
setup.py
@ -22,19 +22,20 @@ setuptools.setup(
|
|||||||
"waypaper = waypaper.__main__:run"
|
"waypaper = waypaper.__main__:run"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
install_requires=[],
|
install_requires=["PyGObject"],
|
||||||
version=version,
|
version=version,
|
||||||
python_requires='~=3.8',
|
python_requires='>3.10',
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Development Status :: 4 - Beta",
|
"Development Status :: 4 - Beta",
|
||||||
"License :: OSI Approved :: GNU General Public License (GPL)",
|
"License :: OSI Approved :: GNU General Public License (GPL)",
|
||||||
"Environment :: Console",
|
"Environment :: Console",
|
||||||
"Natural Language :: English",
|
"Natural Language :: English",
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
"Programming Language :: Python :: 3.7",
|
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
|
"Programming Language :: Python :: 3.12",
|
||||||
"Topic :: Utilities",
|
"Topic :: Utilities",
|
||||||
],
|
],
|
||||||
packages=["waypaper"],
|
packages=["waypaper"],
|
||||||
|
@ -4,7 +4,7 @@ from waypaper.app import App
|
|||||||
from waypaper.changer import change_wallpaper
|
from waypaper.changer import change_wallpaper
|
||||||
|
|
||||||
|
|
||||||
__version__ = "1.0.2"
|
__version__ = "1.1"
|
||||||
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
|
@ -26,7 +26,7 @@ class App(Gtk.Window):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(title="Waypaper")
|
super().__init__(title="Waypaper")
|
||||||
self.set_default_size(800, 600)
|
self.set_default_size(780, 600)
|
||||||
|
|
||||||
|
|
||||||
# Create the configuration directory if it doesn't exist:
|
# Create the configuration directory if it doesn't exist:
|
||||||
@ -37,7 +37,7 @@ class App(Gtk.Window):
|
|||||||
self.add(self.main_box)
|
self.add(self.main_box)
|
||||||
|
|
||||||
# Create a button to open folder dialog:
|
# Create a button to open folder dialog:
|
||||||
self.choose_folder_button = Gtk.Button(label="Choose Image Folder")
|
self.choose_folder_button = Gtk.Button(label="Choose wallpaper folder")
|
||||||
self.choose_folder_button.connect("clicked", self.on_choose_folder_clicked)
|
self.choose_folder_button.connect("clicked", self.on_choose_folder_clicked)
|
||||||
self.main_box.pack_start(self.choose_folder_button, False, False, 0)
|
self.main_box.pack_start(self.choose_folder_button, False, False, 0)
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ class App(Gtk.Window):
|
|||||||
|
|
||||||
|
|
||||||
def save_data(self):
|
def save_data(self):
|
||||||
"""Save selected image folder to the configuration file"""
|
"""Save the parameters to the configuration file"""
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
if os.path.exists(self.config_file_path):
|
if os.path.exists(self.config_file_path):
|
||||||
config.read(self.config_file_path)
|
config.read(self.config_file_path)
|
||||||
@ -119,7 +119,7 @@ class App(Gtk.Window):
|
|||||||
# Save folder:
|
# Save folder:
|
||||||
config.set("Settings", "folder", self.image_folder)
|
config.set("Settings", "folder", self.image_folder)
|
||||||
|
|
||||||
# Save selected image:
|
# Save selected wallpaper:
|
||||||
if self.selected_image_path is not None:
|
if self.selected_image_path is not None:
|
||||||
config.set("Settings", "wallpaper", self.selected_image_path)
|
config.set("Settings", "wallpaper", self.selected_image_path)
|
||||||
|
|
||||||
@ -148,6 +148,7 @@ class App(Gtk.Window):
|
|||||||
row = 0
|
row = 0
|
||||||
col = 0
|
col = 0
|
||||||
|
|
||||||
|
# Load images from the folder:
|
||||||
for filename in os.listdir(self.image_folder):
|
for filename in os.listdir(self.image_folder):
|
||||||
if filename.endswith(".jpg") or filename.endswith(".png") or filename.endswith(".gif"):
|
if filename.endswith(".jpg") or filename.endswith(".png") or filename.endswith(".gif"):
|
||||||
image_path = os.path.join(self.image_folder, filename)
|
image_path = os.path.join(self.image_folder, filename)
|
||||||
@ -179,7 +180,7 @@ class App(Gtk.Window):
|
|||||||
|
|
||||||
|
|
||||||
def on_choose_folder_clicked(self, widget):
|
def on_choose_folder_clicked(self, widget):
|
||||||
"""Choosing the folder of images"""
|
"""Choosing the folder of images, saving the path, and reloading images"""
|
||||||
|
|
||||||
dialog = Gtk.FileChooserDialog(
|
dialog = Gtk.FileChooserDialog(
|
||||||
"Please choose a folder", self, Gtk.FileChooserAction.SELECT_FOLDER,
|
"Please choose a folder", self, Gtk.FileChooserAction.SELECT_FOLDER,
|
||||||
@ -194,7 +195,7 @@ class App(Gtk.Window):
|
|||||||
|
|
||||||
|
|
||||||
def on_image_clicked(self, widget, user_data):
|
def on_image_clicked(self, widget, user_data):
|
||||||
"""On clicking an image, set it as a wallpaper"""
|
"""On clicking an image, set it as a wallpaper and save"""
|
||||||
self.selected_image_path = user_data
|
self.selected_image_path = user_data
|
||||||
print("Selected image path:", self.selected_image_path)
|
print("Selected image path:", self.selected_image_path)
|
||||||
fill_option = self.fill_option_combo.get_active_text() or self.default_fill_option
|
fill_option = self.fill_option_combo.get_active_text() or self.default_fill_option
|
||||||
@ -203,13 +204,13 @@ class App(Gtk.Window):
|
|||||||
|
|
||||||
|
|
||||||
def on_exit_clicked(self, widget):
|
def on_exit_clicked(self, widget):
|
||||||
"""On clicking exit button, save the selected folder and quit"""
|
"""On clicking exit button, save the data and quit"""
|
||||||
self.save_data()
|
self.save_data()
|
||||||
Gtk.main_quit()
|
Gtk.main_quit()
|
||||||
|
|
||||||
|
|
||||||
def on_key_pressed(self, widget, event):
|
def on_key_pressed(self, widget, event):
|
||||||
"""On clicking q, button save the selected folder and quit"""
|
"""On clicking q, save the data and quit"""
|
||||||
if event.keyval == Gdk.KEY_q:
|
if event.keyval == Gdk.KEY_q:
|
||||||
self.save_data()
|
self.save_data()
|
||||||
Gtk.main_quit()
|
Gtk.main_quit()
|
||||||
|
Loading…
Reference in New Issue
Block a user