Skip to content

tocic/scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scripts

GitHub release license

Collection of useful bash scripts for Linux.

echo "sleep 100" > test.sh && chmod +x test.sh
detach ./test.sh && display_process_info "slee"
create_tarball "test.tar.gz" ./test.sh && extract_tarball "test.tar.gz" .
translate_selection --help && update_aur -h
check_laptop_mode
backup_home --version && backup_packages -V
browse_processes_and_threads

Installation

Each script is versioned separately and is released into the public domain, so you can install only the ones you need. You can just copy-paste a script or several scripts from the GitHub UI or use any of the following commands.

Alternatively, you can download all the scripts at once on the Releases page.

Tip
Since git allows storing regular files only with 755 or 644 permissions, all the scripts are stored with 755 permissions, so you don’t have to chmod +x manually. But you might consider changing the script’s permissions and/or UID/GID if, for example, you want to remove the ability to execute the script by all users of the system.

Additionally, all dependencies of the executable script must be installed. You can find them in the script file directly or via the script common/list_script_dependencies.

list_script_dependencies [--optional] SCRIPT_FILE_PATH
Note
Dependency package names are taken from the Arch Linux official repositories. You can search for the names here to find the equivalent for your package manager. Most likely, the files from coreutils and util-linux are already installed on your system.

Also, for ease of access, it’s recommended to add the script’s directory path to the PATH variable or place the script itself into /usr/local/bin, for instance.

Usage

Each script has a --help option that will show you a description of the script and its arguments. Also, for convenience, descriptions of all the scripts are given below.

Click to see the descriptions
Script Category Description

backup_home

common

Backup the home directory to the borg archive.

browse_processes_and_threads

common

Browse processes and threads.

change_keyboard_backlight

common

Increase/decrease keyboard backlight.

create_tarball

common

Create an optionally compressed tar archive.

detach

common

Run the command detached from the terminal.

display_process_info

common

Display info about the process.

extract_tarball

common

Extract files from an optionally compressed tar archive.

generate_ssh_keys

common

Generate an SSH key pair.

list_script_dependencies

common

List dependencies of the script.

check_battery

laptop

Display the battery information.

check_laptop_mode

laptop

Check if the laptop is plugged into AC power.

toggle_touchpad

laptop, X11

Turn off/on the touchpad.

clean_aur

AUR, pacman

Clean git repositories of AUR packages.

rebuild_aur

AUR, pacman

Rebuild and reinstall AUR packages.

update_aur

AUR, pacman

Update and install AUR packages.

backup_packages

pacman

Backup the names of installed packages.

browse_packages

pacman

Browse installed packages along with info about them.

list_modified_backup_files

pacman

List backup files that were modified.

list_orphan_packages

pacman

List dependency packages that are no longer required by any installed package.

list_packages_by_date

pacman

List packages sorted by installation date.

list_packages_by_size

pacman

List packages sorted by installation size.

translate_selection

X11

Translate the selected text into the specified language.

turn_off_monitor

X11

Turn off the monitor.

Contribution

Feel free to post bug reports, questions, and feature requests at https://github.com/tocic/scripts/issues. PRs are also welcome, but try to stick to the Google-based code style established in the existing scripts.