Giter Club home page Giter Club logo

sway-wallpaper-stellarium's Introduction

sway-wallpaper-stellarium

Generate a star map using Stellarium and set it as the wallpaper of your Sway desktop.

Runtime dependencies

  1. sway - the compositor.

  2. swww - wallpaper manager, to be able to change the wallpaper dynamically.

  3. stellarium - astronomy software, to generate the star map.

  4. ImageMagick - the convert utility is used to chop the star map screenshot into the individual wallpapers for each output.

  5. cpulimit - limits Stellarium's CPU usage so that it is not noticeable while it runs in the background.

  6. gojq or jq - JSON processing utility, to munge the output of swaymsg.

Files

  1. sway-wallpaper-stellarium.env - Environment file for the Stellarium script. Edit it to contain your location's latitude and longitude.

  2. sway-wallpaper-stellarium.sh - Wallpaper script. It runs stellarium, waits for the star map screenshot to be taken, uses convert to create the individual wallpapers for each output, and uses swww to update the wallpapers of each output.

  3. wallpaper.ssc - Stellarium script to generate the star map screenshot.

  4. sway-wallpaper-stellarium.service - User-session systemd service unit to run the wallpaper script. Invoked by the timer unit.

  5. sway-wallpaper-stellarium.timer - User-session systemd timer unit to run the wallpaper service once every 15 minutes.

  6. swww.service - User-session systemd service unit to run swww daemon.

make install will install all files to the appropriate directories and enable the systemd units.

Make sure to edit ~/.config/sway-wallpaper-stellarium.env to contain your latitude and longitude.

The systemd units assume the existence of sway-session.target and graphical-session.target. Edit them as you need if your Sway setup does not use those targets.

Other compositors?

Sway-specific things:

  1. sway-wallpaper-stellarium.sh uses swaymsg -t get_outputs to discover the output names and dimensions. Something based on zxdg_output_manager_v1 would be more compositor-agnostic.

  2. sway-wallpaper-stellarium.sh uses swaymsg to run Stellarium in the background, to move it to the scratchpad, and to resize it to the size required for the screenshot. If Stellarium ever provides a way to take screenshots headlessly, this would not be necessary. Alternatively one could have a nested headless compositor and run stellarium against its WAYLAND_DISPLAY instead.

Wayland-specific things:

  1. swww only supports Wayland compositors, specifically those that support the xdg-output-unstable-v1 and wlr-layer-shell-unstable-v1 protocols.

systemd-specific things:

  1. The service and timer units. They don't do anything complicated and can be trivially replaced with your service manager's equivalents.

I'm open to PRs to make it more general.

But how often do you look at your wallpaper if you're using a tiling WM like Sway?

Yeah I spent a few hours implementing this and then realized it's not actually useful to me :V

License

AGPL-3.0-only

sway-wallpaper-stellarium

https://github.com/Arnavion/sway-wallpaper-stellarium

Copyright 2023 Arnav Singh

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, version 3 of the
License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

sway-wallpaper-stellarium's People

Contributors

arnavion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.