My scripts for startup, dmenu, and the command line
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # Macros
  2. This is a collection of scripts I use to make managing files and processes easier.
  3. 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.
  4. ### Installing dependencies
  5. `sudo apt install pass enscript dunst xclip scrot mpc mpd ghostscript zathura
  6. suckless-tools youtube-dl`
  7. All of them are optional except suckless-tools. Many of the features aren't
  8. interdependent and are made up of 1 or 2 functions.
  9. - [ dmenu ](http://tools.suckless.org/dmenu/) is for the prompts. It can be
  10. changed to rofi or some other solution
  11. - scrot and xclip for screenshots
  12. - all scripts assume your prefered terminal is [ st ](http://st.suckless.org)
  13. - mpc is for media controls
  14. - zathura, ghostscript, and enscript are an aesthetic option for viewing man
  15. pages and command outputs as document files rather than terminal output
  16. ## prompt
  17. The central script that gives the rest of the features interactivity. Read
  18. the source code for more details.
  19. ### Usage
  20. prompt [ COMMAND ]
  21. #### COMMANDS
  22. * launch
  23. * action
  24. * cmd
  25. * cmd_clip
  26. * search
  27. * username
  28. * password
  29. * other_password
  30. * edit_password
  31. * open
  32. * edit
  33. most functionality is accessible from launch and action only
  34. ### Notes
  35. - Picking a directory opens st at it's location
  36. - Set bindings for `prompt action` and `prompt launch`
  37. - Some prompts like `search package` will infer with their default operation
  38. when the string entered is an invalid selection
  39. - the password functions assume that logins for the same services are all
  40. stored in the same file, with each account's information seperated by an
  41. empty line. Each line containing a username begins with 'username:', each
  42. line containing a password is the first line of it's section.
  43. ## mru
  44. Used for storing file paths and their modification times in ~/.cache/mru/.
  45. When a file is opened with prompt open, it moves to the top of the home list.
  46. I wrote it because locate was too limiting.
  47. mru [COMMAND] [CACHE]
  48. #### COMMMAND
  49. - init
  50. - update
  51. - updatedirs
  52. - output
  53. - list
  54. - insert [ FILE ]
  55. ### Get Started
  56. `mru init; mru update; mru updatedirs`
  57. #### Notes
  58. - by default, it ignores hidden directories
  59. - If no cache name is specified, it assumes 'home'
  60. - more cache paths can be added by editing the cache_info variable in the
  61. source code. For fast load times you may want to seperate different tasks or
  62. types of files into their own cache, i.e projects, videos, config files.
  63. - If if the file passed to `mru insert` does not exist, it is removed from the cache
  64. - You may want to run mru update at startup to add new files and cleanup hidden
  65. files in .cache/mru
  66. - You don't need to install jump, zsh, or some other hack to switch directories
  67. quickly. Use this alias:
  68. `alias cdz='cd $((mru listdirs | fzf --height=50%) || printf ".")'`
  69. ### Initializing
  70. mru init
  71. ## pages
  72. pages is a command for viewing /tmp/pages-{number} files with st or zathura.
  73. The files are the result of prompt commands like `prompt search` -> Go page or
  74. can be created from your own scripts. I use it for viewing local documentation
  75. quickly.
  76. ### Usage
  77. pages [ pager | pdf | browser | send ] [ NAME ]
  78. send will send stdin to the named page with the naming convention
  79. /tmp/pages-{NAME}. All other commands attempt to open the named page if it
  80. exists.
  81. #### Notes
  82. * Page names don't have to be numbers, here is an example vim Ex mode command I
  83. use to convert a markdown file to html and open it in a browser:
  84. `:!markdown % | pages send 1.html | pages browser 1.html`
  85. This could be given it's own keybinding.
  86. #### TODO
  87. - Finish vpn and networking stuff after ini script is finished, then make sure
  88. - variables to the script to make assumed paths easier to change
  89. - emoji select to clipboard
  90. - use attach-session -t . -c /dir for selecting multiplexer directory
  91. - ddg fill options should be taken from bookmarks or history
  92. - Make password prompts green
  93. - Figure out range selecting for parsing passwords
  94. - Figure out using dmenu instead of gnome key prompt (pinentry)
  95. what?- Consider entr in dwm-start for watching files
  96. - change xdg text/plain opener to use vim and st if not in terminal
  97. - unicode character insertion
  98. change prompt icon to nerd icon
  99. - finish dwm patching, select window with wmctrl, then setup vpn, then maybe dmenu patches
  100. ## Searching the web
  101. The prompt's rawurlencode function makes it easy to create new search functions for any website or service. Append the output of a call to rawurlencode to the site's search prefix, then pass the resulting string to an application like lynx or brave-browser. No need for installing packages or directories of config files.
  102. Example:
  103. ```firefox "html.duckduckgo.com/html?q=$(rawurlencode "$1")"```