@@ -68,7 +68,7 @@ function check_valid {
68
68
}
69
69
70
70
# Parse command-line options
71
- parsed=$( getopt --options=h --longoptions=help,dry-run,confirm:,choices:,choose:,symbols,no-symbols,text,no-text --name " $0 " -- " $@ " )
71
+ parsed=$( getopt --options=h --longoptions=help,dry-run,confirm:,choices:,choose:,symbols,no-symbols,text,no-text,symbols-font: --name " $0 " -- " $@ " )
72
72
if [ $? -ne 0 ]; then
73
73
echo ' Terminating...' >&2
74
74
exit 1
@@ -88,27 +88,31 @@ while true; do
88
88
echo " rofi -show menu -modi \" menu:rofi-power-menu --choices=shutdown/reboot\" "
89
89
echo
90
90
echo " Available options:"
91
- echo " --dry-run Don't perform the selected action but print it to stderr."
92
- echo " --choices CHOICES Show only the selected choices in the given order. Use / "
93
- echo " as the separator. Available choices are lockscreen, logout,"
94
- echo " suspend, hibernate, reboot and shutdown. By default, all"
95
- echo " available choices are shown."
96
- echo " --confirm CHOICES Require confirmation for the gives choices only. Use / as"
97
- echo " the separator. Available choices are lockscreen, logout,"
98
- echo " suspend, hibernate, reboot and shutdown. By default, only"
99
- echo " irreversible actions logout, reboot and shutdown require"
100
- echo " confirmation."
101
- echo " --choose CHOICE Preselect the given choice and only ask for a confirmation"
102
- echo " (if confirmation is set to be requested). It is strongly"
103
- echo " recommended to combine this option with --confirm=CHOICE"
104
- echo " if the choice wouldn't require confirmation by default."
105
- echo " Available choices are lockscreen, logout, suspend,"
106
- echo " hibernate, reboot and shutdown."
107
- echo " --[no-]symbols Show Unicode symbols or not. Requires a font with support"
108
- echo " for the symbols. Use, for instance, fonts from the"
109
- echo " Nerdfonts collection. By default, they are shown"
110
- echo " --[no-]text Show text description or not."
111
- echo " -h,--help Show this help text."
91
+ echo " --dry-run Don't perform the selected action but print it to stderr."
92
+ echo " --choices CHOICES Show only the selected choices in the given order. Use /"
93
+ echo " as the separator. Available choices are lockscreen,"
94
+ echo " logout,suspend, hibernate, reboot and shutdown. By"
95
+ echo " default, all available choices are shown."
96
+ echo " --confirm CHOICES Require confirmation for the gives choices only. Use / as"
97
+ echo " the separator. Available choices are lockscreen, logout,"
98
+ echo " suspend, hibernate, reboot and shutdown. By default, only"
99
+ echo " irreversible actions logout, reboot and shutdown require"
100
+ echo " confirmation."
101
+ echo " --choose CHOICE Preselect the given choice and only ask for a"
102
+ echo " confirmation (if confirmation is set to be requested). It"
103
+ echo " is strongly recommended to combine this option with"
104
+ echo " --confirm=CHOICE if the choice wouldn't require"
105
+ echo " confirmation by default. Available choices are"
106
+ echo " lockscreen, logout, suspend, hibernate, reboot and"
107
+ echo " shutdown."
108
+ echo " --[no-]symbols Show Unicode symbols or not. Requires a font with support"
109
+ echo " for the symbols. Use, for instance, fonts from the"
110
+ echo " Nerdfonts collection. By default, they are shown"
111
+ echo " --[no-]text Show text description or not."
112
+ echo " --symbols-font FONT Use the given font for symbols. By default, the symbols"
113
+ echo " use the same font as the text. That font is configured"
114
+ echo " with rofi."
115
+ echo " -h,--help Show this help text."
112
116
exit 0
113
117
;;
114
118
" --dry-run" )
@@ -147,6 +151,10 @@ while true; do
147
151
showtext=false
148
152
shift 1
149
153
;;
154
+ " --symbols-font" )
155
+ symbols_font=" $2 "
156
+ shift 2
157
+ ;;
150
158
" --" )
151
159
shift
152
160
break
168
176
# configure them in the future.
169
177
170
178
function write_message {
171
- icon=" <span font_size=\" medium\" >$1 </span>"
179
+ if [ -z ${symbols_font+x} ];
180
+ then
181
+ icon=" <span font_size=\" medium\" >$1 </span>"
182
+ else
183
+ icon=" <span font=\" ${symbols_font} \" font_size=\" medium\" >$1 </span>"
184
+ fi
172
185
text=" <span font_size=\" medium\" >$2 </span>"
173
186
if [ " $showsymbols " = " true" ]
174
187
then
0 commit comments