diff --git a/setup b/setup index d924ada..73f1a86 100755 --- a/setup +++ b/setup @@ -85,6 +85,12 @@ desktop() { if [ -f "/usr/share/sounds/freedesktop/stereo/camera-shutter.oga" ]; then sudo mv /usr/share/sounds/freedesktop/stereo/camera-shutter.oga /usr/share/sounds/freedesktop/stereo/camera-shutter-disabled.oga fi + + # webp support for eye of gnome image viewer + sudo add-apt-repository ppa:helkaluin/webp-pixbuf-loader + sudo apt-get update + sudo apt install webp-pixbuf-loader + xdg-mime default org.gnome.eog.desktop image/webp } docker() { @@ -221,10 +227,11 @@ obsidian() { } discord() { # will setup discord and betterdiscord on first run, update both on subsequent runs - wget -O discord.deb "https://discord.com/api/download?platform=linux&format=deb" && sudo dpkg -i discord.deb && rm discord.deb + if [ "$EUID" -eq 0 ]; then echo "Don't run as root!"; return; fi if ! command -v npm &> /dev/null || ! command -v pnpm &> /dev/null; then echo "npm or pnpm not found. Run './setup install_nodejs'"; return; fi - cd ~/repos/tools - if [ -d ~/repos/tools/BetterDiscord ]; then cd BetterDiscord && git pull; else git clone https://github.com/BetterDiscord/BetterDiscord.git && cd BetterDiscord; fi; + cd ~/repos/tools || echo "Error: $HOME/repos/tools does not exist" || exit 1 + if [ -d ~/repos/tools/BetterDiscord ]; then cd BetterDiscord && git pull; else git clone https://github.com/BetterDiscord/BetterDiscord.git && cd BetterDiscord; fi; # get latest betterdiscord + wget -O discord.deb "https://discord.com/api/download?platform=linux&format=deb" && sudo dpkg -i discord.deb && rm discord.deb # get latest discord pnpm install && pnpm build && pnpm inject find ~/.dotfiles/desktop/discord/themes -type f -exec ln -sf {} ~/.config/BetterDiscord/themes/ \; wget https://discordstyles.github.io/DarkMatter/DarkMatter.theme.css -O ~/.config/BetterDiscord/themes/DarkMatter.theme.css @@ -255,6 +262,18 @@ spg_vpn() { sudo apt-get install virt-viewer } +nvidia_optimus() { + # TODO iGPU not used / display not working if hybrid / off + cd ~/repos/tools + if [ -d "envycontrol" ]; then cd envycontrol && git pull; else git clone https://github.com/bayasdev/envycontrol.git && cd envycontrol; fi; + sudo pip install . + # https://github.com/bayasdev/envycontrol/wiki/Frequently-Asked-Questions#instructions-for-ubuntu-and-its-derivatives + sudo prime-select on-demand + sudo systemctl mask gpu-manager.service + sudo apt-get install -y gnome-tweaks + echo "Install the gui manager according to gnome version @ https://github.com/LorenzoMorelli/GPU_profile_selector?tab=readme-ov-file#manual" +} + # Check if the first argument is the name of a function if declare -f "$1" > /dev/null; then # Call the function with the rest of the arguments