Skip to content

Commit a6943c3

Browse files
committed
additional_items -> custom_items
1 parent c310fca commit a6943c3

File tree

10 files changed

+267
-280
lines changed

10 files changed

+267
-280
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ __pycache__
1111
# tmux-menus cache
1212
cache/
1313

14-
# Additional loocal menus not managed by git
15-
additional_items/
14+
# Custom loocal menus not managed by git
15+
custom_items/

content/additional_index_template

Lines changed: 0 additions & 32 deletions
This file was deleted.

content/additional_item_template.sh renamed to content/custom_item_template.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
#
66
# Part of https://github.com/jaclu/tmux-menus
77
#
8-
# Template additional item, copy this into additional_items and modify!
8+
# Template custom item, copy this into custom_items and modify!
99
#
1010

1111
static_content() {
1212

1313
set -- \
14-
0.0 M Left "Back to Additional items $nav_prev" "$f_additional_items_index" \
15-
0.0 M Left "Back to Main menu $nav_home" main.sh \
14+
0.0 M Left "Back to Custom items $nav_prev" "$f_custom_items_index" \
15+
0.0 M Left "Back to Main menu $nav_home" main.sh \
1616
0.0 S \
1717
0.0 T "*** Replace this line with one or more lines of custom contnent! ***"
1818

@@ -33,12 +33,12 @@ D_TM_BASE_PATH="$(dirname -- "$(dirname -- "$(realpath "$0")")")"
3333
# shellcheck source=scripts/dialog_handling.sh
3434
. "$D_TM_BASE_PATH"/scripts/dialog_handling.sh
3535

36-
# An additional items menu must define menu_key & menu_label,
37-
# in order to be listed in the additional_items index menu
36+
# A custom items menu must define menu_key & menu_label,
37+
# in order to be listed in the custom_items index menu
3838

3939
# Since this will be used to point to this menu from the index,
40-
# it is recommended to use uppercase in order to follow the conventions in this plugin,
41-
# but anything goes!
40+
# it is recommended to use uppercase in order to follow the conventions
41+
# in this plugin, but anything goes!
4242
# If a "special" char is used it might need to be prefixed with \
4343
menu_key="?"
44-
menu_label="My additional menu" # short description of this menu
44+
menu_label="My Custom menu" # short description of this menu

docs/custom_menus.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Custom menus
22

3-
This plugin automatically handles custom menus placed in the `additional_items/`
3+
This plugin automatically handles custom menus placed in the `custom_items/`
44
directory.
55

66
## How It Works
77

88
regenerate
99
the index listing all custom menus.
10-
`additional_items/_index.sh` (listing all custom menus, from now on referred
10+
`custom_items/_index.sh` (listing all custom menus, from now on referred
1111
to just by `_index.sh`).
1212

1313
### **Monitoring Changes**
1414

15-
When files in `additional_items/` change, on next startup the plugin will
15+
When files in `custom_items/` change, on next startup the plugin will
1616
process all files found.
1717

1818
- It creates or updates an inex listing all valid custom menus.
@@ -40,12 +40,12 @@ If these hints are missing or invalid, a notification will be displayed next tim
4040
`_index.sh` is generated, and that custom menu will be ignored until it is fixed.
4141

4242
There is a template that can be used when creating custom menus.
43-
copy `content/additional_item_template.sh` into `additional_items/` with a
43+
copy `content/custom_item_template.sh` into `custom_items/` with a
4444
suitable name
4545

4646
## Summary
4747

48-
This approach ensures your custom menus are always recognized and properly linked to the
49-
Main Menu, keeping everything neat and user-friendly.
48+
This approach ensures your custom menus are always recognized and properly linked to
49+
the Main Menu, keeping everything neat and user-friendly.
5050

5151
Just make sure your custom menu include valid labels and shortcuts!

items/main.sh

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ static_content() {
1616
rld_cmd="command-prompt -I '$cfg_tmux_conf' -p 'Source file:' \
1717
'run-shell \"$d_scripts/reload_conf.sh %% $reload_in_runshell\"'"
1818

19-
# 12.0 M S
19+
[ -f "$f_custom_items_index" ] && {
20+
set -- \
21+
0.0 M \+ "Custom items $nav_next" "$f_custom_items_index"
22+
23+
menu_generate_part 1 "$@"
24+
}
25+
2026
# Menu items definition
2127
set -- \
2228
1.8 M N "Navigate & Search $nav_next" nav_search.sh \
@@ -26,18 +32,8 @@ static_content() {
2632
1.8 M B "Paste buffers $nav_next" paste_buffers.sh \
2733
0.0 M L "Layouts $nav_next" layouts.sh \
2834
0.0 M V "Split view $nav_next" split_view.sh \
29-
2.0 M M "Missing Keys $nav_next" missing_keys.sh
30-
31-
menu_generate_part 1 "$@"
32-
33-
[ -f "$f_additional_items_index" ] && {
34-
set -- \
35-
0.0 M A "Additinoal items $nav_next" "$f_additional_items_index"
36-
37-
menu_generate_part 2 "$@"
38-
}
39-
set -- \
40-
0.0 M O "Advanced Options $nav_next" advanced.sh \
35+
2.0 M M "Missing Keys $nav_next" missing_keys.sh \
36+
0.0 M A "Advanced Options $nav_next" advanced.sh \
4137
0.0 M E "Extras $nav_next" extras.sh \
4238
0.0 S \
4339
3.2 T "-#[nodim]On-the-Fly Config" \
@@ -51,7 +47,8 @@ static_content() {
5147
"$d_hints/customize-mode.sh $f_current_script" \
5248
0.0 M H "Help $nav_next" \
5349
"$d_help/help_summary.sh $f_current_script"
54-
menu_generate_part 3 "$@"
50+
51+
menu_generate_part 2 "$@"
5552
}
5653

5754
#===============================================================

menus.tmux

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ initialize_plugin=1
4444
# implied check if caching is used
4545
[ -d "$d_cache" ] && cache_add_ok_vers "$tmux_vers"
4646

47-
if [ -f "$f_update_additional_inventory" ]; then
48-
$f_update_additional_inventory
47+
if [ -f "$f_update_custom_inventory" ]; then
48+
$f_update_custom_inventory
4949
else
50-
log_it "config file missing: $f_update_additional_inventory"
50+
log_it "config file missing: $f_update_custom_inventory"
5151
fi
5252

5353
if $cfg_use_whiptail; then

scripts/dialog_handling.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ uncached_wt_actions=""
757757
uncached_item_splitter="||||"
758758

759759
# Just a dummy statement, so that the shellcheck disable doesn't need to be done in
760-
# every additional_item
760+
# every custom_item
761761
_="$menu_key $menu_label"
762762

763763
alt_dialog_action_separator=":/:/:/:"

scripts/helpers.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,9 @@ d_items="$D_TM_BASE_PATH"/items
362362
d_help="$d_items"/help
363363
d_hints="$d_items"/hints
364364
d_scripts="$D_TM_BASE_PATH"/scripts
365-
d_additional_items="$D_TM_BASE_PATH"/additional_items
366-
f_additional_items_index="$d_additional_items"/_index.sh
367-
f_update_additional_inventory="$d_scripts"/update_additional_inventory.sh
365+
d_custom_items="$D_TM_BASE_PATH"/custom_items
366+
f_custom_items_index="$d_custom_items"/_index.sh
367+
f_update_custom_inventory="$d_scripts"/update_custom_inventory.sh
368368

369369
# will be set to true at end of this, this indicates everything is prepared
370370
env_initialized=false

0 commit comments

Comments
 (0)