Skip to content

*Well documented* shell scripts exploiting some useful UNIX utilities.

Notifications You must be signed in to change notification settings

chhajedji/scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scripts

  • Scripts to implement some basic computer (mainly linux) functionalities and a bit complex stuff using some some external programs.
  • These are more handy when using a tiling window manager. As a raw build of most of the tiling window mangers lacks most of the basic bindings like to change volume, brightness, turn on/off mic etc.

Installation

All the dependencies are listed in the requirements.txt file. They can be installed at once with your package manager. For instance, with apt, install them with command:

cat requirements.txt | xargs sudo apt install -y

How to use these?

  • Clone or download this repository.
git clone https://github.com/chhajedji/scripts.git ~/.scripts	# To clone in $HOME/.scripts
  • Append your PATH with $HOME/.scripts. Do this by adding export PATH="$PATH:$HOME/.scripts" in your shell's config file or $HOME/.profile.
echo "export PATH=\"\$PATH:\$HOME/.scripts\"" >> $HOME/.profile
  • If you use a tiling window manager then add bindings in it's config files or for others DE's like Gnome, KDE, XFCE etc, check how can you modify keyboard shortcuts and add bindings for these scripts like you would run any normal command (cd, mkdir, etc).

Most scripts are having an extension like .sh to avoid conflicts if a default command exists by that name (mostly unlikely). Also so that I know that this a script (mostly written by me) and not a command.


Description

  • Functionality

    • Display current window's title.
    • If run from a terminal, will ask user to select which window's name to get.
  • Dependency

    • None
  • Functionality

    • Put all your applications which needed to run after startup in this script. Applications like wallpaper, notification manager, clipboard manager, network manager etc.
    • Check if application is already running, if not then start it.
    • It will also select if HDMI is connected and set monitors for dual display using disp_config.sh.
    • Applications listed in Dependencies are one that I use. Most of them have a check that if they are installed.
  • Dependencies

    • parcellite: Clipboard manager.
    • compton: Compositing manager.
    • dunst: Notification manager.
    • redshift: For adjusting screen temperature.
    • picom
    • disp_config.
    • new_wall.
  • Functionality

    • Fork of i3lock-blur.
    • Takes screenshot of current screen, take another image to display on top of it and locks system with output image.
    • Sets screen timeout to a lower value when locked. After unlock, set to a higher value.

    image

  • Dependency

    • xrandr
    • ffmpeg
    • i3lock
  • Functionality

    • Change screen brightness.
  • Dependency

    • xbacklight
  • Functionality

    • Script triggered when dwm status bar is clicked.
  • Dependency

  • Functionality

    • Useful when working with big projects in C/C++.
    • Build cscope databases and tags using ctags and organise properly in $HOME/.cstags_dir/. For details see inside csb.
  • Dependency

    • ctags
    • cscope
  • Functionality

    • This script includes many functionalities which can be used with dmenu.
    • Run any executable or system application by name (Just like start menu).
    • Open any file with xdg-open.
    • Open file manager in desired directory.
    • Search for words in dictionary.
    • Search for manual pages.
    • Do a web search or go to a URL.
    • Go to git repos in your system. (This uses a file created by command find $HOME/ -regex .*/\.git$ 2>/dev/null > $HOME/.tmp/gitfiles to search for path of all git directories. I run this command while updating system Also there should be a directory ".tmp" in your $HOME directory. Check up-to-date command here in dot-files repo).
    • Turn off notifications for specified time.
    • Connect to a WiFi network present in vicinity.
    • Quit system in multiple ways like power off, restart, suspend and logout. Not that it uses some options with sudo option. So make sure to either run this with sudo or add pkill and shutdown to sudoers.
    • Kill any process owned by same user.
    • Open terminal in desired directory.
    • For more details see inside dmenu_input.sh.
    • Copy the highlighted text to a temporary clipboard and paste from it.
  • Dependency

    • fd
    • j4-dmenu-desktop (Optional, but helpful in opening direct applications.)
    • dolphin (If FILEMANAGER is not set globally).
    • firefox (If globally environmental variable BROWSER is unset).
    • dict and dictd: For command line dictionary.
    • dmenu
    • urxvt (If globally environmental variable TERMINAL is unset).
    • dunst/notify-send
    • nmcli
    • suspend_lock.sh
    • xdotool
    • notify-send
  • Functionality

    • Multiple screens setup for single, dual or duplicate screens.
    • Default is single monitor. See autostart.sh which selects what to do.
  • Dependency

    • xrandr
  • Functionality

    • Display status bar with xsetroot when using dwm.
    • Find my dwm built here.
  • Dependency

    • amixer
  • Functionality

    • Shortcut to open editor.
    • Prefered editor is emacs. If not installed then open in vi.
  • Dependency

    • emacs (optional).
    • Vi.
    • urxvt (If globally TERMINAL is not set).
  • Functionality

    • Copy a file to clipboard from terminal and paste it somewhere other than terminal with Ctrl-v.
  • Dependency

    • xclip
  • Functionality

    • Change transparency of current widow a few times to generate visual effect to show current window being used.
  • Dependency

    • compton
    • xdotool
  • Functionality

    • Add local files to github repos.
  • Dependency

    • git
  • Functionality

    • My fork of original git-open.
    • Used to open github links directly.
    • Added functionality to open my github page.
  • Dependency

    • git
  • Functionality

    • Helps to detect merge commit (to know when and why a commit was merged into a branch).
    • Original: git-when-merged.
  • Dependency

    • git
    • python
  • Functionality

    • default/ stores the default scripts when i3blocks is installed. These are same as scripts in /usr/share/i3blocks/.
    • custom/ store scripts with little modifications of i3blocks default scripts. Some modifications made which are dwmbar compatible.
  • Dependency

    • None
  • Functionality

    • Dependency for fzf.
    • Adds keybindings to change directory, reverse search and ctrl-t for completing files in current directory using fzf.
    • See https://github.com/junegunn/fzf.
  • Dependency

    • fzf
  • Functionality

    • My fork of undistract-me.
    • Used to send notifications when a long command finishes.
  • Dependency

