Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -e
- if [[ $EUID -eq 0 ]]; then
- echo "This script can't be used as root" >&2
- exit 1
- fi
- echo "This script was written by Erwin Oldebesten on 30/05/2017"
- echo""
- echo "You may use, edit and share if you like to, but credit the original creator"
- echo "when you share and/or edit this script."
- echo ""
- echo "WARNING!: By no means, is the script creator liable for any damage"
- echo "this script creates, either softwarematic or otherwise."
- echo "Use it at your own risk!"
- sleep 5
- HOME="${HOME:-$(getent passwd "$(id -un)" | cut -d: -f6)}"
- XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
- sudo pacman -S git-core wmctrl --noconfirm --needed
- git clone https://aur.archlinux.org/cower.git
- git clone https://aur.archlinux.org/opensnap.git
- git clone https://aur.archlinux.org/pacaur.git
- gpg --recv-keys --keyserver hkp://pgp.mit.edu 1EB2638FF56C0C53
- cd ./cower
- makepkg -sir --noconfirm --needed
- cd ../opensnap
- makepkg -sird --noconfirm --needed
- cd ../pacaur
- makepkg -sir --noconfirm --needed
- cd ../
- rm -rf ./cower
- rm -rf ./opensnap
- rm -rf ./pacaur
- pacaur -S --noconfirm --needed --noedit lynx networkmanager network-manager-applet obconf openbox sddm transset-df ttf-dejavu wpa_actiond wireless_tools xdotool xorg-apps xorg-server xorg-xinit xterm arch-wiki-cli fetchpkg fetchmirrors htop pavucontrol libreoffice-still gimp firefox thunderbird hunspell-en hunspell-nl atril engrampa-thunar-gtk2 vlc mpv alsa-utils alsa-oss ragel cmake pulseaudio pulseaudio-alsa git kalu gufw transmission-gtk menulibre galculator-gtk2 gtk-engines cups cups-filters cups-pdf ristretto gnome-icon-theme network-manager-applet xfce4-notifyd simple-scan ntfs-3g dosfstools exfat-utils gparted brasero mintstick-git noto-fonts gxmessage zip unzip unrar p7zip thunar-volman xcompmgr pv progress thunar-archive-plugin wget gksu tumbler qt4 ffmpegthumbnailer pluma lxtask xfce4-panel xfce4-pulseaudio-plugin xfce4-terminal xfce4-whiskermenu-plugin xfconf xfdesktop numlockx xscreensaver system-config-printer
- echo "Do you want to install flash and oracle-java runtime as well?"
- echo ""
- select yn in "Yes" "No"; do
- case $yn in
- Yes ) pacaur -S flashplugin pepper-flash jre --noconfirm --needed --noedit; break;;
- No ) break;;
- esac
- done
- cat <<-EOF > "$HOME"/shutdown-manager-link.desktop
- [Desktop Entry]
- Encoding=UTF-8
- Name=Shutdown Manager Link
- Type=Link
- URL=https://goo.gl/NW5bc0
- Icon=text-html
- EOF
- chmod +x "$HOME"/shutdown-manager-link.desktop
- echo ""
- echo "The installation is finished, if you need to install oracle-java and"
- echo 'flash you can install it with "pacaur -S jre flashplugin pepper-flash "'
- echo "as a priviledged non-root user."
- echo ""
- echo "If you need a shutdown-manager you can find a simple one here:"
- echo '"https://goo.gl/NW5bc0" this link will be saved in your home folder'
- sleep 5
- echo ""
- echo "Starting basic system configuration"
- echo ""
- sleep 1
- echo "Configuring Thunar"
- echo ""
- mkdir -p "$XDG_CONFIG_HOME"/Thunar
- cat <<-EOF > "$XDG_CONFIG_HOME"/Thunar/uca.xml
- <?xml encoding="UTF-8" version="1.0"?>
- <actions>
- <action>
- <icon>utilities-terminal</icon>
- <name>Open Terminal Here</name>
- <unique-id>1496773885381426-1</unique-id>
- <command>exo-open --working-directory %f --launch TerminalEmulator</command>
- <patterns>*</patterns>
- <startup-notify/>
- <directories/>
- </action>
- <action>
- <icon></icon>
- <name>Open as root</name>
- <unique-id>1496776056149709-4</unique-id>
- <command>gksu thunar %f</command>
- <description></description>
- <patterns>*</patterns>
- <directories/>
- </action>
- </actions>
- EOF
- echo "Editting the standard programs (mimeapps)"
- echo ""
- sleep 3
- cat <<-EOF > "$XDG_CONFIG_HOME"/mimeapps.list
- [Added Associations]
- text/plain=pluma.desktop;
- application/zip=engrampa.desktop;
- application/x-ms-dos-executable=wine.desktop;
- audio/x-vorbis+ogg=vlc.desktop;mpv.desktop;
- image/jpeg=gimp.desktop;ristretto.desktop;
- image/png=gimp.desktop;ristretto.desktop;
- image/bmp=gimp.desktop;ristretto.desktop;
- video/mp4=mpv.desktop;
- application/vnd.rar=engrampa.desktop;
- application/x-java-archive=sun-java-jre8.desktop;
- video/x-matroska=mpv.desktop;
- application/x-desktop=pluma.desktop;
- application/x-compressed-tar=engrampa.desktop;
- application/x-shellscript=pluma.desktop;
- application/msword=libreoffice-writer.desktop;
- application/x-7z-compressed=engrampa.desktop;
- application/pdf=atril.desktop;
- application/xml=pluma.desktop;
- audio/mpeg=vlc.desktop;mpv.desktop;
- [Default Applications]
- application/x-ms-dos-executable=wine.desktop
- audio/x-vorbis+ogg=vlc.desktop
- image/jpeg=ristretto.desktop
- image/png=ristretto.desktop
- image/bmp=ristretto.desktop
- video/mp4=mpv.desktop
- video/x-matroska=mpv.desktop
- application/pdf=atril.desktop
- application/xml=pluma.desktop
- EOF
- sudo mkdir -p /root/.config
- sudo cp "$XDG_CONFIG_HOME"/mimeapps.list /root/.config/mimeapps.list
- function x11edit {
- echo "First, we'll determine your keyboard layout"
- echo "Type the two letters of your desired country code and press [ENTER]: "
- read -r country
- echo "Do you want to use a variant? If not, leave empty. Confirm with [ENTER] :"
- read -r variant
- echo "Are you content with this settings?"
- echo ""
- select ync in "Yes" "No" "Cancel"; do
- case $ync in
- Yes ) x11conf; break;;
- No ) x11edit break;;
- Cancel ) break;;
- esac
- done
- }
- function x11conf {
- echo "Editing 00-keyboard.conf"
- echo ""
- sudo mkdir -p /etc/X11/xorg.conf.d
- sudo tee /etc/X11/xorg.conf.d/00-keyboard.conf <<-EOF > /dev/zero
- Section "InputClass"
- Identifier "system-keyboard"
- MatchIsKeyboard "on"
- Option "XkbLayout" "$country"
- Option "XkbVariant" "$variant"
- EndSection
- EOF
- }
- echo "Do you want to modify the xorg keyboard"
- echo ""
- select yn in "Yes" "No"; do
- case $yn in
- Yes ) x11edit; break;;
- No ) break;;
- esac
- done
- echo "Enabling the cups printing service"
- echo ""
- sleep 3
- sudo systemctl enable cups-browsed.service > /dev/null 2>&1
- echo "Adding current user to the printing admin group"
- echo ""
- sleep 3
- sudo usermod "$USER" -aG sys
- echo "Configuring Keep Arch Linux Up-to-date"
- echo ""
- sleep 3
- mkdir "$XDG_CONFIG_HOME"/kalu
- cat <<-EOF > "$XDG_CONFIG_HOME"/kalu/kalu.conf
- [options]
- PacmanConf = /etc/pacman.conf
- NotificationIcon = KALU
- NotificationIconSize = 20
- Interval = 60
- Timeout = DEFAULT
- AutoChecks = NEWS UPGRADES WATCHED AUR WATCHED_AUR
- ManualChecks = NEWS UPGRADES WATCHED AUR WATCHED_AUR
- CmdLineLink = xdg-open '\$URL'
- CheckPacmanConflict = 1
- UpgradeAction = KALU
- ConfirmPostSysUpgrade = 1
- CmdLineAur = xfce4-terminal -e "pacaur -Syua"
- SyncDbsInTooltip = 1
- OnSglClick = CHECK
- OnDblClick = SYSUPGRADE
- OnMdlClick = LAST_NOTIFS
- OnSglClickPaused = SAME_AS_ACTIVE
- OnDblClickPaused = SAME_AS_ACTIVE
- OnMdlClickPaused = SAME_AS_ACTIVE
- [template-upgrades]
- TitleSce = DEFAULT
- PackageSce = DEFAULT
- SepSce = DEFAULT
- [template-watched]
- TitleSce = DEFAULT
- PackageSce = FALLBACK
- SepSce = FALLBACK
- [template-aur]
- TitleSce = DEFAULT
- PackageSce = DEFAULT
- SepSce = FALLBACK
- [template-aur-not-found]
- TitleSce = DEFAULT
- PackageSce = DEFAULT
- SepSce = FALLBACK
- [template-watched-aur]
- TitleSce = DEFAULT
- PackageSce = FALLBACK
- SepSce = FALLBACK
- [template-news]
- TitleSce = DEFAULT
- PackageSce = DEFAULT
- SepSce = FALLBACK
- EOF
- echo "Adding current user to the Keep Arch Linux Up-to-date group"
- echo ""
- sleep 3
- sudo usermod "$USER" -aG kalu
- echo "Editing openbox autostart configuration"
- echo ""
- sleep 3
- mkdir -p "$XDG_CONFIG_HOME"/autostart
- mkdir -p "$XDG_CONFIG_HOME"/openbox
- cat <<-EOF > "$XDG_CONFIG_HOME"/openbox/autostart
- #
- # These things are run when an Openbox X Session is started.
- # You may place a similar script in $HOME/.config/openbox/autostart
- # to run user-specific things.
- #
- # If you want to use GNOME config tools...
- #
- #if test -x /usr/lib/openbox/gnome-settings-daemon >/dev/null; then
- # /usr/lib/openbox/gnome-settings-daemon &
- #elif which gnome-settings-daemon >/dev/null 2>&1; then
- # gnome-settings-daemon &
- #fi
- # If you want to use XFCE config tools...
- #
- #xfce-mcs-manager &
- nm-applet &
- thunar --daemon &
- xfce4-panel &
- xfdesktop &
- xcompmgr &
- opensnap &
- xscreensaver -no-splash &
- # VBoxClient-all &
- kalu &
- numlockx &
- EOF
- function copyconf {
- echo "Remeber to add the new users to the Keep Arch Linux"
- echo "Up-to-date group"
- echo ""
- sleep 3
- sudo cp -r "$XDG_CONFIG_HOME" /etc/skel/
- sudo find /etc/skel/.config -type d -exec chmod 755 {} \;
- sudo find /etc/skel/.config -type f -exec chmod 644 {} \;
- }
- echo "Do you want to use the current autostart, mimeapps and Keep Arch Linux"
- echo "Up-to-date config for all new users (recommend)?"
- echo ""
- select yn in "Yes" "No"; do
- case $yn in
- Yes ) copyconf; break;;
- No ) break;;
- esac
- done
- cat <<-EOF > /tmp/systctl
- #!/bin/bash
- echo "Creating 99-systctl"
- echo ""
- touch /etc/sysctl.d/99-sysctl.conf
- echo "Changing swappiness to 1..."
- echo ""
- sleep 3
- echo "vm.swappiness=1" >> /etc/sysctl.d/99-sysctl.conf
- echo "Changing vfs cache pressure to 50..."
- echo ""
- sleep 3
- echo "vm.vfs_cache_pressure=50" >> /etc/sysctl.d/99-sysctl.conf
- echo "Changing dirty background bytes to 16777216..."
- echo ""
- sleep 3
- echo "vm.dirty_background_bytes=16777216" >> /etc/sysctl.d/99-sysctl.conf
- echo "Changing dirty bytes to 50331648..."
- echo ""
- sleep 3
- echo "vm.dirty_bytes=50331648" >> /etc/sysctl.d/99-sysctl.conf
- EOF
- chmod +x /tmp/systctl
- sudo /tmp/systctl
- echo "Enabling sddm Network Manager and ufw"
- systemctl enable NetworkManager sddm ufw > /dev/null 2>&1
- echo "Basic system configuration is complete, though a reboot is needed."
- echo "If you are running a VirtualBox Client, please uncomment"
- echo "'VBoxClient-all' & in $XDG_CONFIG_HOME/openbox/autostart"
- echo "and/or /etc/skel/.config/openbox/autostart before you reboot"
- echo "your system."
- echo ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement