···11+# ██████╗ ████████╗████████╗███████╗██████╗
22+# ██╔═══██╗╚══██╔══╝╚══██╔══╝██╔════╝██╔══██╗
33+# ██║ ██║ ██║ ██║ █████╗ ██████╔╝█████╗
44+# ██║ ██║ ██║ ██║ ██╔══╝ ██╔══██╗╚════╝
55+# ╚██████╔╝ ██║ ██║ ███████╗██║ ██║
66+# ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
77+# ██╗ █████╗ ██╗ ██╗███╗ ██╗ ██████╗██╗ ██╗███████╗██████╗
88+# ██║ ██╔══██╗██║ ██║████╗ ██║██╔════╝██║ ██║██╔════╝██╔══██╗
99+# ██║ ███████║██║ ██║██╔██╗ ██║██║ ███████║█████╗ ██████╔╝
1010+# ██║ ██╔══██║██║ ██║██║╚██╗██║██║ ██╔══██║██╔══╝ ██╔══██╗
1111+# ███████╗██║ ██║╚██████╔╝██║ ╚████║╚██████╗██║ ██║███████╗██║ ██║
1212+# ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
1313+1414+# Terminal shell script launcher, written in rust
1515+# Source Code: https://github.com/kuokuo123/otter-launcher
1616+1717+# Recommended to be used in companion with sway-launcher-desktop to launch desktop applications
1818+# https://github.com/Biont/sway-launcher-desktop
1919+2020+2121+[general]
2222+default_module = "gg" # module to run when no prefix is matched
2323+empty_module = "app" # run with an empty prompt
2424+exec_cmd = "sh -c" # exec command of your shell
2525+# for example: "bach -c" for bash; "zsh -c" for zsh; also accept wm commands like "hyprctl dispatch exec"
2626+vi_mode = true # set true to use vi keybinds, false emacs keybinds
2727+esc_to_abort = true # useful for vi users
2828+cheatsheet_entry = "?" # when prompted, will show a list of configured modules
2929+cheatsheet_viewer = "less -R; clear" # command to show cheatsheet; through piping stdout
3030+clear_screen_after_execution = false
3131+loop_mode = false # don't quit after executing a module, useful with scratchpads; stderr is hidden in loop mode
3232+external_editor = "nvim" # if set, press ctrl+x ctrl+ee (or v in vi normal mode) to edit prompt in the specified program
3333+delay_startup = 0 # sometimes the otter runs too fast even before the terminal window is ready; this slows it down by milliseconds; useful when chafa image is skewed
3434+#callback = "" # if set, will run after module execution; for example, calling swaymsg to adjust window size
3535+3636+3737+# ANSI color codes are allowed. However, \x1b should be replaced with \u001B, because the rust toml crate cannot read \x as an escaped character
3838+[interface]
3939+header = """
4040+ ┌ \u001B[1;34m $USER@$(echo $HOSTNAME) \u001B[0m─────┐
4141+ │ \u001B[90m \u001B[31m \u001B[32m \u001B[33m \u001B[34m \u001B[35m \u001B[36m\u001B[0m │
4242+ └ \u001B[90m \u001B[31m \u001B[32m \u001B[33m \u001B[34m \u001B[35m \u001B[36m\u001B[0m ┘
4343+ ┌ \u001B[33m \u001B[1;36m window \u001B[0m $XDG_CURRENT_DESKTOP ┐
4444+ │ \u001B[31m \u001B[1;36m loads\u001B[0m $(cat /proc/loadavg | cut -d ' ' -f 1) │
4545+ │ \u001B[32m \u001B[1;36m memory\u001B[0m $(free -h | awk 'FNR == 2 {print $3}') │
4646+ │ \u001B[90m\u001B[0m """
4747+list_prefix = " └ \u001B[34m "
4848+selection_prefix = " └ \u001B[31m "
4949+default_module_message = " └ \u001B[34m \u001B[33msearch\u001B[0m the internet"
5050+5151+place_holder = "type & search" # at the input field
5252+suggestion_mode = "list" # available options: list, hint
5353+suggestion_lines = 1 # 0 to disable suggestions and tab completion
5454+empty_module_message = "" # shown when the empty module is in use
5555+customized_list_order = false # false to list modules alphabetically; true to list as per the configured order in the below [[modules]] section
5656+indicator_with_arg_module = "" # the sign showing whether a module should run with an argument
5757+indicator_no_arg_module = ""
5858+# below color options affect all modules; per-module coloring can be configured using ansi codes individually
5959+prefix_color = "\u001B[33m"
6060+description_color = "\u001B[39m"
6161+place_holder_color = "\u001B[30m"
6262+hint_color = "\u001B[30m" # suggestion color in hint mode
6363+# move the interface rightward or downward
6464+move_interface_right = 16
6565+move_interface_down = 1
6666+6767+6868+# overlay is a floating layer that can be printed with stdout and moved around; useful for integrating chafa images
6969+[overlay]
7070+# run a command and print stdout on the overlay layer
7171+overlay_cmd = """
7272+cat ~/.config/otter-launcher/pikachu.example \
7373+|| echo -e "The file pickachu.example is not found. Pikachu can be at the below blank area. Fix this by modifying the overlay_cmd option in your config file.\n\n"
7474+"""
7575+overlay_trimmed_lines = 0 # remove trailing lines from overlay_cmd output
7676+overlay_height = 0 # set overlay size; 0 to be auto; 1 is one line, 2 two lines, etc; kitty & sixel image size can be determined automatically; others should be set mannually; try modify this whenever you meet issues releated to image height
7777+move_overlay_right = 0 # move the overlay layer around for theming
7878+move_overlay_down = 0
7979+8080+8181+# modules are defined as followed
8282+[[modules]]
8383+description = "google search"
8484+prefix = "gg"
8585+cmd = "xdg-open https://www.google.com/search?q='{}'"
8686+with_argument = true # if true, {} in cmd will be replaced with user input. if not explicitly set, taken as false.
8787+url_encode = true # should be true when calling webpages; this ensures special characters in url being readable to browsers; taken as false if not explicitly set
8888+unbind_proc = true # run cmd in a forked shell as opposed to as a child process (simply by prepending setsid -f to the configured cmd); useful for launching gui programs; taken as false if not explicitly set
8989+9090+# fzf is needed to run below functions
9191+[[modules]]
9292+description = "desktop programs"
9393+prefix = "app"
9494+cmd = "fsel"
9595+9696+[[modules]]
9797+description = "power menu (fzf)"
9898+prefix = "po"
9999+cmd = """
100100+function power {
101101+if [[ -n $1 ]]; then
102102+case $1 in
103103+"logout") session=`loginctl session-status | head -n 1 | awk '{print $1}'`; loginctl terminate-session $session ;;
104104+"suspend") systemctl suspend ;;
105105+"hibernate") systemctl hibernate ;;
106106+"reboot") systemctl reboot ;;
107107+"shutdown") systemctl poweroff ;;
108108+esac fi }
109109+power $(echo -e 'reboot\nshutdown\nlogout\nsuspend\nhibernate' | fzf --padding 1,2 --info-command 'printf " power menu ($FZF_POS/$FZF_TOTAL_COUNT)"' --cycle --gutter " " --pointer " ▌" --color "bg+:-1,pointer:1,info:8,separator:8,scrollbar:0" --prompt ' ' | tail -1)
110110+"""
111111+112112+[[modules]]
113113+description = "search packages"
114114+prefix = "np"
115115+cmd = "qutebrowser 'https://search.nixos.org/packages?channel=unstable&query={}'"
116116+with_argument = true
117117+url_encode = true
118118+unbind_proc = true
119119+120120+[[modules]]
121121+description = "open files (fzf)"
122122+prefix = "fo"
123123+cmd = """
124124+find $HOME -type f -not -path '*/.cache/*' 2>/dev/null | fzf --padding 1,3 --info-command 'printf " files ($FZF_POS/$FZF_TOTAL_COUNT)"' --cycle --gutter ' ' --pointer ' ▌' --color 'bg+:-1,pointer:1,info:8,separator:8,scrollbar:0' --prompt ' ' | setsid -f xargs -r -I [] xdg-open '[]'
125125+"""