This is a small collection of scripts that I made to automate some annoying/tedious tasks, I hope you find them handy like I do.
A Bash installation script that is designed to set up a new Ubuntu-based environment with essential packages and personal configurations. It also ensures that the user's shell is set to Bash, downloads custom aliases to the .bashrc file and downloads an emacs config file.
- Changes shell to Bash
- Updates system packages
- Installs essential applications
- Adds aliases to .bashrc file
- Downloads emacs configuration files from this repo
To run the script, you need to follow these steps:
- Clone the repository using git, or download the script directly.
- Make the script executable by running the command
chmod +x post-install. - Run the script with the command
./post-install.
You can also use the -v or --verbose option for verbose output: ./install.sh -v.
The script performs the following actions:
- Checks if the shell is Bash, if not, attempts to change the shell to Bash.
- Updates the system's package list using
apt-get updateand upgrades the installed packages. - Installs the
apt-utilsandsoftware-properties-commonpackages if they're not already installed. - Installs several essential apps, including
curl,git,gcc,make,wget,emacs,python3,python3-pip,htop,openssh-client,rsync, andnetcat. - Checks if a
.bashrcfile exists, and creates a blank.bashrcfile if it doesn't. - Appends commands to the
.bashrcfile to source the.bash_aliasesfile if it exists. - Downloads the
.bash_aliasesfile from a GitHub repository usingcurl. - Sources the
.bashrcfile so that the aliases take effect immediately. - Downloads an Emacs config file from a GitHub repository using
curl. - Cleans up by fixing broken dependencies, removing unnecessary packages, and cleaning up the local repository of retrieved package files.
- If the script fails due to permission issues, you might need to run the script with
sudoi.e.,sudo ./install.sh. - The verbose mode can provide more detailed output, which can help in troubleshooting issues.
A bash script that downloads and applies an Emacs theme found on the internet. The script assumes the .el file is named after the theme name.
The script takes the URL of a .el file as a parameter. For example, if you want to download and apply a theme named awesome-theme.el from https://example.com/themes/awesome-theme.el, you would run the script like this:
./set-emacs-theme.sh https://example.com/themes/awesome-theme.elTo run the script, you need to follow these steps:
- Clone the repository using git, or download the script directly.
- Make the script executable by running the command
chmod +x set-emacs-theme. - Run the script with the command
./set-emacs-theme.
The script performs the following actions:
- Checks if a URL is provided.
- Extracts the filename from the URL.
- Changes directory to
~/.emacs.d/themes, creating it if it doesn't exist. - Downloads the theme using
wget. - Appends to
init.elor.emacsto use the theme, after checking if they exist. If none of these files exist, a newinit.elis created with the theme configuration.
- The script uses
wgetto download files, so you must havewgetinstalled on your system to use it. - The script assumes that you're running a Unix-like system with a shell that's compatible with Bash.
- The script assumes that the
.emacs.ddirectory is located in your home directory.
Contributions are always welcome. Please submit a pull request if you would like to suggest improvements.
Some of this project, including the majority of the README was generated and/or rewritten, in part, by chatGPT.