GithubHelp home page GithubHelp logo

prey169 / kshift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from justjokiing/kshift

0.0 0.0 0.0 14.41 MB

Theme/Wallpaper shift for KDE

License: GNU General Public License v3.0

Python 100.00%

kshift's Introduction

kshift - KDE Theme Shift

kshift is a KDE theme shifting script that activates at set times to switch themes, including sunrise and sunset. When run manually, it sets the color theme and/or wallpaper to the 'correct' value based on current time. It uses plasma-apply-colorscheme for color themes, plasma-changeicons for icon themes, plasma-apply-wallpaperimage for wallpapers, and python os.system() for commands.

During installation, kshift sets systemd timers to run the script at any time a theme is set, including sunrise/sunset. The times set can be the sunrise/sunset keywords or ANY valid 'OnCalendar' time. Information on 'OnCalendar' syntax and capability is available in more detail here

The sunrise and sunset times are updated when kshift is ran.

Demo

This demo shows a shift from one theme to another manually, then kshift determining the correct theme to switch to.

demo.mp4

Usage

usage: kshift [-h] [-w WALLPAPER] [-c COLORSCHEME] [-i ICONTHEME] [-t {day,night}] [--install | --remove | -s]

KDE Theme Switching

options:
  -h, --help            show this help message and exit
  -w WALLPAPER, --wallpaper WALLPAPER
                        Sets the current wallpaper
  -c COLORSCHEME, --colorscheme COLORSCHEME
                        Sets the colorscheme
  -i ICONTHEME, --icontheme ICONTHEME
                        Sets the icon theme
  -t {day,night}, --theme {day,night}
                        Sets the theme
  --install             Installs Kshift
  --remove              Removes Kshift
  -s, --status          Displays kshift timing information

Installation

Required Programs

  • KDE Plasma
  • Systemd
  • Python 3
  • Colorama

Instructions

  1. Clone and enter kshift

    $ git clone https://github.com/justjokiing/kshift
    $ cd kshift/src
    
  2. Edit the default variables in the variable file defaults.yml or look at usage for command line arguments

     location: USNY0996 # Location Code from https://weather.codes/search
     sunrise: '07:00'   # Default sunrise time, when time data cannot be accessed. These must be in quotes.
     sunset: '19:00'    # Default sunset  time
     rise_delay: 0      # Hour delay for sunrise, can be negative
     set_delay: 0       # Hour delay for sunset
     webdata: true      # Boolean for accessing web for time data
     net_timeout: 10    # How long to wait for network timeout
     themes:
       day:
         colorscheme: BreezeLight  # Check 'plasma-apply-colorscheme -l' for options
         icontheme: breeze
         wallpaper: /usr/share/wallpapers/Flow/contents/images/5120x2880.jpg
         command: ''               # Runs command at theme activation
         time: sunrise             # Keywords 'sunrise', 'sunset', or ANY correct systemd 'OnCalendar' time
       night:
         colorscheme: BreezeDark
         icontheme: breeze-dark
         wallpaper: /usr/share/wallpapers/Flow/contents/images_dark/5120x2880.jpg
         command: ''
         time: 
           - sunset
       october:
         wallpaper: /usr/share/wallpapers/FallenLeaf/contents/images/2560x1600.jpg
         time: '*-10-* *:*:*'
         enabled: false            # Disables theme, it will not run on time
    

    The themes default are set to a set of default day and night KDE themes and wallpapers. You can add as many themes as you would like at many different times, wallpapers, commands, icons, and colorschemes. None of the theme variables are required. If time is not set, there will be no automatic transition. The default for 'enabled' is true.

    The time variables "sunrise" and "sunset" are keywords to kshift and are replaced with the sunrise and sunset times that your location variable sets. Each theme's time will be converted to SystemD 'OnCalendar' syntax. Make sure to use correct YAML syntax.

  3. Create the systemd services and add kshift to local bin

    $ ./kshift --install
    

    kshift will now be be installed to ~/.local/bin . Ensure that directory is in $PATH if wanted to be manually executed. The kshift timer will be updated after each execution.

    kshift variables will then be located at ~/.config/kshift/kshift.yml and follows the same format of defaults.yml, any further variable can be done by editing that file or using the --install option.

  4. Now check to see if the system timers are on and working.

    $ ./kshift --status
    

    Then test out your themes.

kshift's People

Contributors

justjokiing avatar raindix avatar krzysztofjeziorny avatar prey169 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.