Skip to content

Instantly share code, notes, and snippets.

@acosonic
Last active October 12, 2023 10:33
Show Gist options
  • Save acosonic/17c75d8a110dab17cf126e35860c6015 to your computer and use it in GitHub Desktop.
Save acosonic/17c75d8a110dab17cf126e35860c6015 to your computer and use it in GitHub Desktop.
Ubuntu decrapifier
#!/bin/bash
#this script is intended to decrapify your Ubuntu, stuff like turn off unattended upgrades...
echo 'some of this should be done as root'
echo 'Fix keyboard shortcuts'
gsettings set org.gnome.desktop.input-sources xkb-options [] #remove left ctrl shift
gsettings set org.gnome.mutter overlay-key 'Super_L'
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ new-tab '<Control><Shift>t'
echo 'Reduce high gnome-shell CPU usage, this as user setting: also try wayland...'
gsettings set org.gnome.desktop.interface clock-show-seconds false
echo 'making alias scl for systemctl'
ln -s /usr/bin/systemctl /usr/bin/scl
echo 'turning off unattended upgrades'
sudo sed -i 's/"1"/"0"/g' /etc/apt/apt.conf.d/20auto-upgrades
apt remove update-notifier
echo 'Increasing swap size to 8GB'
swapoff -a
dd if=/dev/zero of=/swapfile bs=1G count=8
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile
echo 'Fixing chrome not ignoring SSL errors'
sed -i 's/google-chrome-stable/google-chrome-stable --ignore-cerfiticate-errors/g' /usr/share/applications/google-chrome.desktop
echo 'Unlimited bash console history'
#https://stackoverflow.com/questions/9457233/unlimited-bash-history
echo 'stopping your eyes from bleeding by changing default Midnight Commander theme'
wget -P $HOME/.local/share/mc/skins/ https://raw.githubusercontent.com/wang95/mc-skins/master/skins/yadt256.ini
sed -i 's/skin=.*/skin=yadt256/g' $HOME/.config/mc/ini
echo 'Increse the number of damn open files so Chrome doesn't crash on Password manager...'
echo 'DefaultLimitNOFILE=65535' >> /etc/systemd/user.conf
sh -c 'sysctl fs.inotify.max_user_watches=524288 && sysctl -p'
echo 'To make sudo work without password use this'
echo 'echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USER'
echo 'making damn scrollbars wider'
cat << 'EOF' | tee ~/.config/gtk-3.0/gtk.css
/* Adding the buttons on the edges (if you don't need them, skip the next 4 lines)
*/
.scrollbar {
-GtkScrollbar-has-backward-stepper: 1;
-GtkScrollbar-has-forward-stepper: 1;
}
/* Scrollbar trough squeezes when cursor hovers over it. Disabling that
*/
.scrollbar.vertical:hover:dir(ltr),
.scrollbar.vertical.dragging:dir(ltr) {
margin-left: 0px;
}
.scrollbar.vertical:hover:dir(rtl),
.scrollbar.vertical.dragging:dir(rtl) {
margin-right: 0px;
}
.scrollbar.horizontal:hover,
.scrollbar.horizontal.dragging,
.scrollbar.horizontal.slider:hover,
.scrollbar.horizontal.slider.dragging {
margin-top: 0px;
}
/* Slider widens to fill the scrollbar when cursor hovers over it. Making it permanent
*/
.scrollbar.slider.vertical:dir(ltr):not(:hover):not(.dragging) {
margin-left: 0px;
}
.scrollbar.slider.vertical:dir(rtl):not(:hover):not(.dragging) {
margin-right: 0px;
}
.scrollbar.slider.horizontal:not(:hover):not(.dragging) {
margin-top: 0px;
}
.scrollbar {
-GtkRange-slider-width: 10;
}
.scrollbar.vertical slider,
scrollbar.vertical slider {
min-height: 150px;
min-width: 30px;
}
.scrollbar.horizontal.slider,
scrollbar.horizontal slider {
min-width: 30px;
min-height: 10px;
}
.scrollbar.vertical.slider:hover,
scrollbar.vertical:hover slider {
min-width: 30px;
}
.scrollbar.horizontal.slider:hover,
scrollbar.horizontal:hover slider {
min-height: 10px;
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment