Giter Club home page Giter Club logo

bgslide's Introduction

bgslide

A cross-platform Go application to set the desktop background to be a slideshow of images

Motivations

I use Pop!_OS+GNOME, Windows, and Mac. I wanted to set my backgrounds as a slideshow of photos that I have taken.

  • Pop!_OS doesn't appear to have an option to set the desktop background as a slideshow of images.
  • Windows allows slideshows but sets a different image on multiple displays - I wanted the same image on both displays.
  • I use Mac for work and firgured why not make it compatible with all 3 ๐Ÿ™ƒ
  • I wanted an excuse to practice Go.

Supports

  • Linux
    • GNOME Desktop Environments
  • Windows
  • Mac (working but ensure that Mac settings for automatically changing picture are disabled)

Building/Installing

Linux

go build && go install

Windows

Build with flags so Windows doesn't open a terminal window when running the binary.

go build -ldflags -H=windowsgui

go install -ldflags -H=windowsgui

Mac

go build && go install

Usage

The -dir flag will default to the Pictures folder in your home directory if the environment variable HOME or USERPROFILE exists on your system.

Usage of ./bgslide:
  -dir string
        The directory containing the wallpapers. (default "/home/karan/Pictures")
  -interval duration
        The interval for changing wallpaper. E.g. 300s, 5m, 1h. Minimum of 5m (default 30m0s)

Running automatically on startup

Linux

  1. Create a bgslide.service file in /etc/systemd/user containing:
[Unit]
Description=A service to set the desktop background to be a slideshow of images.

[Service]
Type=simple
ExecStart=%h/go/bin/bgslide

[Install]
WantedBy=default.target
  1. systemctl --user daemon-reload
  2. systemctl --user enable bgslide.service
  3. systemctl --user start bgslide

Windows

N.B. Windows may flag the application as unsafe and quarantine it.

  1. Win+R, type shell:startup
  2. Create a shortcut to the bgslide.exe in your GOPATH adding flags if you want to change the defaults.
  3. Run the shortcut to start immediately, otherwise it'll run on the next startup.

Mac

  1. Create a bgslide.plist file in ~/Library/LaunchAgents replacing paths as necessary:
<?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>bgslide</string>
    <key>ProgramArguments</key>
    <array>
      <string>/Users/YOUR_USERNAME/go/bin/bgslide</string>
      <!-- uncomment args if needed -->
      <!-- <string>-dir</string>
      <string>/path/to/pictures</string> -->
      <!-- <string>-interval</string>
      <string>5m</string> -->
    </array>
    <key>KeepAlive</key>
    <true/>
    <key>StandardErrorPath</key>
    <string>/tmp/bglist.log</string>
    <key>StandardOutPath</key>
    <string>/tmp/bglist.log</string>
  </dict>
</plist>
  1. Add to services - launchctl enable gui/$UID/bgslide
  2. Start service - launchctl bootstrap gui/$UID ~/Library/LaunchAgents/bgslide.plist
  3. Stop service - launchctl bootout gui/$UID ~/Library/LaunchAgents/bgslide.plist
  4. Remove from services - launchctl disable gui/$UID/bgslide

bgslide's People

Contributors

p-karanthaker avatar

Watchers

James Cloos 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.