|
本帖最后由 hhh333 于 2020-1-31 20:13 编辑
做好了,感谢两位大佬的指点,终于又学会for/expr等命令的用法。
- #主题计数
- export theme_count=0
- for item in $prefix/themes/*/theme.txt; do
- expr --set=theme_count $theme_count+1
- done
- if [ $theme_count -gt 0 ]; then
- set theme_index=1
- #换主题
- hiddenentry "Switch Themes" --hotkey f5 {
- set i=0
- expr --set=theme_index $theme_index+1
- if [ $theme_index -gt $theme_count ]; then
- set theme_index=1
- fi
- for item in $prefix/themes/*/theme.txt; do
- expr --set=i $i+1
- if [ $i -eq $theme_index ]; then
- set theme=$item
- break
- fi
- done
- }
- #无主题
- hiddenentry "Clear Themes" --hotkey f6 {
- if [ "$theme" != "" ]; then
- unset theme
- fi
- }
- fi
复制代码
|
|