Git.Cschad: scripts

[sh] Shell scripts that I use to automate tasks or to make things easier

menu-web (bookmark links / add / delete)

I use this script all the time! I like to have the URL bookmarks independent from the browser I use. I have three keybindings for it: To open a url / add & delete a url

This script uses dmenu as a fuzzy finder but you can change that easily!

Features

Variables to change

SEARCH_ENGINE="https://searx.be/search?q="
URLS_FILE="$HOME/doc/files/urls"

# For Xorg use xclip
COPY="wl-copy -n"
PASTE="$(wl-paste -n)"

NOTIFY="dunstify"

# you can replace this with dmenu/rofi/bemenu etc
MENU="fuzzel -d -I"
BROWSER=librewolf

The urls should look like this:

piped@=https://piped.video/results?search_query=
searx@=https://searx.be/search?q=
github@=https://github.com/search?q=
Hyprland|Wiki=https://wiki.hyprland.org/
Python|Operators=https://python-reference.readthedocs.io/en/latest/docs/operators/index.html
wb=https://cschad.com
openbsd=https://www.openbsd.org/

I usually organize them this way (Works so nicely with fuzzy search):

Sitename|Category

Installation

This script needs dmenu or other fuzzy finder you can pipe data into.

for Arch linux

sudo pacman -S dmenu dunst wl-clipboard
curl https://git.cschad.com/scripts/raw/menu-web > menu-web
chmod +x menu-web

Usage

## You'll be asked if you want to copy, remove or add a url
menu-web

## List your saved urls
menu-web -l

ytb

Ytb is a very simple script to download videos

You have to have yt-dlp installed a clipboard manager (wl-clipboard, xclip) etc!

Run it a select the download option! That's all :)

Installation

sudo pacman -S yt-dlp # wl-clipboard
curl https://git.cschad.com/scripts/raw/ytb > dmenu-web
chmod +x ytb
# run with ./ytb
# Copy it to your path

compiler

A shell script that executes files with different extensions. Works great with standalone files.

I also have a nvim remap for it:

vim.keymap.set("n", "<leader>c", ":w! | !compiler '<c-r>%'<CR>")

menu-wifi

Shell script that uses nmcli (command line tool for controlling NetworkManager) to manage your wifi

Only depend on Networkmanager and a fuzzy finder of your choice!

You can always change this to whatever you like!

# dmenu / rofi / bmenu etc
MENU="fuzzel -d"

sb

Script to upload files, shorten and archieve URLs using curl

Instance hosted on https://sb.ma

Note YOU can:

  • always use the site to upload or paste content directly (without curl)
  • use this script for other instances of 0x0.st too! (just remove the invite code -Fcode=${INVITE_TOKEN})
  • get an invitation code by sending me an email at hello at sb.ma