Giter VIP home page Giter VIP logo

xfce4-genmon-dualsensectl's Introduction

A DualSense battery level tray icon & power off button

Active and Inactive states: image

The script takes the output from dualsensectl and displays it as a tray icon via the xfce4-genmon-plugin. It also powers off the controller when you click on the controller icon.

Icons used are free Fontawesome icons. You can replace them with whatever you want.

Note: my setup is for having 2 tray icons for 2 controllers.

Having different icons for different battery levels

You can do something like:

if [ "$battery_level" -ge 75 ]; then
    echo "<img>/path/to/icon-full.svg</img>"
    echo "<tool>$battery_level%</tool>"
elif [ "$battery_level" -ge 50 ]; then
    echo "<img>/path/to/icon-half.svg</img>"
    echo "<tool>$battery_level%</tool>"
elif [ "$battery_level" -ge 25 ]; then
    echo "<img>/path/to/icon-low.svg</img>"
    echo "<tool>$battery_level%</tool>"
elif [ "$battery_level" -ge 0 ]; then
    echo "<img>/path/to/icon-empty.svg</img>"
    echo "<tool>$battery_level%</tool>"
else
    echo "<img>/path/to/icon-inactive.svg</img>"
    echo "<tool>Disconnected</tool>"
fi

xfce4-genmon-dualsensectl's People

Contributors

dphilipov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.