1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
[general]
default_module = "app" # The module to run when no prefix is matched
empty_module = "a" # run with an empty prompt
exec_cmd = "sh -c" # The exec command of your shell, default to sh
# for example: "bach -c" for bash; "zsh -c" for zsh. This can also runs wm exec commands, like hyprctl dispatch exec
vi_mode = true # set true to use vi keybinds, false to use emacs keybinds; default to emacs
esc_to_abort = true # allow to quit with esc keypress; a useful option for vi users
cheatsheet_entry = "?" # when entered, otter-launcher will show a list of configured modules
cheatsheet_viewer = "less -R; clear" # the program that otter-launcher will pipe cheatsheet into
clear_screen_after_execution = false # useful when chafa image flash back after module execution
loop_mode = false # in loop mode, otter-launcher won't quit after running a module, useful when using scratchpad
external_editor = "" # if set, pressing ctrl+e (or pressing v in vi normal mode) will edit the input field in the specified program; default to no external editor
#callback = "" # if set, otter-launcher will run the command after a module is executed; for example, it can call swaymsg to adjust window size
# ASCII color codes are allowed with these options. However, \x1b should be replaced with \u001B (unicode escape) because the rust toml crate cannot read \x as an escaped character...
[interface]
# use three quotes to write longer commands
header = """
\u001B[34;1m >\u001B[0m $USER@$(echo $HOSTNAME) \u001B[31m\u001B[0m $(cat /proc/loadavg | cut -d ' ' -f 1) \u001B[33m\u001B[0m $(free -h | awk 'FNR == 2 {print $3}' | sed 's/i//')
\u001B[34;1m>\u001B[0;1m """
# Run a shell command and make the stdout printed above the header
header_cmd = ""
header_cmd_trimmed_lines = 0 # Remove a number of lines from header_cmd output, in case of some programs printing excessive empty lines at the end of its output
header_concatenate = false # print header and header_cmd output at the same line, default to false
list_prefix = " "
selection_prefix = " \u001B[31;1m> "
place_holder = "type and search"
default_module_message = " \u001B[33msearch\u001B[0m the internet" # if set, the text will be shown when the default module is in use
empty_module_message = "" # the text to show when empty module is in use
suggestion_mode = "list" # available options: list, hint
suggestion_lines = 12 # length of the suggestion list, set to 0 to disable suggestions and tab completion
indicator_with_arg_module = "\u001B[31m^\u001B[0m " # a sign showing whether the module should run with an argument
indicator_no_arg_module = "\u001B[31m$\u001B[0m "
prefix_padding = 3 # format prefixes to have a uniformed width; prefixes will be padded with spaces to have a least specified number of chars
# below color options affect all modules; per-module coloring is allowed by using ascii color codes at each module's configurations
prefix_color = "\u001B[33m"
description_color = "\u001B[39m"
place_holder_color = "\u001B[30m"
hint_color = "\u001B[30m" # the color of hint mode suggestions
# move the whole interface rightward or upward, easier for styling with chafa image
move_right = 0
move_up = 0
[[modules]]
description = "search with brave"
prefix = "br"
cmd = "setsid -f xdg-open 'https://search.brave.com/search?q={}'"
with_argument = true
url_encode = true
[[modules]]
description = "kill a runing app"
prefix = "k"
cmd = 'ps -u "$USER" -o comm= | sort -u | fsel --dmenu | xargs -r pkill -9'
with_argument = true
url_encode = true
[[modules]]
description = "launch apps with fsel"
prefix = "a"
cmd = "fsel --filter-desktop=no -vv -r -d -ss \"{}\""
with_argument = true
[[modules]]
description = "launch apps instantly"
prefix = "app"
cmd = "fsel -vv -r -d -p {}"
with_argument = true
[[modules]]
description = "manage clipboard with fsel"
prefix = "cl"
cmd = """
fsel --cclip
"""
[[modules]]
description = "find pkgs"
prefix = "pm"
cmd = "pmux -SD {}"
with_argument = true
[[modules]]
description = "install pkgs"
prefix = "i"
cmd = "pmux -S {}"
with_argument = true
[[modules]]
description = "power menu with fzf"
prefix = "p"
cmd = """
function power {
if [[ -n $1 ]]; then
case $1 in
"logout") session=`loginctl session-status | head -n 1 | awk '{print $1}'`; loginctl terminate-session $session ;;
"suspend") loginctl suspend ;;
"hibernate") loginctl hibernate ;;
"reboot") loginctl reboot ;;
"shutdown") loginctl poweroff ;;
esac fi }
power $(echo -e 'reboot\nshutdown\nlogout\nsuspend\nhibernate' | fzf --reverse --no-scrollbar --padding 1,3 --prompt 'Power Menu: ' | tail -1)
"""
[[modules]]
description = "run command in terminal"
prefix = "s"
cmd = """
setsid -f "$(echo $TERM | sed 's/xterm-//g')" -e {}
"""
with_argument = true
[[modules]]
description = "search archwiki"
prefix = "w"
cmd = "setsid -f xdg-open https://wiki.archlinux.org/index.php?search='{}'"
with_argument = true
url_encode = true
[[modules]]
description = "cambridge dictionary"
prefix = "dc"
cmd = "setsid -f xdg-open 'https://dictionary.cambridge.org/dictionary/english/{}'"
with_argument = true
url_encode = true
|