new-machine-setup 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/bash
  2. # script to customize some annoyances away when migrating to a new machine
  3. # i like to run apt manually and see what's being upgraded, so i don't want my desktop bothering me about it
  4. # silence gnome update notifications
  5. echo "Turning off Gnome OS Update prompt.."
  6. gsettings set org.gnome.software download-updates false
  7. gsettings set org.gnome.software allow-updates false
  8. # i also don't want gnome software running at startup; on-demand only!
  9. echo "Disabling Gnome Software startup..."
  10. cp /etc/xdg/autostart/gnome-software-service.desktop ~/.config/autostart
  11. echo "X-GNOME-Autostart-enabled=false" >> ~/.config/autostart/gnome-software-service.desktop
  12. echo "Fix gedit annoyances..."
  13. # gedit should be a plain notepad, no line numbers or highlights!
  14. gsettings set org.gnome.gedit.preferences.editor display-line-numbers false
  15. # line highlighting looks like garbage on dark themes
  16. gsettings set org.gnome.gedit.preferences.editor highlight-current-line false
  17. # turn off screenshot delay default
  18. gsettings set org.gnome.gnome-screenshot delay 0
  19. # i do not like the overlay scrollbar in tilix
  20. gsettings set com.gexperts.Tilix.Settings use-overlay-scrollbar false
  21. # plank dock preferences
  22. echo "Setting Plank dock preferences..."
  23. gsettings set net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock1/ hide-mode 'dodge-maximized'
  24. gsettings set net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock1/ theme 'Transparent'
  25. gsettings set net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock1/ zoom-enabled true
  26. # plank dock duplicator from: https://gist.github.com/notanimposter/952ec7aefad1825ee9a30cbbbc4a6453
  27. newdock="dock2"
  28. plank -n "$newdock" &
  29. kill $!
  30. # get the non-primary monitor
  31. monitor=$(xrandr | grep " connected" | awk '$3 !="primary" { print $1 }')
  32. echo "Using $monitor as monitor for $newdock"
  33. gsettings reset-recursively net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock2/
  34. for key in $(gsettings list-keys net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock1/);
  35. do
  36. val=$(gsettings get net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock1/ "$key")
  37. gsettings set net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock2/ "$key" "$val"
  38. done
  39. gsettings set net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock2/ monitor "$monitor"
  40. # symlink dock1 to dock2
  41. mkdir -p "$HOME"/.config/plank/dock2/
  42. rm -rf "$HOME"/.config/plank/dock2/launchers
  43. ln -s "$HOME"/.config/plank/dock1/launchers "$HOME"/.config/plank/dock2/launchers
  44. # enable dock 2
  45. current=$(gsettings get net.launchpad.plank enabled-docks)
  46. append=$(echo "$current" | sed "s@dock1@dock1','dock2@g")
  47. gsettings set net.launchpad.plank enabled-docks "$append"
  48. killall plank