Skip to content

Script to load config files and install my commonly used software on ArchLinux based distributions

License

Notifications You must be signed in to change notification settings

Bharath-5/Minimal

Repository files navigation

Minimal

Introduction

This script installs some software that I often use and copies my config files to appropriate directories in Arch Linux The .asoundrc file is to set the default audio card.

Screenshots

https://github.com/Bharath-5/Minimal/blob/master/Screenshot_dwm.png?raw=true

https://github.com/Bharath-5/Minimal/blob/master/Screenshot_qtile.jpg?raw=true

https://github.com/Bharath-5/Minimal/blob/master/Screenshot_EXWM.png?raw=true

Installation

Clone this repository, go to the cloned directory

git clone https://github.com/Bharath-5/Minimal; cd Minimal;

Change the file permissions of the script, run the script and follow along its directions

chmod 755 ./Minimal.sh; ./Minimal.sh 

Usage

Default modifier key is [Super]. [S] below represents [Super] key Most of the programs are mapped to [Super] + Function keys. The applications open up in their own workspaces as follows:

Most other keybindings are as close to their defaults. Emacs uses evil keybindings

Workspace NumberDescriptionKeybindings
1Browser/WWW[S] + F1 = Qutebrowser
2File Manager[S] + F2 = PCManFM
3Terminal/Code[S] + [Shift] + [Enter] = URxvt
4Office Programs/Notes[S] + F4 = LibreOffice [OTile]
5General/VM[S] + p = dmenu
6Email/Vid[S] + F6 = Thunderbird [Qile]; mpv opens here [DWM]
7Social[S] + F7 = Telegram-desktop [QTile]
8Other/Dw[S] + F3 = Lynx browser [QTile]; Transmission opens here [DWM]

Code

#!/bin/bash
echo "Welcome! This script installs the necessary packages and copies the configuration files to the appropriate directories. To quit this program, press [Ctrl] + C anytime"

Initially, the script asks if .ascoundrc should be deleted. This is to change the default audio device. If it shouldn’t be changed, click ‘y’ to delete the file If it isn’t deleted, it will be copied to the home directory

echo "Should .asoundrc be deleted? (y or n)"
read a
if [ $a == "y" ]
then
   rm ./.asoundrc
   echo ".asoundrc deleted"
else
   cp ./.asoundrc ~
   echo ".asoundrc is copied to your home directory"
fi

The username is asked for the rest of the steps to copy the configuration files, provided full path

echo "Enter username"
read n

The following gives an option between DWM, QTile, EXWM and Gnome

  • If DWM is selected
    • DWM will be cloned and installed to /usr/src/dwm
    • The default “config.def.h” will remain untouched
    • A simple script to display some system info in DWM tray will be copied into Documents/Scripts folder. This can later made to run on start of XSession from .xinitrc
echo "Press 1 for DWM, 2 for QTile, 3 for EXWM and 4 for Gnome"
read option
if [[ $option -lt 4 ]]
then
  echo "Additional packages will be installed"
  sudo pacman -S alsa-utils brightnessctl celluloid dmenu lxappearance gparted neofetch pulseaudio pcmanfm python-psutil qutebrowser ranger scrot ttf-font-awesome ttf-fira-code scrot rxvt-unicode vimiv w3m wget youtube-dl
fi
if [[ $option -eq 1 ]]
then

  sudo git clone git://git.suckless.org/dwm /usr/src
  s=$(pwd)
  sudo cp ./dwm/config.h /usr/src/dwm/
  cd /usr/src/dwm
  sudo make clean install
  cd $s
  mkdir /home/$n/Documents
  mkdir /home/$n/Documents/Sripts/
  cp ./dwm/statusbar.sh /home/$n/Documents/Scripts/
  chmod +x /home/$n/Documents/Scripts/statusbar.sh
  • If QTile is selected
    • QTile will be installed by pacman
    • Its config files wil be copied, creating directories accordingly
   
   elif [[ $option -eq 2 ]]
   then
    sudo pacman -S qtile python-psutil
    echo "Copying Qtile config files"
    FILE=/home/$n/.config/qtile/
    if [ -f "$FILE" ]; then
	mkdir /home/$n/.config/qtile/backup/
	mv -r /home/$n/.config/qtile/* /home/$n/.config/qtile/backup/
	cp -r ./qtile/* /home/$n/.config/qtile/
    else  
	mkdir /home/$n/.config/qtile/
	cp -r ./qtile/* /home/$n/.config/qtile/
    fi
  • If EXWM is selected, Emacs willbe installed with EXWM and some other packages
    • The configuration fill will be in “.emacs.d” folder in the home directory
 elif [[ $option -eq 3 ]]
 then
     sudo pacman -S emacs gcc
     mkdir /home/$n/.emacs.d/
     cp ./Emacs/init.el /home/$n/.emacs.d/
     echo "Does an xsession file need to be created?"
     read xse
     if [[ $xse -eq 'y' ]]
     then
	sed -i "s/bharath/$n/" ./Emacs/exwm.desktop
	mv ./Emacs/exwm.desktop /home/$n/.emacs.d/
	mv ./Emacs/start-exwm.sh /home/$n/.emacs.d/
	chmod +x /home/$n/.emacs.d/start-exwm.sh
       sudo ln -f /home/$n/.emacs.d/exwm.desktop /usr/share/xsessions/exwm.desktop
     fi
  • If Gnome is selected, you may have to manually choose static workspaces in gnome tweaks and install “Auto Move Windows” extension
 elif [[ $option -eq 4 ]]
 then
     echo "Should gnome be installed?"
     read ginstall
     if [[ $ginstall -eq "y" ]]
     then
	sudo pacman -S gnome
	echo "The gdm service will now be enabled and started"
	sudo systemctl enable gdm.service
	sudo systemctl start gdm.service
     fi
     sudo pacman -S dconf-editor gnome-tweaks gnome-shell-extensions
     echo "The keybinding file will now be loaded"
     dconf load '/org/gnome/desktop/wm/keybindings/' < './Gnome/wm-keybindings.dconf.bak'
 fi

The Xrsources file is based on Manjaro’s i3 version, although several changes have been made. For more terminal styles, this may be a good resource.

 echo "Copying .Xresources file"
   FILE=/home/$n/.Xresources
   if [ -f "$FILE" ]; then
	mv /home/$n/.Xresources /home/$n/.Xresources-backup
	cp ./.Xresources /home/$n/
   else   
	cp ./.Xresources /home/$n/
   fi

Paru is an AUR helper, like Yay. It is required to install some additional theming

echo "Do you want to install paru? (y or n)"
read a
if [ $a == "y" ]
then
   cd /opt
   sudo git clone https://aur.archlinux.org/paru.git
   sudo chown -R $n:$n ./paru
   cd paru
   makepkg -si
fi 

Additional themes are installed and can be selected by LXAppearance.

echo "Do you want to install Flat Remix GTK and Paper Icon Theme from the AUR? (y or n)"
read a
if [ $a == "y" ]
then
   paru -S flat-remix-gtk paper-icon-theme-git
fi
echo "Everything is set to go"
if [[ $option -eq 3 ]]
then
echo "Once you open Emacs, please run M-x all-the-icons-install-fonts during the first run"
fi

About

Script to load config files and install my commonly used software on ArchLinux based distributions

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published