Not working now as Ookla changed their speedtest script implementation. Needs to be updated.

  • Functionality

    • Check internet speed and save results in $HOME/.
    • First argument: Number of tests to perform. Second argument is optional to do upload speedtest also. Give anything as second argument.
    • This script will create file downspeed (and upspeed if any argument is present) and log start time, results for every iteration and average speed in it.
  • Dependency

    • speedtest-cli
  • Functionality

    • Set a new wallpaper randomly from files stored in given directory (and its sub-directories) or set given argument file as wallpaper.
    • See inside for usage.
    • Demo video: https://youtu.be/11Dqat5XS9c
  • Dependency

  • Functionality

    • Play notification sound.
  • Dependency

    • paplay
    • alert.ogg stored at $HOME/.local/share/supplemets/alert.ogg.
  • Functionality

    • Pause, resume and toggle dunst notification display. Useful when focusing on work or doing a screenshare, to avoid notifications.
  • Dependency

    • dunst/notify-send
  • Functionality

    • Compile given c program with gcc and run it. Could be helpful when running simple C programs for testing C functionalities, competitive programming etc.
    • Add this script in PATH for easy usage.
    • Just run this as o (if added in PATH) and compile and run last edited C file or give name of C file to be compiled and run.
  • Dependency

    • gcc
  • Functionality

    • Lock screen with i3lock. Set a random background present anywhere in the given path.
    • Sets screen timeout to a lower value when locked. After unlock, set to a higher value.
  • Dependency

    • pic_lock: See this.
  • Functionality

    • Locks the screen using i3lock with given input image.
    • A fork of this.
  • Dependency

    • i3lock
    • xrandr
  • Functionality

    • Sends a notification when battery goes below a certain level. This threshold level can be set inside.
  • Dependency

    • dunst/notify-send
  • Functionality

    • Checks if there is any instance of "dwmbar" running.
    • If found exactly one, then kill sleep inside it.
    • If any instance other than one (zero, two etc.) is running, kill all instances and start a new one.
  • Dependency

  • Functionality

    • Used as a test script in PATH for testing commands/program/functionality etc.
    • Not used by system anywhere.
  • Dependency

    • Variable.
  • Functionality

    • Open new terminal in same directory as of previous terminal in a more naive way.
  • Dependency

    • None
  • Functionality

    Note this is not always accurate but has some other benefits.

  • Dependency

    • None
  • Functionality

    • Toggle screenkeys.
  • Dependency

    • screenkey
  • Functionality

    • Take screenshots of area, whole screen and current window.
    • Save in given $DESTINATION and copy to clipboard.
  • Dependency

    • scrot
    • xclip
  • Functionality

    • Start python3 in $TERMINAL.
    • Mainly used for calculator.
  • Dependency

    • python3
  • Functionality

    • Lock screen and suspend to RAM.
    • Sets screen timeout to a lower value when locked. After unlock, set to a higher value.
  • Dependency

    • i3lock
  • Functionality

    • Toggle some of the hardware functions like mouse, touchscreen, touchpad.
  • Dependency

    • None
  • Functionality

    • Toggle touchpad with inbuilt keyboard button (if present).
  • Dependency

    • synclient
  • Functionality

    • Change transparency of current window using compton.
  • Dependency

    • compton
  • Functionality

    • Remove passwords from protected PDF files. Whole functionality of this script can be destroyed with pdftk (which indeed is used in this script).
  • Dependency

    • pdftk
  • Functionality

    • Script to change system volume.
    • Also controls mic mute/unmute.
  • Dependency

  • Functionality

    • Toggles WiFi connection.
  • Dependency

    • nm-applet (Generally pre-installed with NetworkManagement)

Other dependencies

Not directly used in these scripts but indirectly used by other commands.

devour Brave Browser

About

*Well documented* shell scripts exploiting some useful UNIX utilities.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published