diff --git a/Makefile b/Makefile index f07934e9..d1aeefa6 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ compile: convert metadata.json schemas done # Rebuild, install, reconfigure local settings, restart shell, and listen to journalctl logs -debug: depcheck compile install configure enable restart-shell listen +debug: depcheck compile install install-system76-plugins configure enable restart-shell listen depcheck: @echo depcheck @@ -85,6 +85,11 @@ install: cp -r src/scripts/* $(SCRIPTS_BASE) chmod +x $(PLUGIN_BASE)/**/*.js $(SCRIPTS_BASE)/* +install-system76-plugins: + mkdir -p $(SCRIPTS_BASE) + cp -r src/scripts_system76/* $(SCRIPTS_BASE) + chmod +x $(SCRIPTS_BASE)/* + uninstall: rm -rf $(INSTALLBASE)/$(INSTALLNAME) diff --git a/debian/control b/debian/control index 47e30f1c..1be513b1 100644 --- a/debian/control +++ b/debian/control @@ -7,11 +7,17 @@ Standards-Version: 3.9.8 Homepage: https://github.com/pop-os/shell Vcs-Git: https://github.com/pop-os/shell +Package: pop-shell-plugins-system76-power +Architecture: all +Depends: pop-shell, system76-power +Description: Launcher integration with system76-power + Package: pop-shell Architecture: all Depends: ${misc:Depends}, pop-shell-shortcuts +Recommends: pop-shell-plugins-system76-power Replaces: gnome-control-center-data (<< 1:3.38.1-2ubuntu1pop1~) Breaks: gnome-control-center-data (<< 1:3.38.1-2ubuntu1pop1~) -Description: Pop!_OS Shell +Description: Pop!_OS Shell \ No newline at end of file diff --git a/debian/pop-shell-plugins-system76-power.files b/debian/pop-shell-plugins-system76-power.files new file mode 100644 index 00000000..edee7fbe --- /dev/null +++ b/debian/pop-shell-plugins-system76-power.files @@ -0,0 +1,4 @@ +/usr/lib/pop-shell/scripts/graphics-compute.sh +/usr/lib/pop-shell/scripts/graphics-discrete.sh +/usr/lib/pop-shell/scripts/graphics-hybrid.sh +/usr/lib/pop-shell/scripts/graphics-integrated.sh \ No newline at end of file diff --git a/debian/pop-shell.install b/debian/pop-shell.install index c312eeb1..de9a2c7d 100644 --- a/debian/pop-shell.install +++ b/debian/pop-shell.install @@ -1,2 +1,3 @@ schemas/org.gnome.shell.extensions.pop-shell.gschema.xml usr/share/glib-2.0/schemas keybindings/*.xml usr/share/gnome-control-center/keybindings +usr/ \ No newline at end of file diff --git a/debian/rules b/debian/rules index d3ae75eb..03769cc6 100755 --- a/debian/rules +++ b/debian/rules @@ -5,11 +5,14 @@ #export DH_VERBOSE=1 BASEDIR=debian/pop-shell/usr/share/gnome-shell/extensions/pop-shell@system76.com +DESTDIR=debian/tmp %: dh $@ override_dh_install: + make install-system76-plugins DESTDIR=$(DESTDIR) + dh_movefiles dh_install rm -rf $(BASEDIR)/schemas diff --git a/src/scripts_system76/graphics-compute.sh b/src/scripts_system76/graphics-compute.sh new file mode 100644 index 00000000..ef415d10 --- /dev/null +++ b/src/scripts_system76/graphics-compute.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# name: Switch to Compute Graphics +# icon: preferences-system-symbolic +# description: Use integrated GPU for display; discrete for CUDA / OpenCL +# keywords: compute graphics switch nvidia + +gnome-terminal -- sh -c ' + if system76-power graphics compute; then + echo "Succesfully switched. You may now reboot" + else + echo "Failed to switch\nPress key to exit" + fi + + read x +' \ No newline at end of file diff --git a/src/scripts_system76/graphics-discrete.sh b/src/scripts_system76/graphics-discrete.sh new file mode 100644 index 00000000..e58ee084 --- /dev/null +++ b/src/scripts_system76/graphics-discrete.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# name: Switch to NVIDIA Graphics +# icon: preferences-system-symbolic +# description: Use NVIDIA GPU for display and applications +# keywords: nvidia graphics switch + +gnome-terminal -- sh -c ' + if system76-power graphics nvidia; then + echo "Succesfully switched. You may now reboot" + else + echo "Failed to switch\nPress key to exit" + fi + + read x +' \ No newline at end of file diff --git a/src/scripts_system76/graphics-hybrid.sh b/src/scripts_system76/graphics-hybrid.sh new file mode 100644 index 00000000..7c60928a --- /dev/null +++ b/src/scripts_system76/graphics-hybrid.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# name: Switch to Hybrid Graphics +# icon: preferences-system-symbolic +# description: Use integrated GPU for display; applications may request discrete +# keywords: integrated graphics switch intel nvidia hybrid + +gnome-terminal -- sh -c ' + if system76-power graphics hybrid; then + echo "Succesfully switched. You may now reboot" + else + echo "Failed to switch\nPress key to exit" + fi + + read x +' \ No newline at end of file diff --git a/src/scripts_system76/graphics-integrated.sh b/src/scripts_system76/graphics-integrated.sh new file mode 100644 index 00000000..ba60b94d --- /dev/null +++ b/src/scripts_system76/graphics-integrated.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# name: Switch to Integrated Graphics +# icon: preferences-system-symbolic +# description: Use integrated GPU for display and applications +# keywords: integrated graphics switch intel + +gnome-terminal -- sh -c ' + if system76-power graphics integrated; then + echo "Succesfully switched. You may now reboot" + else + echo "Failed to switch\nPress key to exit" + fi + + read x +' \ No newline at end of file