Skip to content

Commit 11f2f90

Browse files
committed
Added additional args for emoji and glyph pickers
1 parent a0b09bb commit 11f2f90

File tree

6 files changed

+66
-19
lines changed

6 files changed

+66
-19
lines changed

Configs/.local/lib/hyde/emoji-picker.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22

3+
# shellcheck disable=SC1090
34
if ! source "$(command -v hyde-shell)"; then
45
echo "[wallbash] code :: Error: hyde-shell not found."
56
echo "[wallbash] code :: Is HyDE installed?"
@@ -44,12 +45,12 @@ get_emoji_selection() {
4445
local size_override=""
4546

4647
if [[ -n ${use_rofile} ]]; then
47-
awk '!seen[$0]++' "${recent_data}" "${emoji_data}" | rofi -dmenu -i -config "${use_rofile}" \
48+
awk '!seen[$0]++' "${recent_data}" "${emoji_data}" | rofi -dmenu -i "${ROFI_EMOJI_ARGS[@]}" -config "${use_rofile}" \
4849
-matching fuzzy -no-custom
4950
else
5051
case ${style_type} in
5152
2 | grid)
52-
awk '!seen[$0]++' "${recent_data}" "${emoji_data}" | rofi -dmenu -i -display-columns 1 \
53+
awk '!seen[$0]++' "${recent_data}" "${emoji_data}" | rofi -dmenu -i "${ROFI_EMOJI_ARGS[@]/-multi-select/}" -display-columns 1 \
5354
-display-column-separator " " \
5455
-theme-str "listview {columns: 10;}" \
5556
-theme-str "entry { placeholder: \" 🔎 Emoji\";} ${rofi_position} ${r_override}" \
@@ -59,14 +60,14 @@ get_emoji_selection() {
5960
-matching fuzzy -no-custom
6061
;;
6162
1 | list)
62-
awk '!seen[$0]++' "${recent_data}" "${emoji_data}" | rofi -dmenu -i \
63+
awk '!seen[$0]++' "${recent_data}" "${emoji_data}" | rofi -dmenu -i "${ROFI_EMOJI_ARGS[@]}" \
6364
-theme-str "entry { placeholder: \" 🔎 Emoji\";} ${rofi_position} ${r_override}" \
6465
-theme-str "${font_override}" \
6566
-theme "clipboard" \
6667
-matching fuzzy -no-custom
6768
;;
6869
*)
69-
awk '!seen[$0]++' "${recent_data}" "${emoji_data}" | rofi -dmenu -i \
70+
awk '!seen[$0]++' "${recent_data}" "${emoji_data}" | rofi -dmenu -i "${ROFI_EMOJI_ARGS[@]}" \
7071
-theme-str "entry { placeholder: \" 🔎 Emoji\";} ${rofi_position} ${r_override}" \
7172
-theme-str "${font_override}" \
7273
-theme "${style_type:-clipboard}" \
@@ -126,7 +127,7 @@ main() {
126127
[[ -z "${data_emoji}" ]] && exit 0
127128

128129
local selected_emoji_char=""
129-
selected_emoji_char=$(printf "%s" "${data_emoji}" | cut -d' ' -f1)
130+
selected_emoji_char=$(printf "%s" "${data_emoji}" | cut -d' ' -f1 | xargs)
130131

131132
if [[ -n "${selected_emoji_char}" ]]; then
132133
wl-copy "${selected_emoji_char}"

Configs/.local/lib/hyde/glyph-picker.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22

3+
# shellcheck disable=SC1090
34
if ! source "$(command -v hyde-shell)"; then
45
echo "[wallbash] code :: Error: hyde-shell not found."
56
echo "[wallbash] code :: Is HyDE installed?"
@@ -37,22 +38,27 @@ setup_rofi_config() {
3738

3839
local hypr_width=${hypr_width:-"$(hyprctl -j getoption general:border_size | jq '.int')"}
3940
r_override="window{border:${hypr_width}px;border-radius:${wind_border}px;}listview{border-radius:${elem_border}px;} element{border-radius:${elem_border}px;}"
41+
42+
rofi_args+=(
43+
"${ROFI_GLYPH_ARGS[@]}"
44+
-i
45+
-matching fuzzy
46+
-no-custom
47+
-theme-str "entry { placeholder: \"  Glyph\";} ${rofi_position}"
48+
-theme-str "${font_override}"
49+
-theme-str "${r_override}"
50+
-theme "${ROFI_GLYPH_STYLE:-clipboard}"
51+
)
4052
}
4153

4254
get_glyph_selection() {
43-
awk '!seen[$0]++' "${recent_data}" "${glyph_data}" | rofi -dmenu -i \
44-
-matching fuzzy \
45-
-no-custom \
46-
-theme-str "entry { placeholder: \"  Glyph\";} ${rofi_position}" \
47-
-theme-str "${font_override}" \
48-
-theme-str "${r_override}" \
49-
-theme "${ROFI_GLYPH_STYLE:-clipboard}"
55+
awk '!seen[$0]++' "${recent_data}" "${glyph_data}" | rofi -dmenu "${rofi_args[@]}"
5056
}
5157

5258
main() {
5359
if [[ ! -f "${recent_data}" ]]; then
5460
mkdir -p "$(dirname "${recent_data}")"
55-
echo " Arch linux - I use Arch, BTW" >"${recent_data}"
61+
printf "\tArch linux - I use Arch, BTW\n" >"${recent_data}"
5662
fi
5763

5864
setup_rofi_config
@@ -62,7 +68,7 @@ main() {
6268
[[ -z "${data_glyph}" ]] && exit 0
6369

6470
local sel_glyph=""
65-
sel_glyph=$(printf "%s" "${data_glyph}" | cut -d$'\t' -f1)
71+
sel_glyph=$(printf "%s" "${data_glyph}" | cut -d$'\t' -f1 | xargs)
6672

6773
if [[ -n "${sel_glyph}" ]]; then
6874
wl-copy "${sel_glyph}"

Configs/.local/share/hyde/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ scale = 10 # Scaling for animation.
3131
# glyph-picker.sh configuration.
3232
[rofi.glyph]
3333
scale = 10 # Scaling for glyph picker.
34+
args = ["-multi-select"] # Additional arguments for glyph picker.
3435

3536
# rofilaunch.sh configuration.
3637
[rofi.launch]
@@ -56,6 +57,7 @@ scale = 10 # Scaling for wallpaper.
5657
[rofi.emoji]
5758
style = 1 # Style for emoji picker.
5859
scale = 10 # Scaling for emoji picker.
60+
args = ["-multi-select"] # Additional arguments for emoji picker.
5961

6062
# themeselect.sh configuration.
6163
[rofi.theme]

Configs/.local/share/hyde/schema/config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ emoji-picker.sh configuration.
204204

205205
| Key | Description | Default |
206206
| --- | ----------- | ------- |
207+
| args | Additional arguments for emoji picker. | ["-multi-select"] |
207208
| scale | Scaling for emoji picker. | 10 |
208209
| style | Style for emoji picker. | 1 |
209210

@@ -213,6 +214,7 @@ glyph-picker.sh configuration.
213214

214215
| Key | Description | Default |
215216
| --- | ----------- | ------- |
217+
| args | Additional arguments for glyph picker. | ["-multi-select"] |
216218
| scale | Scaling for glyph picker. | 10 |
217219

218220
### [rofi.hyprlock]

Configs/.local/share/hyde/schema/config.toml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ type = "object"
102102
description = "Scaling for glyph picker."
103103
type = "integer"
104104

105+
[properties.rofi.properties.glyph.properties.args]
106+
default = [ "-multi-select" ]
107+
description = "Additional arguments for glyph picker."
108+
type = "array"
109+
[properties.rofi.properties.glyph.properties.args.items]
110+
type = "string"
111+
112+
105113
[properties.rofi.properties.launch]
106114
description = "rofilaunch.sh configuration."
107115
type = "object"
@@ -196,6 +204,14 @@ type = "object"
196204
description = "Scaling for emoji picker."
197205
type = "integer"
198206

207+
[properties.rofi.properties.emoji.properties.args]
208+
default = [ "-multi-select" ]
209+
description = "Additional arguments for emoji picker."
210+
type = "array"
211+
[properties.rofi.properties.emoji.properties.args.items]
212+
type = "string"
213+
214+
199215
[properties.rofi.properties.theme]
200216
description = "themeselect.sh configuration."
201217
type = "object"
@@ -474,7 +490,7 @@ type = "object"
474490
type = "array"
475491

476492
[properties."cava.stdout".properties.bar_array.items]
477-
type = "string"
493+
type = "string"
478494

479495
[properties."cava.hyprlock"]
480496
description = "'cava.sh hyprlock' configuration."
@@ -506,7 +522,7 @@ type = "object"
506522
type = "array"
507523

508524
[properties."cava.hyprlock".properties.bar_array.items]
509-
type = "string"
525+
type = "string"
510526

511527
[properties."cava.waybar"]
512528
description = "'cava.sh waybar' configuration."
@@ -538,7 +554,7 @@ type = "object"
538554
type = "array"
539555

540556
[properties."cava.waybar".properties.bar_array.items]
541-
type = "string"
557+
type = "string"
542558

543559
[properties."cava"]
544560
description = "Cava visualizer configuration."
@@ -571,7 +587,7 @@ type = "object"
571587
type = "array"
572588

573589
[properties."hypr.config".properties.sanitize.items]
574-
type = "string"
590+
type = "string"
575591

576592
[properties.volume]
577593
description = "volumecontrol.sh configuration."
@@ -626,7 +642,7 @@ type = "object"
626642
type = "array"
627643

628644
[properties.sysmonitor.properties.commands.items]
629-
type = "string"
645+
type = "string"
630646

631647
[properties.notification]
632648
description = "Notification script configuration."

Configs/.local/share/hyde/schema/config.toml.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@
9797
"default": 10,
9898
"description": "Scaling for glyph picker.",
9999
"type": "integer"
100+
},
101+
"args": {
102+
"default": [
103+
"-multi-select"
104+
],
105+
"description": "Additional arguments for glyph picker.",
106+
"type": "array",
107+
"items": {
108+
"type": "string"
109+
}
100110
}
101111
}
102112
},
@@ -202,6 +212,16 @@
202212
"default": 10,
203213
"description": "Scaling for emoji picker.",
204214
"type": "integer"
215+
},
216+
"args": {
217+
"default": [
218+
"-multi-select"
219+
],
220+
"description": "Additional arguments for emoji picker.",
221+
"type": "array",
222+
"items": {
223+
"type": "string"
224+
}
205225
}
206226
}
207227
},

0 commit comments

Comments
 (0)