From e2e6b84ace23a1ca7fedb68e89625a56c7c04bb1 Mon Sep 17 00:00:00 2001 From: Kyle K Date: Fri, 31 Jan 2020 20:49:13 -0600 Subject: work on install.sh and postinstall.sh scripts --- ToDo.txt | 1 + gentoox_build.sh | 37 ++++++--- install.sh | 93 ++++++++++++++++++++++ postinstall.sh | 233 +++++++++++++++++++++++++++++++++++++++++++++++++------ 4 files changed, 329 insertions(+), 35 deletions(-) create mode 100755 install.sh diff --git a/ToDo.txt b/ToDo.txt index 6cb4203..ca56351 100644 --- a/ToDo.txt +++ b/ToDo.txt @@ -17,6 +17,7 @@ for (i=0;i /etc/portage/package.use/gentoox +sys-apps/xdg-desktop-portal screencast +dev-vcs/git tk' > /etc/portage/package.use/gentoox rm -rf /etc/portage/package.accept_keywords/ echo -n > /etc/portage/package.accept_keywords @@ -284,7 +286,7 @@ sed -i '1s/^/NTHREADS="12"\n/' /etc/portage/make.conf echo -e '\nkde-plasma/plasma-meta discover networkmanager thunderbolt kde-apps/kio-extras samba' >> /etc/portage/package.use/gentoox -emerge -v --jobs=4 --keep-going=y --autounmask=y --autounmask-write=y --deep --newuse kde-plasma/plasma-meta kde-apps/kde-apps-meta kde-apps/kmail latte-dock calamares gparted plasma-sdk gdb dos2unix qt-creator firefox mpv app-misc/screen +emerge -v --jobs=4 --keep-going=y --autounmask=y --autounmask-write=y --deep --newuse kde-plasma/plasma-meta kde-apps/kde-apps-meta kde-apps/kmail latte-dock calamares gparted plasma-sdk gdb dos2unix qt-creator firefox mpv app-misc/screen audacious-plugins audacious net-irc/hexchat yes | layman -o https://raw.githubusercontent.com/fosero/flatpak-overlay/master/repositories.xml -f -a flatpak-overlay -q emerge -v sys-apps/flatpak @@ -350,10 +352,24 @@ exit 0 fi +if [[ ! -z $build_extra ]] && [[ ! -f 'tmp/gentoox-extra-done' ]]; then +cat <> /etc/portage/package.use/gentoox +emerge -v gimp avidemux blender # libreoffice +touch /tmp/gentoox-extra-done +HEREDOC +exit 0 +fi + + if [[ ! -z $configure_user ]] && [[ ! -f 'tmp/gentoox-user-configured' ]]; then -cp ../../postinstall.sh . -cp ../../1518039301698.png . -cp '../../GentooX Breeze Dark Transparent.tar.gz' . +cp ../../install.sh usr/src/ +cp ../../postinstall.sh usr/src/ +mkdir usr/src/theme +cp ../../1518039301698.png usr/src/theme/ +cp '../../GentooX Breeze Dark Transparent.tar.gz' usr/src/theme/ cat < .xinitrc +echo '~/postinstall.sh &' >> .xinitrc +echo 'exec dbus-launch --exit-with-session startplasma-x11' >> .xinitrc chown -R $username /home/$username/ su - gentoox -flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo -kpackagetool5 -i "GentooX Breeze Dark Transparent.tar.gz" touch /tmp/gentoox-user-configured HEREDOC @@ -457,6 +471,7 @@ fi if [[ ! -z $build_iso ]]; then cat <&2 + exit 1 +fi + +# post install +# +# adjust nproc in make.conf + +# setup /etc/fstab + +#plymouth-set-default-theme fade-in +# adjust /etc/default/grub +# splash quiet + +#rc-update add zfs-import boot +#rc-update add zfs-mount boot + + +sensors-detect --auto +rc-update add lm_sensors default + +# grub-install +# grub-mkconfig -o /boot/grub/grub.cfg + + + +setup_btrfs () { + DEVICE=$1 + + mkfs.btrfs -f -L GENTOO /dev/$DEVICE + mkdir /mnt/install + mount /dev/$DEVICE /mnt/install + + btrfs subvolume create /mnt/install/@ + btrfs subvolume create /mnt/install/@/.snapshots + mkdir /mnt/install/@/.snapshots/1 + btrfs subvolume create /mnt/install/@/.snapshots/1/snapshot + mkdir -p /mnt/install/@/boot/grub2/ + btrfs subvolume create /mnt/install/@/boot/grub/i386-pc + btrfs subvolume create /mnt/install/@/boot/grub/x86_64-efi + btrfs subvolume create /mnt/install/@/home + btrfs subvolume create /mnt/install/@/opt + btrfs subvolume create /mnt/install/@/root + btrfs subvolume create /mnt/install/@/srv + btrfs subvolume create /mnt/install/@/tmp + mkdir /mnt/install/@/usr/ + btrfs subvolume create /mnt/install/@/usr/local + btrfs subvolume create /mnt/install/@/var + + chattr +C /mnt/install/@/var + + echo " + + single + 1 + $(date) + first root filesystem + " > /mnt/install/@/.snapshots/1/info.xml + + btrfs subvolume set-default $(btrfs subvolume list /mnt/install | grep "@/.snapshots/1/snapshot" | grep -oP '(?<=ID )[0-9]+') /mnt/install + umount /mnt/install + mount /dev/$DEVICE /mnt/install + + # ls /mnt/install should respond with empty result + + mkdir /mnt/install/.snapshots + mkdir -p /mnt/install/boot/grub/i386-pc + mkdir -p /mnt/install/boot/grub/x86_64-efi + mkdir /mnt/install/home + mkdir /mnt/install/opt + mkdir /mnt/install/root + mkdir /mnt/install/srv + mkdir /mnt/install/tmp + mkdir -p /mnt/install/usr/local + mkdir /mnt/install/var + + mount /dev/$DEVICE /mnt/install/.snapshots -o subvol=@/.snapshots + mount /dev/$DEVICE /mnt/install/boot/grub/i386-pc -o subvol=@/boot/grub/i386-pc + mount /dev/$DEVICE /mnt/install/boot/grub/x86_64-efi -o subvol=@/boot/grub/x86_64-efi + mount /dev/$DEVICE /mnt/install/home -o subvol=@/home + mount /dev/$DEVICE /mnt/install/opt -o subvol=@/opt + mount /dev/$DEVICE /mnt/install/root -o subvol=@/root + mount /dev/$DEVICE /mnt/install/srv -o subvol=@/srv + mount /dev/$DEVICE /mnt/install/tmp -o subvol=@/tmp + mount /dev/$DEVICE /mnt/install/usr/local -o subvol=@/usr/local + mount /dev/$DEVICE /mnt/install/var -o subvol=@/var + + umount -l /mnt/install/boot/efi /mnt/install/var /mnt/install/usr/local /mnt/install/tmp /mnt/install/srv /mnt/install/root /mnt/install/opt /mnt/install/home \ + /mnt/install/boot/grub/x86_64-efi /mnt/install/boot/grub/i386-pc /mnt/install/.snapshots /mnt/install +} + diff --git a/postinstall.sh b/postinstall.sh index 2169e08..451e2d9 100755 --- a/postinstall.sh +++ b/postinstall.sh @@ -1,37 +1,222 @@ #!/bin/bash -if [ $(id -u) != "0" ]; then - echo "This script must be run as root" 1>&2 - exit 1 -fi -# post install -# -# adjust nproc in make.conf -# setup /etc/fstab +# allow Xorg to start and kde to settle +sleep 20 -#plymouth-set-default-theme fade-in -# adjust /etc/default/grub -# splash quiet -#rc-update add zfs-import boot -#rc-update add zfs-mount boot +ln -s /usr/share/applications/audacious.desktop ~/Desktop/ +ln -s /usr/share/applications/mpv.desktop ~/Desktop/ +ln -s /usr/share/applications/steam.desktop ~/Desktop/ +flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo -rc-update add dbus default -rc-update add dhcpcd default -rc-update add avahi-daemon default +# set wallpaper +dbus-send --session --dest=org.kde.plasmashell --type=method_call /PlasmaShell org.kde.PlasmaShell.evaluateScript 'string: +var Desktops = desktops(); +for (i=0;i> ~/.config/gtk-3.0/settings.ini + + +kwriteconfig5 --file ~/.config/kdeglobals --group General --key XftHintStyle --type string hintslight +kwriteconfig5 --file ~/.config/kdeglobals --group General --key XftSubPixel --type string rgb +kwriteconfig5 --file ~/.config/kdeglobals --group General --key fixed --type string "Hack,9,-1,5,50,0,0,0,0,0,Regular" +kwriteconfig5 --file ~/.config/kdeglobals --group General --key font --type string "Noto Sans,9,-1,5,50,0,0,0,0,0,Regular" +kwriteconfig5 --file ~/.config/kdeglobals --group General --key menuFont --type string "Noto Sans,9,-1,5,50,0,0,0,0,0,Regular" +kwriteconfig5 --file ~/.config/kdeglobals --group General --key smallestReadableFont --type string "Noto Sans,9,-1,5,50,0,0,0,0,0,Regular" +kwriteconfig5 --file ~/.config/kdeglobals --group General --key toolBarFont --type string "Noto Sans,9,-1,5,50,0,0,0,0,0,Regular" +kwriteconfig5 --file ~/.config/kdeglobals --group WM --key activeFont --type string "Noto Sans,9,-1,5,50,0,0,0,0,0,Regular" + +kwriteconfig5 --file ~/.config/kglobalshortcutsrc --group kwin --key FlipSwitchAll --type string "none,none,Toggle Flip Switch (All desktops)" +kwriteconfig5 --file ~/.config/kglobalshortcutsrc --group kwin --key lipSwitchCurrent --type string "none,none,Toggle Flip Switch (Current desktop)" + +kwriteconfig5 --file ~/.config/kmixrc --group Global --key AutoStart --type bool true + +echo '[Common] +ShadowStrength=89 + +[Style] +MenuOpacity=70 + +[Windeco] +TitleAlignment=AlignLeft' > ~/.config/breezerc + +echo '[Style] +MenuOpacity=70' > ~/.kde4/share/config/breezerc + + +kwriteconfig5 --file ~/.config/plasma-org.kde.plasma.desktop-appletsrc --group Containments --group 3 --group Applets --group 20 --key immutability --type string 1 +kwriteconfig5 --file ~/.config/plasma-org.kde.plasma.desktop-appletsrc --group Containments --group 3 --group Applets --group 20 --key plugin --type string "org.kde.plasma.panelspacer" +#ToDo.....need to finish, see git diff HEAD~1 + +#qdbus org.kde.KWin /KWin reconfigure +killall plasmashell; kstart5 plasmashell + + +mkdir -p ~/.config/autostart +ln -s /usr/share/applications/org.kde.latte-dock.desktop ~/.config/autostart/ +latte-dock & +kwriteconfig5 --file ~/.config/latte/Default.layout.latte --group Containments --group 1 --group General --key iconSize --type string 48 +kwriteconfig5 --file ~/.config/latte/Default.layout.latte --group Containments --group 1 --group General --key panelTransparency --type string 30 +pkill latte-dock +latte-dock & + + +# gtk2 +echo 'gtk-primary-button-warps-slider=0 +gtk-cursor-theme-name="breeze_cursors" +gtk-font-name="Noto Sans Regular 9" +gtk-theme-name="Breeze-Dark" +gtk-icon-theme-name="la-capitaine-icon-theme" +gtk-fallback-icon-theme="breeze" +gtk-toolbar-style=GTK_TOOLBAR_ICONS +gtk-menu-images=1 +gtk-button-images=1 +gtk-modules=appmenu-gtk-module' > ~/.gtkrc-2.0 + +# kwinrc +echo '[$Version] +update_info=kwin.upd:replace-scalein-with-scale,kwin.upd:port-minimizeanimation-effect-to-js,kwin.upd:port-scale-effect-to-js,kwin.upd:port-dimscreen-effect-to-js,kwin.upd:auto-bordersize + +[Compositing] +OpenGLIsUnsafe=false + +[Desktops] +Id_1=b6fcd628-81dd-40e4-b879-d260a6a2506e +Number=1 +Rows=1 + +[Effect-CoverSwitch] +TabBox=false +TabBoxAlternative=false + +[Effect-Cube] +BorderActivate=9 +BorderActivateCylinder=9 +BorderActivateSphere=9 + +[Effect-DesktopGrid] +BorderActivate=9 + +[Effect-FlipSwitch] +TabBox=true +TabBoxAlternative=false + +[Effect-PresentWindows] +BorderActivate=9 +BorderActivateAll=3 +BorderActivateClass=9 + +[Effect-kwin4_effect_translucency] +Menus=90 + +[ElectricBorders] +Bottom=None +BottomLeft=None +BottomRight=None +Left=None +Right=None +Top=None +TopLeft=None +TopRight=None + +[Plugins] +flipswitchEnabled=true +highlightwindowEnabled=true +kwin4_effect_squashEnabled=false +magiclampEnabled=true + +[TabBox] +ActivitiesMode=1 +ApplicationsMode=0 +BorderActivate=9 +BorderAlternativeActivate=9 +DesktopLayout=org.kde.breeze.desktop +DesktopListLayout=org.kde.breeze.desktop +DesktopMode=1 +HighlightWindows=true +LayoutName=thumbnails +MinimizedMode=0 +MultiScreenMode=0 +ShowDesktopMode=0 +ShowTabBox=true +SwitchingMode=0 + +[TabBoxAlternative] +ActivitiesMode=1 +ApplicationsMode=0 +DesktopMode=1 +HighlightWindows=true +LayoutName=org.kde.breeze.desktop +MinimizedMode=0 +MultiScreenMode=0 +ShowDesktopMode=0 +ShowTabBox=true +SwitchingMode=0 + +[Windows] +ElectricBorderCooldown=350 +ElectricBorderCornerRatio=0.25 +ElectricBorderDelay=150 +ElectricBorderMaximize=true +ElectricBorderTiling=true +ElectricBorders=0 + +[org.kde.kdecoration2] +BorderSize=Normal +BorderSizeAuto=true +ButtonsOnLeft=XAIH +ButtonsOnRight=S +CloseOnDoubleClickOnMenu=false +ShowToolTips=true +library=org.kde.sierrabreeze +theme=Sierra Breeze' > ~/.config/kwinrc + + +# after script runs delete it +sed -i "s/~\/postinstall.sh &//" ~/.xinitrc +rm -- "$0" + + +media-gfx/gimp heif jpeg2k openexr python vector-icons webp wmf xpm -- cgit v1.2.3