Skip to content

Commit

Permalink
Restore to v1.3.0, not sure if it works but the code is there
Browse files Browse the repository at this point in the history
  • Loading branch information
smooll-d committed Oct 2, 2023
1 parent ad55c68 commit 49dc4b1
Show file tree
Hide file tree
Showing 17 changed files with 350 additions and 117 deletions.
Empty file modified .gitignore
100755 → 100644
Empty file.
116 changes: 116 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Code of Conduct - SmoollWallpaper

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate,
threatening, offensive, or harmful.

Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will
communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at <jakubskowron676@gmail.com>.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version
[1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and
[2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md),
and was generated by [contributing-gen](https://github.com/bttger/contributing-gen).
Empty file modified CONTRIBUTING.md
100755 → 100644
Empty file.
Empty file modified LICENSE
100755 → 100644
Empty file.
30 changes: 15 additions & 15 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# SmoollWallpaper

**NOTE: SmoollWallpaper is not being developed anymore. If you'd like to, you can fork this and try to develop it yourself.**

<p align="center">
<img src="./assets/swlogo.png" />
<sub><i>"Smooll" pronounced "small".</i></sub>
</p>

SmoollWallpaper (swall, pronounced `swall` and not `s-wall`) is a simple Python script for setting video wallpapers on Linux.
SmoollWallpaper (swall) is a simple Python script for setting video wallpapers on Linux.

***

Expand Down Expand Up @@ -55,28 +48,35 @@ SmoollWallpaper (swall, pronounced `swall` and not `s-wall`) is a simple Python
## Overview
SmoollWallpaper uses the magic of `mpv` and `xwinwrap` to display animated (or just video) wallpapers on your desktop, and with the help of `xprop` it allows the wallpapers to stop when you click on another window than your desktop, if you're PC or laptop don't have the best of specs just like me :).

It also allows using images as wallpapers, but this option is `WIP` (Work In Progress) and only available for `GNOME`.
It also allows using images as wallpapers, but this option is `WIP` (Work In Progress) and only available for `GNOME`, `LXDE/PCmanFM`, `LXQt/PCmanFM-qt` and `KDE >=5.7`, although I don't know about KDE because I haven't tested it yet, but if you'd like to contribute to this project, you can test it out and let me know by opening an issue.

If you'd like to get started on using my magnum opus ('cause let's be honest, I will probably never make something better), you can go to the [Getting Started wiki page](https://www.github.com/reallySmooll/smoollwallpaper/wiki/Getting-Started) or you can click on one of the badges above that says `GETTING STARTED`. There's a normal wallpaper version as well. You can go [here](https://www.github.com/reallySmooll/smoollwallpaper/wiki/Getting-Started-(Normal-Wallpapers)) or you can click on the `GETTING STARTED (NORMAL WALLPAPERS)` badge above.

Happy desktop customization! :D

[![Codacy Security Scan](https://github.com/reallySmooll/smoollwallpaper/actions/workflows/codacy.yml/badge.svg?branch=master)](https://github.com/reallySmooll/smoollwallpaper/actions/workflows/codacy.yml) [![Python application](https://github.com/reallySmooll/smoollwallpaper/actions/workflows/python-app.yml/badge.svg?branch=master)](https://github.com/reallySmooll/smoollwallpaper/actions/workflows/python-app.yml)
And btw, the security scans are passing: [![Codacy Security Scan](https://github.com/reallySmooll/smoollwallpaper/actions/workflows/codacy.yml/badge.svg?branch=master)](https://github.com/reallySmooll/smoollwallpaper/actions/workflows/codacy.yml)

***

## Features

- [x] Video wallpapers
- Video wallpapers

- [x] Script pauses automatically if desktop is not focused
- Script pauses automatically if desktop is not focused

- [x] Option to not pause the script automatically when the desktop is not focused
- Option to not pause the script automatically when the desktop is not focused

- [x] Normal wallpapers (desktops supported):
- Normal wallpapers (desktops supported):
- GNOME
- KDE >=5.7 (currently not available)
- LXDE/PCmanFM
- LXQt/PCmanFM-qt

## Upcoming features (hopefully)

- Graphical interface

- [ ] Graphical interface (coming with full rewrite, v2.0.0)
- Command line interface

I will come up with more features in the future :)

Expand Down
Empty file modified RELEASE_NOTES.md
100755 → 100644
Empty file.
41 changes: 41 additions & 0 deletions src/SwallLogger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import logging

from colorama import init, Fore, Style, deinit

class SwallLogger:
def __init__(self, name: str):
init()

self.name = name
self.logger = logging.getLogger(self.name)

self.logger.setLevel(logging.DEBUG)

ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)

formatter = logging.Formatter(
fmt="(%(asctime)s) | [%(levelname)s] - %(name)s: %(message)s",
datefmt="%H:%M:%S"
)

ch.setFormatter(formatter)

self.logger.addHandler(ch)

deinit()

def debug(self, message: str):
self.logger.debug(Fore.LIGHTBLUE_EX + message + Style.RESET_ALL)

def info(self, message: str):
self.logger.info(message)

def warning(self, message: str):
self.logger.warning(Fore.YELLOW + message + Style.RESET_ALL)

def error(self, message: str):
self.logger.error(Fore.RED + message + Style.RESET_ALL)

def critical(self, message: str):
self.logger.critical(Fore.MAGENTA + message + Style.RESET_ALL)
Empty file removed src/__init__.py
Empty file.
157 changes: 71 additions & 86 deletions src/config_file.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,103 +1,88 @@
import os
import configparser
import utils

from get_window_id import get_window_id
from SwallLogger import SwallLogger

sl = SwallLogger("config_file")

def config_file():
get_window_id()

config = configparser.ConfigParser(allow_no_value=True)
config.optionxform = str
config["PATHS"] = { "\n# Path to your wallpaper (video)": None,
"path-vid": f"{utils.HOME}/path/to/wallpaper",
"\n# Path to your wallpaper (image)": None,
"path-img": f"{utils.HOME}/path/to/wallpaper" }
config["OPTIONS"] = { "\n# Opacity level (how transparent should mpv be, from 0 to 1": None,
"opacity": 1.0,
"\n# Priority level (-20 = highest, 20 = lowest)": None,
"priority": 20,
"\n# Whether to pause the wallpaper or not when not focused on the desktop": None,
"pause": "true" }
config["VARIABLES"] = { "\n# Desktop Window ID (DON'T TOUCH!)": None,
"dwid": get_window_id.dwid }

sl.info("Searching for swall.conf...")
if os.path.exists(utils.CONFIG_FOLDER):
if os.path.exists(utils.CONFIG_FILE):
sl.info("swall.conf found!")
sl.info("swall: Reading swall.conf...\n")

config.read(utils.CONFIG_FILE)

config_file.path_vid = config.get("PATHS", "path-vid")
config_file.path_img = config.get("PATHS", "path-img")

config_file.opacity = config.get("OPTIONS", "opacity")
config_file.priority = config.get("OPTIONS", "priority")
config_file.pause = config.get("OPTIONS", "pause")

config_file.dwid = config.get("VARIABLES", "dwid")

if config_file.dwid != get_window_id.dwid:
config_file.dwid = get_window_id.dwid

from . import utils
from .get_window_id import get_window_id
from .SwallLogger import SwallLogger

sl = SwallLogger("SwallConfig")

class SwallConfig:
def __init__(self):
get_window_id()

self.config = configparser.ConfigParser(allow_no_value=True)
self.config.optionxform = str
self.config["PATHS"] = { "\n# Path to your wallpaper (video)": None,
"path-vid": f"{utils.HOME}/path/to/wallpaper",
"\n# Path to your wallpaper (image)": None,
"path-img": f"{utils.HOME}/path/to/wallpaper" }
self.config["OPTIONS"] = { "\n# Opacity level (how transparent should mpv be, from 0.0 to 1.0": None,
"opacity": 1.0,
"\n# Priority level (-20 = highest, 20 = lowest)": None,
"priority": 20,
"\n# Whether to pause the wallpaper or not when not focused on the desktop": None,
"pause": "true" }
self.config["VARIABLES"] = { "\n# Desktop Window ID (DON'T TOUCH!)": None,
"dwid": get_window_id.dwid }

def read(self):
sl.info("Searching for swall.conf...")
if os.path.exists(utils.CONFIG_FOLDER):
if os.path.exists(utils.CONFIG_FILE):
sl.info("swall.conf found!")
sl.info("swall: Reading swall.conf...\n")

self.config.read(utils.CONFIG_FILE)

self.path_vid = self.config.get("PATHS", "path-vid")
self.path_img = self.config.get("PATHS", "path-img")

self.opacity = self.config.get("OPTIONS", "opacity")
self.priority = self.config.get("OPTIONS", "priority")
self.pause = self.config.get("OPTIONS", "pause")

self.dwid = self.config.get("VARIABLES", "dwid")

if self.dwid != get_window_id.dwid:
self.dwid = get_window_id.dwid

self.config.set("VARIABLES", "dwid", get_window_id.dwid)

with open(utils.CONFIG_FILE, "w") as configfile:
self.config.write(configfile)
else:
sl.info("swall.conf not found!")
sl.info("Creating swall.conf...\n")
config.set("VARIABLES", "dwid", get_window_id.dwid)

with open(utils.CONFIG_FILE, "w") as configfile:
self.config.write(configfile)
config.write(configfile)
else:
os.makedirs(utils.CONFIG_FOLDER)
sl.info("swall.conf not found!")
sl.info("Creating swall.conf...\n")

if os.path.exists(utils.CONFIG_FILE):
sl.info("swall.conf found!")
sl.info("Reading swall.conf...\n")
with open(utils.CONFIG_FILE, "w") as configfile:
config.write(configfile)
else:
os.makedirs(utils.CONFIG_FOLDER)

self.config.read(utils.CONFIG_FILE)
if os.path.exists(utils.CONFIG_FILE):
sl.info("swall.conf found!")
sl.info("Reading swall.conf...\n")

self.path_vid = self.config.get("PATHS", "path-vid")
self.path_img = self.config.get("PATHS", "path-img")
config.read(utils.CONFIG_FILE)

self.opacity = self.config.get("OPTIONS", "opacity")
self.priority = self.config.get("OPTIONS", "priority")
self.pause = self.config.get("OPTIONS", "pause")
config_file.path_vid = config.get("PATHS", "path-vid")
config_file.path_img = config.get("PATHS", "path-img")

self.dwid = self.config.get("VARIABLES", "dwid")
config_file.opacity = config.get("OPTIONS", "opacity")
config_file.priority = config.get("OPTIONS", "priority")
config_file.pause = config.get("OPTIONS", "pause")

if self.dwid != get_window_id.dwid:
self.dwid = get_window_id.dwid
config_file.dwid = config.get("VARIABLES", "dwid")

self.config.set("VARIABLES", "dwid", get_window_id.dwid)
if config_file.dwid != get_window_id.dwid:
config_file.dwid = get_window_id.dwid

with open(utils.CONFIG_FILE, "w") as configfile:
self.config.write(configfile)
else:
sl.info("swall.conf not found!")
sl.info("Creating swall.conf...\n")
config.set("VARIABLES", "dwid", get_window_id.dwid)

with open(utils.CONFIG_FILE, "w") as configfile:
self.config.write(configfile)

def write(self, var, config_var):
if os.path.exists(utils.CONFIG_FILE):
sl.info(f"Writing variable: {var} to {utils.CONFIG_FILE}...")

self.config.read(utils.CONFIG_FILE)

self.var = self.config.get(config_var, var)
temp_var = self.var
self.config.set(config_var, var, temp_var)

config.write(configfile)
else:
sl.info("swall.conf not found!")
sl.info("Creating swall.conf...\n")

with open(utils.CONFIG_FILE, "w") as configfile:
self.config.write(configfile)
config.write(configfile)
2 changes: 1 addition & 1 deletion src/get_window_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ def get_window_id():
key, value = row.split(": ")
result[key] = value.strip()

get_window_id.dwid = result["_NET_CLIENT_LIST(WINDOW)"].strip("window id # ").split(",", 1)[0]
get_window_id.dwid = result["_NET_CLIENT_LIST_STACKING(WINDOW)"].strip("window id # ").split(",", 1)[0]
get_window_id.awid = result["_NET_ACTIVE_WINDOW(WINDOW)"].strip("window id # ")
Loading

0 comments on commit 49dc4b1

Please sign in to comment.