Skip to content

Instantly share code, notes, and snippets.

@osamaqarem
Last active November 11, 2018 08:28
Show Gist options
  • Save osamaqarem/0df7f79db7f4482c0777a7450068263e to your computer and use it in GitHub Desktop.
Save osamaqarem/0df7f79db7f4482c0777a7450068263e to your computer and use it in GitHub Desktop.
Ubuntu Setup for HP Omen

Ubuntu 18.04 on HP OMEN 15-CE032TX

Software to install

deluge tlp psensor intel-microcode alsamixer pavucontrol gnome-tweaks dconf-editor grub-customizer pixel-saver powertop

Workflow/Troubleshooting

  • Use pavucontrol to increase chrome sound to 150%.

  • From nautilus gui, modify default behaviour for executing to "Always ask".

  • Disable desk support for psensor.

  • For gnome-tweaks add date to top bar and middle click to maximize windows vertically. Install No title bar and dash to dock extensions.

Kernel:

  uname -r
  > 4.15.0-38-generic

Anything else 4.19 and below seems to have more issues.

For alsamixer after disabling auto-mute, store settings for subsequent boots:

  sudo alsactl store

Enable firewall:

sudo ufw enable
sudo ufw status

Enable night light. Set temp to 5700:

gsettings set org.gnome.settings-daemon.plugins.color night-light-temperature 5700

Update nvidia drivers from PPA. Add graphics drivers repo. Update PPA and upgrade packages. Drivers should be automatically updated:

sudo apt update
sudo apt upgrade

Set dock to bottom at size 56. Make it flexible:

gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false

Cycle windows with scroll wheel:

gsettings set org.gnome.shell.extensions.dash-to-dock scroll-action 'cycle-windows'

Minimize on click:

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

After installing TLP:

sudo gedit /etc/default/tlp
TLP_DEFAULT_MODE=BAT
TLP_PERSISTENT_DEFAULT=1 

Forces BAT settings while AC powered.

Alt-tab between current workspace apps only

gsettings set org.gnome.shell.app-switcher current-workspace-only true

Disable turbo boost for lower temperature:

Put disable-turbo-boost.service in

/etc/systemd/system/

Set NoTurbo.sh as executable and put it in

~/local/scripts/

Reload systemctl daemon

sudo systemctl daemon-reload

Check no_turbo file in

cat /sys/devices/system/cpu/intel_pstate/no_turbo

Test CPU freq. before enabling service

cat /dev/urandom > /dev/null
lscpu |grep "CPU MHz"

Start service

sudo systemctl start disable-turbo-boost

Check frequency again

lscpu |grep "CPU MHz"

Kill the process

killall cat or kill %1

Enable service auto-start

sudo systemctl enable disable-turbo-boost

To disable

sudo systemctl disable disable-turbo-boost

Troubleshoot static noise with HP Omen

https://goo.gl/vi4Zqx

sudo apt-get install -y alsa alsa-tools

Next, execute the following commands, copy pasting the whole code-block at once into bash.

printf '#!/bin/bash
hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x67
hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x3000
' > sound-script.sh 
sudo chmod +x ./sound-script.sh && sudo ./sound-script.sh

Once, the above commands are executed successfully, check the sound. You may check it here for both the speakers:

http://www.audiocheck.net/audiotests_stereo.php

If it resolves the issue, we are good to go. Now we want to make the script run everytime our system wakes up from suspend or boots. Execute the following commands:

##Make the script run on wakeup from suspend.
sudo mv ./sound-script.sh /lib/systemd/system-sleep/

Now, add the following line after doing sudo crontab -e

sudo crontab -e

Paste this line in the file:

@reboot /lib/systemd/system-sleep/sound-script.sh

And save the file and exit the editor. You can check if the cron job was successfully created or not by doing sudo crontab -l which returns a list of user-specified cron jobs. Should give back:

...
...
...
@reboot /lib/systemd/system-sleep/sound-script.sh

Useful commands that I never rememeber

Webdev debugging:

Print PID of process on 8080 port

sudo fuser 8080/tcp 

Kill process on 8080 port

sudo fuser -k 8080/tcp

ISO mounting:

Create a directory to serve as the mount location

sudo mkdir /media/iso

Mount the ISO in the target directory:

sudo mount -o loop path/to/iso/file/YOUR_ISO_FILE.ISO /media/iso

Unmount the ISO:

sudo umount /media/iso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment