|
1 | 1 | # Rofi based scripts
|
2 | 2 |
|
3 |
| - |
4 | 3 | ## i3_switch_workspace.sh
|
5 | 4 |
|
6 | 5 | ### Usage
|
7 | 6 |
|
8 | 7 | ```bash
|
9 | 8 | ./i3_switch_workspace.sh
|
10 | 9 | ```
|
| 10 | + |
11 | 11 | ### Screenshot
|
12 | 12 |
|
13 | 13 | 
|
|
19 | 19 | ```bash
|
20 | 20 | ./monitor_layout.sh
|
21 | 21 | ```
|
| 22 | + |
22 | 23 | ### Screenshot
|
23 | 24 |
|
24 | 25 | 
|
|
27 | 28 |
|
28 | 29 | Tries to generate colors from current Gtk+-3.0 theme.
|
29 | 30 | Based on code in Mate-HUD.
|
| 31 | + |
| 32 | +### Screenshot |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +## zathist.sh |
| 37 | + |
| 38 | +A shell script to fuzzy find (and open) from `rofi` (or `dmenu`) a PDF file in the history of the zathura viewer. |
| 39 | + |
| 40 | +### Installation |
| 41 | + |
| 42 | +To use this script most conveniently: |
| 43 | + |
| 44 | +1. Save this script, say to `~/bin/zathist.sh` by |
| 45 | + |
| 46 | + ```sh |
| 47 | + mkdir --parents ~/bin && |
| 48 | + curl -fLo https://raw.githubusercontent.com/Konfekt/zathist.sh/master/zathist.sh ~/bin/zathist.sh |
| 49 | + ``` |
| 50 | + |
| 51 | +1. mark it executable by `chmod a+x ~/bin/zathist.sh`, |
| 52 | + |
| 53 | +To launch `zathist.sh` by a global keyboard shortcut, say pressing at the same time the `Microsoft Windows` key and `Z`: |
| 54 | + |
| 55 | +1. install, say, `Xbindkeys` (or `Sxhkd`), (for example, on `openSUSE` by `sudo zypper install xbindkeys` respectively `sudo zypper install sxhkd`) |
| 56 | +1. add to `~/.xbindkeysrc` a shortcut that launches `zathist.sh`, say |
| 57 | + |
| 58 | + ```sh |
| 59 | + "$HOME/bin/zathist.sh" |
| 60 | + Mod4 + z |
| 61 | + ``` |
| 62 | + |
| 63 | +1. start `xbindkeys`. |
| 64 | + |
| 65 | +To start `xbindkeys` automatically at login, say on a `KDE` desktop environment, put a file `xbindkeys.sh` reading |
| 66 | + |
| 67 | +```sh |
| 68 | +#! /bin/sh |
| 69 | +xbindkeys |
| 70 | +``` |
| 71 | + |
| 72 | +into `~/.config/autostart-scripts/`. |
| 73 | + |
| 74 | +### Configuration |
| 75 | + |
| 76 | +PDFs whose path matches the pattern given by the variable |
| 77 | + |
| 78 | +```sh |
| 79 | + IGNORE_REGEX="^${TMPDIR:-/tmp}/\|_cropped\.pdf$" |
| 80 | +``` |
| 81 | + |
| 82 | +will not be listed. |
| 83 | + |
| 84 | +`zathist.sh` uses rofi in dmenu mode. |
| 85 | +Replace at will by dmenu itself and change its command line arguments by the variables |
| 86 | + |
| 87 | +```sh |
| 88 | +MENU_ENGINE=-rofi |
| 89 | +MENU_ARGS="-dmenu -i -keep-right" |
| 90 | +``` |
| 91 | + |
| 92 | +To customize the prompt and theme, adapt the variables |
| 93 | + |
| 94 | +``` |
| 95 | +THEME=' |
| 96 | +element{ horizontal-align: 0; } |
| 97 | +listview { |
| 98 | + dynamic: true; |
| 99 | + padding: 0px 0px 0px ; |
| 100 | +}' |
| 101 | +PROMPT='❯ ' |
| 102 | +``` |
| 103 | +
|
| 104 | +### Credits |
| 105 | +
|
| 106 | +This shell script refines shell code posted on [stackexchange](https://unix.stackexchange.com/questions/467524/open-file-from-history-in-zathura). |
0 commit comments