From 4125ff153814f5904476a9fa669e93c6a9d0c5dd Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Wed, 26 Feb 2020 22:15:46 +0300 Subject: fixes/improvements to helper script, and power management setup script --- dotfiles/.profile | 2 +- install.sh | 51 ++++++++++++++++++++++++++++++--------------------- laptop/pmsetup.sh | 11 ++++++++--- stow.sh | 3 +++ 4 files changed, 42 insertions(+), 25 deletions(-) create mode 100755 stow.sh diff --git a/dotfiles/.profile b/dotfiles/.profile index d2303ab..9424cfc 100644 --- a/dotfiles/.profile +++ b/dotfiles/.profile @@ -21,6 +21,6 @@ export ZDOTDIR="$HOME/.config/zsh" export INPUTRC="$HOME/.config/zsh/inputrc" if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then - sway + sway && clear && exit fi diff --git a/install.sh b/install.sh index e19c049..6c43abc 100755 --- a/install.sh +++ b/install.sh @@ -1,41 +1,50 @@ #!/bin/sh -# Install needed programs - -pacman -Sy --noconfirm networkmanager openvpn systemd-resolveconf neovim sway swaylock swayidle waybar egl-wayland imv swaybg xorg-server-xwayland qt5-wayland wl-clipboard dbus tmux htop bemenu mupdf mpd ncmpcpp mpc mpv mplayer mako cronie grim slop ffmpeg w3m youtube-dl youtube-viewer newsboat wget curl krita inkscape darktable gcc make fontconfig pkg-config fakeroot lxappearance papirus-icon-theme alsa-utils pulseaudio pulseaudio-bluetooth imagemagick ntfs-3g unzip unrar gnome-themes-standard gtk-engine-murrine telegram-desktop qt5ct r udisks2 perl-term-readline-gnu transmission-cli python-pynvim python-pip calcurse acpi acpid gnupg noto-fonts-cjk powerline-fonts python-pygit2 polkit polkit-gnome zathura zathura-pdf-mupdf zathura-djvu gst-libav vifm blueman bluez acpilight powertop lightdm xdg-user-dirs abook ranger +if [ -z "$1" ]; then + echo "Specify username for new user" +fi -# Install AUR helper -cd /tmp -git clone https://aur.archlinux.org/yay.git -cd yay -makepkg -si +CLONEDIR=$PWD -yay -S --noconfirm ttf-symbola stig pam-gnupg mutt-wizard-git ncmpamixer lightdm-mini-greeter plymouth-git mimeo xdg-utils-mimeo cli-visualizer +# Install some basic programs +pacman -Sy --noconfirm base-devel zsh man networkmanager openvpn neovim sway swaylock swayidle waybar egl-wayland imv swaybg xorg-server-xwayland termite kitty qt5-wayland wl-clipboard dbus tmux htop bemenu mupdf mpd ncmpcpp mpc mpv mplayer libnotify mako cronie rsync grim slop ffmpeg w3m youtube-dl youtube-viewer newsboat wget curl krita inkscape darktable gcc make fontconfig pkg-config fakeroot papirus-icon-theme alsa-utils pulseaudio pulseaudio-bluetooth imagemagick ntfs-3g unzip unrar gnome-themes-standard gtk-engine-murrine telegram-desktop qt5ct r udisks2 perl-term-readline-gnu transmission-cli python-pynvim python-pip calcurse acpi acpid gnupg noto-fonts-cjk powerline-fonts python-pygit2 polkit polkit-gnome zathura zathura-pdf-mupdf zathura-djvu gst-libav vifm blueman bluez acpilight powertop accountsservice lightdm xdg-user-dirs abook ranger terminus-font qutebrowser jq stow # Copy system config files cp system/sudoers /etc/ cp system/resolv.conf /etc/ cp system/NetworkManager/NetworkManager.conf /etc/NetworkManager/NetworkManager.conf cp system/mkinitcpio.conf /etc/ -cp -r system/loader/ /boot/loader/ -cp -r system/lightdm/ /etc/lightdm/ cp systemd/hotspot.service /etc/systemd/system/ cp systemd/startupsound.service /etc/systemd/system/ -cp system/plymouth/bgrt.plymouth /usr/share/plymouth/themes/bgrt/bgrt.plymouth cp system/pam.d/* /etc/pam.d/ cp system/systemd/journald.conf /etc/systemd/journald.conf -plymouth-set-default-theme -R bgrt +systemctl enable lightdm +systemctl enable NetworkManager +systemctl start NetworkManager + +# Create non-root user with superuser privileges +useradd -G wheel network video storage optical disk audio -s /bin/zsh "$1" +passwd "$1" + +# Install AUR helper +cd /tmp +mkdir build +chown -R "$1:$1" build +cd build +sudo -u "$1" "git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si" + +yay -S --noconfirm ttf-symbola stig pam-gnupg mutt-wizard-git ncpamixer lightdm-mini-greeter plymouth-git mimeo xdg-utils-mimeo cli-visualizer + +cd "$CLONEDIR" + +# System customization (graphical loader, DM) +cp -r system/loader/ /boot/loader/ +cp -r system/lightdm/ /etc/lightdm/ +cp system/plymouth/bgrt.plymouth /usr/share/plymouth/themes/bgrt/bgrt.plymouth # Copy some fonts to make them available system-wide mkdir -p /usr/share/fonts/rice cp system/fonts/* /usr/share/fonts/rice/ -# Laptop -if [ "$1" = "laptop" ]; then - pacman -S --noconfirm xf86-video-intel -fi - -systemctl enable lightdm -systemctl enable NetworkManager -systemctl start NetworkManager +plymouth-set-default-theme -R bgrt diff --git a/laptop/pmsetup.sh b/laptop/pmsetup.sh index be75384..01b2e23 100755 --- a/laptop/pmsetup.sh +++ b/laptop/pmsetup.sh @@ -3,8 +3,9 @@ cp powertune /bin/powertune cp powertune.service /etc/systemd/system/ -cp 90-backlight.rules /etc/udev/rules.conf.d/ +cp 90-backlight.rules /etc/udev/rules.d/ sudo systemctl start powertune +sudo systemctl enable powertune # Disable everything from being able to wake up the computer except for the lid for x in $(find /sys -name wakeup) ; do if [ "$(cat $x)" == "enabled" ]; then echo 'disabled' >> $x; fi; done @@ -12,5 +13,9 @@ echo LID | tee /proc/acpi/wakeup # lid cp logind.conf /etc/systemd/ -cp lidbutton /etc/acpi/events/ -cp lidbutton.sh /etc/acpi/actions/ +mkdir -p /etc/acpi/events +mkdir -p /etc/acpi/actions +cp lid-button /etc/acpi/events/ +cp lid-button.sh /etc/acpi/actions/ +sudo systemctl start acpid +sudo systemctl enable acpid diff --git a/stow.sh b/stow.sh new file mode 100755 index 0000000..6ff4c5c --- /dev/null +++ b/stow.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +stow -t ~ --no-folding -v dotfiles -- cgit v1.2.3