Adding screenshot

This commit is contained in:
Roman 2023-08-08 16:03:38 +09:00
parent 85e8aac235
commit 69317daf18
5 changed files with 23 additions and 13 deletions

View File

@ -2,9 +2,11 @@
GUI wallpaper setter for Wayland-based window managers such as Hyprland or Sway.
![screenshot](screenshot.jpg)
## Installation
(Under construction)
`pip install waypaper` or in case of troubles `pipx install waypaper`. Also, install `swaybg` from your package manager.
### 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 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
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 KiB

View File

@ -22,19 +22,20 @@ setuptools.setup(
"waypaper = waypaper.__main__:run"
]
},
install_requires=[],
install_requires=["PyGObject"],
version=version,
python_requires='~=3.8',
python_requires='>3.10',
classifiers=[
"Development Status :: 4 - Beta",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Environment :: Console",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Utilities",
],
packages=["waypaper"],

View File

@ -4,7 +4,7 @@ from waypaper.app import App
from waypaper.changer import change_wallpaper
__version__ = "1.0.2"
__version__ = "1.1"
def run():

View File

@ -26,7 +26,7 @@ class App(Gtk.Window):
def __init__(self):
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:
@ -37,7 +37,7 @@ class App(Gtk.Window):
self.add(self.main_box)
# 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.main_box.pack_start(self.choose_folder_button, False, False, 0)
@ -108,7 +108,7 @@ class App(Gtk.Window):
def save_data(self):
"""Save selected image folder to the configuration file"""
"""Save the parameters to the configuration file"""
config = configparser.ConfigParser()
if os.path.exists(self.config_file_path):
config.read(self.config_file_path)
@ -119,7 +119,7 @@ class App(Gtk.Window):
# Save folder:
config.set("Settings", "folder", self.image_folder)
# Save selected image:
# Save selected wallpaper:
if self.selected_image_path is not None:
config.set("Settings", "wallpaper", self.selected_image_path)
@ -148,6 +148,7 @@ class App(Gtk.Window):
row = 0
col = 0
# Load images from the folder:
for filename in os.listdir(self.image_folder):
if filename.endswith(".jpg") or filename.endswith(".png") or filename.endswith(".gif"):
image_path = os.path.join(self.image_folder, filename)
@ -179,7 +180,7 @@ class App(Gtk.Window):
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(
"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):
"""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
print("Selected image path:", self.selected_image_path)
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):
"""On clicking exit button, save the selected folder and quit"""
"""On clicking exit button, save the data and quit"""
self.save_data()
Gtk.main_quit()
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:
self.save_data()
Gtk.main_quit()