Skip to content

Commit

Permalink
feat(plugin-scripts): Add recommended package for system76-power scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mmstick committed Dec 22, 2020
1 parent b825c0a commit d6e8d05
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
8 changes: 7 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions debian/pop-shell-plugins-system76-power.files
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions debian/pop-shell.install
Original file line number Diff line number Diff line change
@@ -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/
3 changes: 3 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
#export DH_VERBOSE=1

BASEDIR=debian/pop-shell/usr/share/gnome-shell/extensions/[email protected]
DESTDIR=debian/tmp

%:
dh $@

override_dh_install:
make install-system76-plugins DESTDIR=$(DESTDIR)
dh_movefiles
dh_install
rm -rf $(BASEDIR)/schemas

Expand Down
16 changes: 16 additions & 0 deletions src/scripts_system76/graphics-compute.sh
Original file line number Diff line number Diff line change
@@ -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
'
16 changes: 16 additions & 0 deletions src/scripts_system76/graphics-discrete.sh
Original file line number Diff line number Diff line change
@@ -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
'
16 changes: 16 additions & 0 deletions src/scripts_system76/graphics-hybrid.sh
Original file line number Diff line number Diff line change
@@ -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
'
16 changes: 16 additions & 0 deletions src/scripts_system76/graphics-integrated.sh
Original file line number Diff line number Diff line change
@@ -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
'

0 comments on commit d6e8d05

Please sign in to comment.