Giter Site home page Giter Site logo

lucberge / wallme Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 33.84 MB

๐Ÿ’ป๐Ÿ–ผ๏ธ Change your desktop wallpaper every day based on websites.

Home Page: https://pypi.org/project/wallme

License: MIT License

Python 99.07% Shell 0.93%
wallpaper pip python change websites daily everyday pypi update automatically

wallme's Introduction

That's me ๐Ÿ‘‹

LucBerge's github stats

Languages


Tools


Frameworks

wallme's People

Contributors

lucberge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wallme's Issues

Separate gui image and background image

On Linux, changing the image file automatically change the background without running any additionnal command.
To fix this issue, the gui file and background file must be different. In result, selecting a new item in the list change the background without clicking on set.

Windows support

Chat GPT:

Write a python script wich change the desktop background on windows

To change the desktop background on Windows using Python, you can use the ctypes module to call the SystemParametersInfo function. Here is an example of how you can do this:

import ctypes

# Set the path to the image file
image_path = "C:\\path\\to\\image.jpg"

# Load the image file
SPI_SETDESKWALLPAPER = 20
ctypes.windll.user32.SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, image_path, 0)

This code will set the desktop background to the image located at "C:\path\to\image.jpg".

You can also use the win32api module from the pywin32 library to achieve the same result. Here is an example using win32api:

import win32api
import win32con

# Set the path to the image file
image_path = "C:\\path\\to\\image.jpg"

# Load the image file
win32api.SystemParametersInfo(win32con.SPI_SETDESKWALLPAPER, image_path, win32con.SPIF_UPDATEINIFILE)

This code will also set the desktop background to the image located at "C:\path\to\image.jpg".

I hope this helps! Let me know if you have any questions.


Write a windows service file which runs when the network is up

To create a Windows service that runs when the network is up, you will need to use the sc command line utility and the NET START command. Here is an example of how you can do this:

  1. Open a command prompt as an administrator.
  2. Run the following command to create a new service:
sc create MyService binpath= "C:\path\to\MyService.exe" depend= "NETWORK SERVICE/W32Time" start= auto

This command creates a new service called "MyService", which will be run from the executable file located at "C:\path\to\MyService.exe". The service will depend on the "NETWORK SERVICE" and "W32Time" services, and it will be set to start automatically.

  • To start the service, run the following command:
NET START MyService

This will start the "MyService" service and it will run whenever the network is up.

  • To stop the service, run the following command:
NET STOP MyService

This will stop the "MyService" service and it will no longer run when the network is up.

  • To delete the service, run the following command:
sc delete MyService

This will delete the "MyService" service and it will no longer be available on your system.

I hope this helps! Let me know if you have any questions.

Running pytest break the startup

On Windows and Linux, running pytest changes the entry point of the service file to pytest.
This is because in file test_website.py, line 52, the previous values is restored using the set_startup method which modifies the entry point.

It should be possible to retrieve the current entry point in the get_startup method.

MacOS support

Chat GPT:

How can I change the desktop background image on macOS from a python script?

To change the desktop background image on macOS from a Python script, you can use the subprocess module to run the osascript command-line utility.

Here is an example of how you can do this:

import subprocess

# The path to the image file you want to set as the desktop background
image_path = '/path/to/image.jpg'

# Use the osascript utility to set the desktop background
subprocess.run(['osascript', '-e', f'tell application "Finder" to set desktop picture to POSIX file "{image_path}"'])

This script will change the desktop background to the image file specified by image_path.

Note that you will need to have permission to write to the ~/Library/Application Support/Dock/desktoppicture.db file, which is where macOS stores the current desktop background image. You may need to run the script with sudo if you do not have permission to write to this file.

I hope this helps! Let me know if you have any questions or need further assistance.


Write a macOS service file which run when the network is up

On macOS, you can use launchd, a system-level process that manages other processes, to start a service when the network is up.

Here is an example of a launchd configuration file, also known as a "property list" or "plist," that can be used to start a service when the network is up:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>com.example.myservice</string>
    <key>ProgramArguments</key>
    <array>
      <string>/path/to/service/executable</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>WatchPaths</key>
    <array>
      <string>/Library/Preferences/SystemConfiguration</string>
    </array>
  </dict>
</plist>

This plist file includes the WatchPaths key, which specifies that the service should be started when the specified paths change. In this case, the /Library/Preferences/SystemConfiguration path is being watched, which is where macOS stores network configuration information.

To use this plist file, you will need to save it in the ~/Library/LaunchAgents directory and give it a descriptive name, such as myservice.plist. Then, you can use the launchctl command to load and start the service, like this:

# Load the service
launchctl load ~/Library/LaunchAgents/myservice.plist

# Start the service
launchctl start com.example.myservice

# Stop the service
launchctl stop com.example.myservice

# Unload the service
launchctl unload ~/Library/LaunchAgents/myservice.plist

I hope this helps! Let me know if you have any questions or need further assistance.

Create a gui

Create gui:

  • Open when no arguments
  • Preview the wallpapers before setting it
  • See current startup
  • Open in browser
  • Change current startup
  • Remove startup

Create a `.exe` file

Using wallme for non devs is hard. They need to:

  • Install python
  • Install pip
  • Install wallme
  • Use the CLI

Wallme must be available with pip and with a .exe file published on github.
Use Auto py to exe to create the .exe in github action before publish

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.