My scripts for startup, dmenu, and the command line
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
= 88b328bcb1 Add games prompt 3年前
.gitignore Create utility functions for managing backups 4年前
README.md Add text2pdf and music prompts 3年前
backup :q 4年前
bar.sh :q 4年前
dwm-start Add games prompt 3年前
dwm-statusbar Add chooser and update readme 3年前
edit-ini Added INI editor 3年前
ewrap Handle xdg-open defaults more sensibly and remove junk files 3年前
lsix :q 4年前
mru Handle xdg-open defaults more sensibly and remove junk files 3年前
music_player Handle xdg-open defaults more sensibly and remove junk files 3年前
pages Add mru code and reformat readme 3年前
pinentry Finish mru insert and init 3年前
prompt Add games prompt 3年前
setup-xbindkeys Make app launchers 3年前
store Move definitions to searching and use delete instead of substitute 3年前
t2p.c Add text2pdf and music prompts 3年前
textopener Handle xdg-open defaults more sensibly and remove junk files 3年前
util Handle xdg-open defaults more sensibly and remove junk files 3年前
vpn Handle xdg-open defaults more sensibly and remove junk files 3年前

README.md

Macros

This is a collection of scripts I use to make managing files and processes easier. Use it to automagically select and run terminal applications, send signals to daemons, execute arbitrary commands, search the web, grab passwords from a password manager, and more.

Installing dependencies

sudo apt install pass enscript dunst xclip scrot mpc mpd ghostscript zathura suckless-tools youtube-dl

All of them are optional except suckless-tools. Many of the features aren’t interdependent and are made up of 1 or 2 functions.

  • dmenu is for the prompts. It can be changed to rofi or some other solution
  • scrot and xclip for screenshots
  • all scripts assume your prefered terminal is st
  • mpc is for media controls
  • zathura, ghostscript, and enscript are an aesthetic option for viewing man pages and command outputs as document files rather than terminal output

prompt

The central script that gives the rest of the features interactivity. Read the source code for more details.

Usage

prompt [ COMMAND ]

COMMANDS

  • launch
  • action
  • cmd
  • cmd_clip
  • search
  • username
  • password
  • other_password
  • edit_password
  • open
  • edit

most functionality is accessible from launch and action only

Notes

  • Picking a directory opens st at it’s location
  • Set bindings for prompt action and prompt launch
  • Some prompts like search package will infer with their default operation when the string entered is an invalid selection
  • the password functions assume that logins for the same services are all stored in the same file, with each account’s information seperated by an empty line. Each line containing a username begins with ‘username:', each line containing a password is the first line of it’s section.

mru

Used for storing file paths and their modification times in ~/.cache/mru/. When a file is opened with prompt open, it moves to the top of the home list. I wrote it because locate was too limiting.

mru [COMMAND] [CACHE]

COMMMAND

  • init
  • update
  • updatedirs
  • output
  • list
  • insert [ FILE ]

Get Started

`mru init; mru update; mru updatedirs`

Notes

  • by default, it ignores hidden directories
  • If no cache name is specified, it assumes ‘home’
  • more cache paths can be added by editing the cache_info variable in the source code. For fast load times you may want to seperate different tasks or types of files into their own cache, i.e projects, videos, config files.
  • If if the file passed to mru insert does not exist, it is removed from the cache
  • You may want to run mru update at startup to add new files and cleanup hidden files in .cache/mru
  • You don’t need to install jump, zsh, or some other hack to switch directories quickly. Use this alias: alias cdz='cd $((mru listdirs | fzf --height=50%) || printf ".")'

Initializing

mru init

pages

pages is a command for viewing /tmp/pages-{number} files with st or zathura. The files are the result of prompt commands like prompt search -> Go page or can be created from your own scripts. I use it for viewing local documentation quickly.

Usage

pages [ pager | pdf | browser | send ] [ NAME ]

send will send stdin to the named page with the naming convention /tmp/pages-{NAME}. All other commands attempt to open the named page if it exists.

Notes

  • Page names don’t have to be numbers, here is an example vim Ex mode command I use to convert a markdown file to html and open it in a browser: :!markdown % | pages send 1.html | pages browser 1.html This could be given it’s own keybinding.

TODO

  • Finish vpn and networking stuff after ini script is finished, then make sure
  • variables to the script to make assumed paths easier to change
  • emoji select to clipboard
  • use attach-session -t . -c /dir for selecting multiplexer directory
  • ddg fill options should be taken from bookmarks or history
  • Make password prompts green
  • Figure out range selecting for parsing passwords
  • Figure out using dmenu instead of gnome key prompt (pinentry) what?- Consider entr in dwm-start for watching files
  • change xdg text/plain opener to use vim and st if not in terminal
  • unicode character insertion change prompt icon to nerd icon
  • finish dwm patching, select window with wmctrl, then setup vpn, then maybe dmenu patches