Compare commits

..

No commits in common. "6a47603594d565f5b430d5b8dd77bf4729932c07" and "e740e5edf4369b8392208f0ca39c87f66cf8d319" have entirely different histories.

5 changed files with 43 additions and 17 deletions

View File

@ -2,6 +2,23 @@
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
. /etc/os-release
fi
@ -20,10 +37,9 @@ else
notify-send --app-name="darkman" --icon=error "$ERRORMESSAGE"
fi
if hash qdbus-qt6 2> /dev/null; then
QTDBUSBIN=qdbus-qt6
elif hash qdbus6 2> /dev/null; then
QTDBUSBIN=qdbus6
else
QTDBUSBIN=qdbus
fi
#if [[ "$QT_STYLE_OVERRIDE" != "kvantum" ]]; then
# ERRORMESSAGE="\$QT_STYLE_OVERRIDE is not 'kvantum', Qt theme switching has no effect!"
# echo $ERRORMESSAGE
# notify-send --app-name="darkman" --icon=error "$ERRORMESSAGE"
# exit 0
#fi

View File

@ -1,7 +0,0 @@
#!/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,4 +12,13 @@ fi
echo "Wallpaper: $WALLPAPER_PATH"
$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'")}'
if hash qdbus-qt6 2> /dev/null; then
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

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

View File

@ -12,4 +12,13 @@ fi
echo "Wallpaper: $WALLPAPER_PATH"
$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'")}'
if hash qdbus-qt6 2> /dev/null; then
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