Skip to content

Instantly share code, notes, and snippets.

@curiousercreative
Last active December 6, 2023 17:34
Show Gist options
  • Save curiousercreative/e969f0e5ad5615b90cdcda61d67fd14f to your computer and use it in GitHub Desktop.
Save curiousercreative/e969f0e5ad5615b90cdcda61d67fd14f to your computer and use it in GitHub Desktop.
Profiles for running System76 Galago Pro (galp5) docked vs undocked
#!/bin/bash
# default text size
#gsettings set org.gnome.desktop.interface text-scaling-factor 1.0
#echo 'disablig auto-suspend on AC power'
#gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
echo 'disabling hibernation'
test -h /etc/systemd/system/systemd-suspend.service && sudo rm /etc/systemd/system/systemd-suspend.service
# Backup curent /usr/share/X11/xkb/symbols/pc
#if [ ! -f /usr/share/X11/xkb/symbols/pc.bak ]; then
# echo "Backing up /usr/share/X11/xkb/symbols/pc..."
# sudo cp /usr/share/X11/xkb/symbols/pc /usr/share/X11/xkb/symbols/pc.bak
#fi
# Flip Super and Control keys
#echo "Flipping Super and Control keys..."
# Use original (backed up) file if exists
#if [ -f /usr/share/X11/xkb/symbols/pc.bak ]; then
# sudo cp -f /usr/share/X11/xkb/symbols/pc.bak /usr/share/X11/xkb/symbols/pc
#fi
#sudo sed -i 's/<LCTL> {\t\[ Control_L/<LCTL> {\t\[ Super_L/' /usr/share/X11/xkb/symbols/pc
#sudo sed -i 's/<LWIN> {\t\[ Super_L/<LWIN> {\t\[ Control_L/' /usr/share/X11/xkb/symbols/pc
#sudo sed -i 's/<RCTL> {\t\[ Control_R/<RCTL> {\t\[ Super_R/' /usr/share/X11/xkb/symbols/pc
#sudo sed -i 's/<RWIN> {\t\[ Super_R/<RWIN> {\t\[ Control_R/' /usr/share/X11/xkb/symbols/pc
# reload keyboard config
#setxkbmap -layout us
#echo 'keyboard updated'
# use dGPU for GL
# echo 'setting power settings'
# system76-power graphics nvidia
# set battery preserving charge thresholds
system76-power charge-thresholds | grep max_lifespan || sudo system76-power charge-thresholds --profile max_lifespan
# set power profile to performance
system76-power profile | grep Performance || system76-power profile performance
echo 'setting fan speed floor to 30%'
fanspeed.sh 30t
#!/bin/bash
echo 'restoring text-scaling to 133%'
gsettings set org.gnome.desktop.interface text-scaling-factor 1.33
echo 'restoring auto suspend on AC power'
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'suspend'
echo 're-enabling suspend-then-hibernate'
test -h /etc/systemd/system/systemd-suspend.service || sudo ln -s /usr/lib/systemd/system/systemd-suspend-then-hibernate.service /etc/systemd/system/systemd-suspend.service
# Force move backup mapping file to original
#if [ -f /usr/share/X11/xkb/symbols/pc.bak ]; then
# echo "Restoring Super and Control behaviour ..."
# sudo mv -f /usr/share/X11/xkb/symbols/pc.bak /usr/share/X11/xkb/symbols/pc
#fi
# reload keyboard config
#echo 'reloading keyboard'
#setxkbmap -layout us
echo 'setting power settings'
# use dGPU for compute only
# system76-power graphics | grep integrated || system76-power graphics integrated
# set battery preserving charge thresholds
system76-power charge-thresholds | grep balanced || sudo system76-power charge-thresholds --profile balanced
# set power profile
system76-power profile | grep Balanced || system76-power profile balanced
echo 'unsetting fan speed floor'
fanspeed.sh 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment