diff --git a/pika-gnome-settings/debian/changelog b/pika-gnome-settings/debian/changelog index 39be24f..aeaff6e 100644 --- a/pika-gnome-settings/debian/changelog +++ b/pika-gnome-settings/debian/changelog @@ -1,4 +1,4 @@ -pika-gnome-settings (4.5-100pika1) pikauwu; urgency=low +pika-gnome-settings (4.5-100pika2) pikauwu; urgency=low * Update to pikauwu diff --git a/pika-gnome-settings/debian/rules b/pika-gnome-settings/debian/rules index fcd8420..77cdd21 100644 --- a/pika-gnome-settings/debian/rules +++ b/pika-gnome-settings/debian/rules @@ -2,6 +2,9 @@ override_dh_installgsettings: dh_installgsettings --priority=50 +override_dh_missing: + dh_missing + chmod +x debian/pika-gnome-settings/usr/bin/* %: dh $@ diff --git a/pika-gnome-settings/usr/bin/pika-gnome-darkmode b/pika-gnome-settings/usr/bin/pika-gnome-darkmode index bc1f194..39df693 100644 --- a/pika-gnome-settings/usr/bin/pika-gnome-darkmode +++ b/pika-gnome-settings/usr/bin/pika-gnome-darkmode @@ -1,22 +1,5 @@ #! /bin/dash if [ "$(gsettings get org.pika.layouts pika-theme)" = 1 ] then - while true - do - if [ -f /tmp/pika-gnome-color-scheme ] - then - if [ "$(gsettings get org.gnome.desktop.interface color-scheme)" != "$(cat /tmp/pika-gnome-color-scheme)" ] - then - if [ "$(gsettings get org.gnome.desktop.interface color-scheme)" = "'prefer-dark'" ] - then - pika-gnome-theme dark - else - pika-gnome-theme - fi - gsettings get org.gnome.desktop.interface color-scheme > /tmp/pika-gnome-color-scheme - fi - else - gsettings get org.gnome.desktop.interface color-scheme > /tmp/pika-gnome-color-scheme - fi - done -fi + pika-gnome-darkmode-py +fi \ No newline at end of file diff --git a/pika-gnome-settings/usr/bin/pika-gnome-darkmode-py b/pika-gnome-settings/usr/bin/pika-gnome-darkmode-py new file mode 100644 index 0000000..39bcbea --- /dev/null +++ b/pika-gnome-settings/usr/bin/pika-gnome-darkmode-py @@ -0,0 +1,13 @@ +#! /usr/bin/python3 + +from gi.repository import Gio +import subprocess +import time +gso=Gio.Settings.new("org.gnome.desktop.interface") +gso_currnet=gso.get_value("color-scheme") + +while True: + gso_old, gso_currnet = gso_currnet, gso.get_value("color-scheme") + if gso_currnet != gso_old: + subprocess.run(["pika-gnome-theme"]) + time.sleep(0.05) \ No newline at end of file diff --git a/pika-gnome-settings/usr/bin/pika-gnome-theme b/pika-gnome-settings/usr/bin/pika-gnome-theme index d2276ef..68dad8e 100644 --- a/pika-gnome-settings/usr/bin/pika-gnome-theme +++ b/pika-gnome-settings/usr/bin/pika-gnome-theme @@ -15,7 +15,7 @@ then . "$HOME/.config/pika_theme" fi -if [[ $1 = dark ]] +if [ "$(gsettings get org.gnome.desktop.interface color-scheme)" = "'prefer-dark'" ] then gsettings set org.gnome.shell.extensions.user-theme name "$GTK_THEME_DARK" gsettings set org.gnome.desktop.interface gtk-theme "$GTK_THEME_DARK"