- Shell 66%
- Lua 34%
| bmks.sh | ||
| khal_reminder.sh | ||
| mako_volume.sh | ||
| omnibar.sh | ||
| README.md | ||
| rofi-pass-README.md | ||
| rofi-pass.sh | ||
| tasks.lua | ||
My scripts in self-service
omnibar: a menu to launch them all
This script uses rofi to automatically run a command based on the text thrown at it.
It also serves as a panel bar.
Features:
- type a command and it if the input text belongs to /bin or /usr/local/bin
- type space to autocomplete a command and execute it
- type : to convert a number in international or US units
- type ?<search_terms> to launch a search in your web browser
- open url in your web browser if the input text include a dot
- search the input text with your search engine (if all the above failed)
- this script also reconnects my vpn to a random US location if no instance of my web browser is running
Features (panel bar):
- show date/time
- time in 12H format
- date: abbreviated weekday, day of month. No month, because you know it :)
- show free disk space
- free space on / (in Go)
- free space on /home (in Go)
- show free memory (in %)
- show wifi network
- signal strength (in %)
- access point name
- show vpn status (disconnected or location). Requires expressvpn
- show battery info
- level (in %)
- remaining time or time to full charge
- status (through icon)
- show the volume (in % or "mute")
Requirements:
- rofi
- a web browser and your preferred search engine. Here I'm using LibreWolf and startpage. You can adjust the values on lines 82, 177, and 250.
Note:
- part of this script also handle my vpn connection automatically expressvpn. Remove the vpntog function on line 88 if you don't use it.
bmks: manage your bookmarks with rofi and bmm
This script lets you open, add, edit, and delete your bookmarks. No more needs to import/export your bookmarks across your web browsers or when switching to a new one.
This approach also allows to list bookmark with a tag, and search bookmarks by keywords in the url, title, or tags which is more complete and handy than integrated bookmarks managers.
Features:
- type keywords to filter bookmarks
- type bma- to add a bookmark. You'll need to have its url ready to be pasted
- type bmd- to delete a bookmark
- type bme- to edit a bookmark
Requirements:
- rofi
- bmm
- a terminal. I use a multiplexer (tmux) but you can adjust it to your preferred terminal if you prefer
- a web browser. Here I'm using LibreWolf
mako_volume: use mako as a volume indicator
This script uses mako to display the volume level.
Features:
- show a volume level notification (with a progress bar)
Requirements:
khal_reminder: add reminders to khal
This script is using khal and vdirsyncer to update your calendar and notifies you about any upcoming event occuring in the next hour.
Change "calendar" on page 8 to synchronize your calendar. Add as many lines as your number or calendars.
Requirements:
To run the script periodically, add a crontab rule.
rofi-pass.sh
This script is to be used with rofi. It will list all websites for which you have a password managed by pass and will call the totp token for the selected website thanks to totp-cli if it exists. Matching between your gpg files and the website in your web browser if made by comparing the gpg title and the web browser tab title.
You can also copy your username, password, or totp token and automatically paste it in the active window when selected. It can also take care of the entire login process for you if you prefer. By pressing Enter, it will automatically fill the username and password fields and show you the totp token if it exists and wait for you to select it when the website is ready to accept it.
Note that the script manages the 2 most common username/password fields formatting encountered online:
- the username and password fields are on two different pages,
- the 2 fields are on the same page. By default, the script expects to see the username and password fields on the same page. If a website is offering the other formatting option, you can tell the script to act accordingly by adding "Tab" on line 4 of your password file.
Note 1: The autocompletion works with LibreWolf, Firefox, and Brave by default. If you're web browser is missing, you can add it on all lines where the other browsers are mentioned.
Note 2: I use niri as my compositor. You'll see commands in this script to switch to my workspaces. Adjust if necessary.
Note 3: More info on how to setup your gpg, initiate pass, and use totp-cli can be found in the rofi-pass-README file on this repository.
Features:
- call the script to autocomplete the fields in your web browser. If not automatically recognized, type keywords to filter gpg files
- type pwl to copy/paste the url of a gpg file
- type pwp to copy/paste the password of a gpg file
- type pwr to remove a gpg file
- type pwu to copy/paste the username of a gpg file
- type pwt to copy/paste the token of a gpg file
Requirements:
- in its current state, the script is looking for info stored in ~/.password-store/Pwd but you can change that to fit specific needs.
- rofi
- pass
- gpg
- ydotool to simulate keypress
- totp-cli if you want to manage/access your totp tokens. totp-cli is a simple command line application to generate OTP tokens for two factor authentication using RFC6238. totp-cli fetches your shared key from pass
- wl-clipboard
- cliphist
- fd. If you prefer to use another find tool, chnage the command on line 16
tasks.lua
This neovim script lets you interact with Taskwarrior directly form neovim. All details can be found on my blog.
Features:
- type #TW some text and use the default keybinding
<leader>tato create a task with some text as description, and add a task annotation in the form of “+line filepath” so you can easily access this task’s line from Taskwarrior The script will recognize the #TW pattern and ask for a project name, start and due date, and tags for this task. By default, the due date is set to start+1h to fit my specific needs, but you can change that by editing line 90 All these fields are optional. The task will be added to Taskwarrior, and the task UUID will be appended to the line which will be commented - Using the default
<leader>tdkeybinding will delete the current line if it has a valid task UUID and remove the task in Taskwarrior. In the background, it will also add task’ annotations to all tasks below the current line - You can revert the last delete action with the default
<leader>tukeybinding. Again, note that this calls the task undo action from Taskwarrior and will revert any previous action every time you use it, so ❗use it with caution ❗ - With the default
<leader>tikeybinding, you can call a notification window that will show you a summary of the task info. - With the default
<leader>tckeybinding, you can mark a task as completed
Requirements: