#!/bin/bash GREEN=$(tput setaf 2) BOLD=$(tput bold) RESET=$(tput sgr0) if [ "$(id -u)" = 0 ]; then echo "You're root! Run script as user" && exit 1 fi # >>>>>> start of user settings <<<<<< #============================================================================== # gnome desktop settings #============================================================================== idle_delay=2400 title_bar_buttons_on="true" clock_show_date="true" capslock_delete="true" night_light="true" autostart_apps="true" #============================================================================== # git settings #============================================================================== git_email='example@example.com' git_user_name='example_name' #============================================================================== # php.ini settings #============================================================================== upload_max_filesize=128M post_max_size=128M max_execution_time=60 # >>>>>> end of user settings <<<<<< #============================================================================== # display user settings #============================================================================== clear cat </dev/null && #========================================================================== # MPV #========================================================================== { mkdir -p "$HOME/.config/mpv" cat >"$HOME/.config/mpv/mpv.conf" </dev/null && #========================================================================== # PHP #========================================================================== { for key in upload_max_filesize post_max_size max_execution_time; do sudo sed -i "s/^\($key\).*/\1 = ${!key}/" /etc/php.ini done } hash code 2>/dev/null && #========================================================================== # Visual Studio Code #========================================================================== { # https://github.com/Microsoft/vscode/issues/48480 cat >>"$HOME/.bashrc" <"$HOME/.config/autostart/org.gnome.gedit.desktop" <<'EOL' [Desktop Entry] Name=Text Editor Exec=gedit Documents/TODO.txt Type=Application EOL cat >"$HOME/.config/autostart/org.gnome.Terminal.desktop" <<'EOL' [Desktop Entry] Name=Terminal Exec=gnome-terminal Type=Application EOL fi #============================================================================== # setup pulse audio with the best sound quality possible # # *pacmd list-sinks | grep sample and see bit-depth available for interface # *pulseaudio --dump-re-sample-methods and see re-sampling available # # *MAKE SURE your interface can handle s32le 32bit rather than the default 16bit #============================================================================== echo "${BOLD}Setting up Pulse Audio...${RESET}" sudo sed -i "s/; default-sample-format = s16le/default-sample-format = s32le/g" /etc/pulse/daemon.conf sudo sed -i "s/; resample-method = speex-float-1/resample-method = speex-float-10/g" /etc/pulse/daemon.conf sudo sed -i "s/; avoid-resampling = false/avoid-resampling = true/g" /etc/pulse/daemon.conf #============================================================================== # setup jack audio for real time use #============================================================================== # sudo usermod -a -G jackuser "$USERNAME" # Add current user to jackuser group # sudo tee /etc/security/limits.d/95-jack.conf <>"$HOME/.Xresources" fi dconf write /org/gnome/settings-daemon/plugins/xsettings/antialiasing "'rgba'" #============================================================================================== # add to .bashrc #============================================================================================== cat >>"$HOME/.bashrc" <<'EOL' alias ls="ls -ltha --color --group-directories-first" # l=long listing format, t=sort by modification time (newest first), h=human readable sizes, a=print hidden files alias tree="tree -Catr --noreport --dirsfirst --filelimit 100" # C=colorization on, a=print hidden files, t=sort by modification time, r=reversed sort by time (newest first) # search current directory and subdirectories for a file containing a part of the word searched for and ignore errors like Permission denied. Reverse sort by modification time. f() { find . -iname "*$1*" -exec ls -1rt "{}" +; } 2>/dev/null # copy to clipboard clip() { xclip -sel clip -rmlastnl; } # disable terminal flow control to allow ctrl-s in vim stty -ixon EOL #============================================================================================== # add to .bash_profile, add nvim so ranger fm uses it by default #============================================================================================== cat >>"$HOME/.bash_profile" <<'EOL' export EDITOR="nvim" EOL #============================================================================================== # misc #============================================================================================== echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p touch "$HOME/Templates/empty-file" # so you can create new documents from nautilus cat < details > choose default applications network > wired > connect automatically gnome software > install 'Hide Top Bar' 'Auto Move Windows' flatpak run org.mozilla.firefox https://addons.mozilla.org/en-GB/firefox/addon/privacy-badger17/ \ https://addons.mozilla.org/en-GB/firefox/addon/ublock-origin/ \ https://addons.mozilla.org/en-US/firefox/addon/df-youtube/ \ https://addons.mozilla.org/en-US/firefox/addon/vimium-ff/ Firefox: Preferences > Network Settings > Enable DNS over HTTPS about:config network.security.esni.enabled (test with https://www.cloudflare.com/ssl/encrypted-sni/) Privacy & Security > HTTPS-Only Mode > Enable HTTPS-Only Mode in all windows Vimium: New tab URL : pages/blank.html Default search engine : https://duckduckgo.com/?q= After running Visual Studio Code, allow ban.spellright to access built in hunspell directories - sudo ln -s /usr/share/myspell "$HOME/.config/Code/Dictionaries" For VS Code in Centos 8/8.3: go to terminal type 'ibus-setup' go to Emoji tab, press the '...' next to Emoji choice to get 'select keyboard shortcut for switching' window use the delete button to delete the shortcut and leave nothing there, press OK Close If you install rust, to use 'rustup doc' in flatpak Firefox: - about:config > security.fileuri.strict_origin_policy = false - flatpak override --user --filesystem=~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc:ro org.mozilla.firefox - flatpak override --user --show org.mozilla.firefox Please reboot (or things may not work as expected) ================================================================= EOL