Compare commits

..

4 Commits

5 changed files with 17 additions and 43 deletions

View File

@ -2,23 +2,6 @@
set -x set -x
#if ! hash lsb_release 2> /dev/null; then
# ERRORMESSAGE="lsb_release was not found, the wallpaper scripts cannot figure out the distribution"
# echo "$ERRORMESSAGE"
# notify-send --app-name=darkman --icon=error "$ERRORMESSAGE"
# exit 0
#fi
#if ! hash kvantummanager 2> /dev/null; then
# ERRORMESSAGE="kvantummanager wasn't found, Qt theme switching won't work!"
# echo "$ERRORMESSAGE"
# notify-send --app-name="darkman" --icon=error "$ERRORMESSAGE"
# exit 0
#fi
#export DISTROID="$(lsb_release -si)"
#export DISTROREL="$(lsb_release -sr)"
if [ -f /etc/os-release ]; then if [ -f /etc/os-release ]; then
. /etc/os-release . /etc/os-release
fi fi
@ -37,9 +20,10 @@ else
notify-send --app-name="darkman" --icon=error "$ERRORMESSAGE" notify-send --app-name="darkman" --icon=error "$ERRORMESSAGE"
fi fi
#if [[ "$QT_STYLE_OVERRIDE" != "kvantum" ]]; then if hash qdbus-qt6 2> /dev/null; then
# ERRORMESSAGE="\$QT_STYLE_OVERRIDE is not 'kvantum', Qt theme switching has no effect!" QTDBUSBIN=qdbus-qt6
# echo $ERRORMESSAGE elif hash qdbus6 2> /dev/null; then
# notify-send --app-name="darkman" --icon=error "$ERRORMESSAGE" QTDBUSBIN=qdbus6
# exit 0 else
#fi QTDBUSBIN=qdbus
fi

View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
. ~/.local/share/dark-mode.d/00-do-not-repeat-yourself.bash
if [[ -f $HOME/.local/share/darkman-brightness.txt ]]; then
$QTDBUSBIN org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.setBrightness $(head -n1 $HOME/.local/share/darkman-brightness.txt)
fi

View File

@ -12,13 +12,4 @@ fi
echo "Wallpaper: $WALLPAPER_PATH" echo "Wallpaper: $WALLPAPER_PATH"
if hash qdbus-qt6 2> /dev/null; then $QTDBUSBIN org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'var allDesktops = desktops();print (allDesktops);for (i=0;i<allDesktops.length;i++) {d = allDesktops[i];d.wallpaperPlugin = "org.kde.image";d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");d.writeConfig("Image", "file://'$WALLPAPER_PATH'")}'
qdbus-qt6 org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'var allDesktops = desktops();print (allDesktops);for (i=0;i<allDesktops.length;i++) {d = allDesktops[i];d.wallpaperPlugin = "org.kde.image";d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");d.writeConfig("Image", "file://'$WALLPAPER_PATH'")}'
qdbus-qt6 org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.setBrightness 512
elif hash qdbus6 2> /dev/null; then
qdbus6 org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'var allDesktops = desktops();print (allDesktops);for (i=0;i<allDesktops.length;i++) {d = allDesktops[i];d.wallpaperPlugin = "org.kde.image";d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");d.writeConfig("Image", "file://'$WALLPAPER_PATH'")}'
qdbus6 org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.setBrightness 512
else
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'var allDesktops = desktops();print (allDesktops);for (i=0;i<allDesktops.length;i++) {d = allDesktops[i];d.wallpaperPlugin = "org.kde.image";d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");d.writeConfig("Image", "file://'$WALLPAPER_PATH'")}'
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.setBrightness 512
fi

View File

@ -0,0 +1 @@
../dark-mode.d/10-brightness.bash

View File

@ -12,13 +12,4 @@ fi
echo "Wallpaper: $WALLPAPER_PATH" echo "Wallpaper: $WALLPAPER_PATH"
if hash qdbus-qt6 2> /dev/null; then $QTDBUSBIN org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'var allDesktops = desktops();print (allDesktops);for (i=0;i<allDesktops.length;i++) {d = allDesktops[i];d.wallpaperPlugin = "org.kde.image";d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");d.writeConfig("Image", "file://'$WALLPAPER_PATH'")}'
qdbus-qt6 org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'var allDesktops = desktops();print (allDesktops);for (i=0;i<allDesktops.length;i++) {d = allDesktops[i];d.wallpaperPlugin = "org.kde.image";d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");d.writeConfig("Image", "file://'$WALLPAPER_PATH'")}'
qdbus-qt6 org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.setBrightness 512
elif hash qdbus6 2> /dev/null; then
qdbus6 org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'var allDesktops = desktops();print (allDesktops);for (i=0;i<allDesktops.length;i++) {d = allDesktops[i];d.wallpaperPlugin = "org.kde.image";d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");d.writeConfig("Image", "file://'$WALLPAPER_PATH'")}'
qdbus6 org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.setBrightness 512
else
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'var allDesktops = desktops();print (allDesktops);for (i=0;i<allDesktops.length;i++) {d = allDesktops[i];d.wallpaperPlugin = "org.kde.image";d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");d.writeConfig("Image", "file://'$WALLPAPER_PATH'")}'
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.setBrightness 512
fi