I created this repository to share useful shell scripts that solve common Linux problems. Instead of searching for solutions every time, I keep all my scripts in one place.
Works in every Linux distro!
Fixes built-in laptop keyboard not working after sleep/wake
When you close your laptop lid or put it to sleep, the built-in keyboard sometimes stops working after waking up.
Why this happens:
- When laptop goes to sleep, the system unloads the keyboard driver to save power
- When waking up, the driver (i8042) sometimes fails to reinitialize properly
- The keyboard remains unresponsive even though the system is awake
Symptoms:
- Built-in keyboard doesn't type anything
- External USB keyboard still works
- Touchpad still works
- Only the keyboard is affected
chmod +x keyboard-reset.shsudo ./keyboard-reset.shYou don't have to run this every time! Just run this and this problem will be gone. If not, run it again.
Complete system update script for Debian-based systems
What it does:
- Updates package lists
- Upgrades all installed packages
- Removes unnecessary packages
- Cleans the package cache
Why use this? Instead of typing 4 separate commands every time, just run one script!
chmod +x up.sh./up.shInteractive compilation and execution script for multi-language projects
Works in every Linux distro!
What it does:
- Prompts for directory location, file name, language, and compiler
- Supports Java, C, C++, and Python with sensible default compilers
- Handles automatic compilation and execution in a single step
- Validates directory paths and file existence to prevent runtime errors
Why use this? Instead of manually switching directories, compiling files, and executing binaries with separate commands, just run one script!
- Terminal: Run
pwdto print and copy your current directory path. - Nautilus (GNOME): Press
Ctrl + Lto highlight the address bar, thenCtrl + Cto copy the path. - Dolphin (KDE Plasma): Press
Ctrl + Lto copy the address bar path, or right-click a folder and select Copy Location (Ctrl + Alt + C).
chmod +x run.sh./run.shA Bash script snippet that displays your active Git branch in your terminal prompt.
It will work on distros where Bash is the default shell (Ubuntu, Kubuntu, Arch, Fedora, Debian, Linux Mint, Manjaro, openSUSE, etc.).
- Automatically detects if your directory is a Git repository.
- Shows the current branch name in bold yellow text next to your path.
- Colors your user/hostname (bold green) and path (bold blue).
Why use this?
Instantly see which branch you are on without typing git status.
nano ~/.bashrci. Paste it at the end (Press Ctrl + Shift + V)
ii. Press Ctrl+S
iii. Press Ctrl+X
source ~/.bashrc