Skip to content

A shell script that takes the battery level of a connected DualSense controller via dualsensectl and outputs it on the tray via the xfce4-genmon plugin. It also powers off the controller when you click on the controller icon.

Notifications You must be signed in to change notification settings

dphilipov/xfce4-genmon-dualsensectl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A shell script that takes the battery level of a connected DualSense controller via dualsensectl and outputs it on the tray via the xfce4-genmon plugin. It also powers off the controller when you click on the controller icon.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages