Compare commits

...

2 Commits

Author SHA1 Message Date
206e6f5467 updated bash_completion 2025-06-26 13:09:22 +03:00
973ae4c61a fixed debug variables 2025-06-26 13:08:33 +03:00
2 changed files with 20 additions and 22 deletions

View File

@ -4,41 +4,39 @@ _winehelper_completions() {
COMPREPLY=() COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}" cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--help --version --debug install installed run -r -i remove-all --clear-pfx remove-prefix backup-prefix restore-prefix winecfg winereg winefile wineconsole winetricks killall desktop regedit explorer cmd" opts="--help --version --debug install installed -r -i remove-all --clear-pfx killall remove-prefix backup-prefix restore-prefix"
wine_cmd="winecfg winereg winefile wineconsole winetricks desktop regedit explorer cmd run"
case "${prev}" in case "${prev}" in
winehelper)
COMPREPLY=( $(compgen -W "${opts} ${wine_cmd}" -- "${cur}") )
return 0
;;
--debug)
COMPREPLY=( $(compgen -W "${wine_cmd}" -- "${cur}") )
return 0
;;
install|-i) install|-i)
if [[ "${COMP_WORDS[COMP_CWORD-2]}" == "install" && "$cur" == "" ]]; then local scripts="$(ls -1 /usr/share/winehelper/autoinstall) $(ls -1 /usr/share/winehelper/manualinstall)"
COMPREPLY=( $(compgen -W "list" -- "${cur}") ) COMPREPLY=( $(compgen -W "list ${scripts}" -- "${cur}") )
else
local scripts=$(ls /usr/share/winehelper/autoinstall /usr/share/winehelper/manualinstall 2>/dev/null | grep -v '^list$')
COMPREPLY=( $(compgen -W "${scripts}" -- "${cur}") )
fi
return 0 return 0
;; ;;
list) run|installed)
COMPREPLY=() local installed=$(grep -h "Exec=env" ~/.local/share/winehelper/*.desktop 2>/dev/null | awk -F'/' '{print $NF}' | awk -F'"' '{print $1}')
return 0
;;
run)
local installed=$(grep -h "Exec=env" ~/.local/share/applications/WineHelper/*.desktop 2>/dev/null | awk -F'"' '{print $4}' | xargs -n1 basename)
COMPREPLY=( $(compgen -W "${installed}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${installed}" -- "${cur}") )
return 0 return 0
;; ;;
remove-prefix|backup-prefix) remove-prefix|backup-prefix)
local prefixes=$(ls ~/.local/share/winehelper/prefixes 2>/dev/null) local prefixes=$(ls -1 ~/.local/share/winehelper/prefixes 2>/dev/null)
COMPREPLY=( $(compgen -W "${prefixes}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${prefixes}" -- "${cur}") )
return 0 return 0
;; ;;
restore-prefix) restore-prefix)
COMPREPLY=( $(compgen -f -X '!*.whpack' -- "${cur}") )
return 0 return 0
;; ;;
*) *)
;; ;;
esac esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
} }
complete -F _winehelper_completions winehelper complete -F _winehelper_completions winehelper

View File

@ -46,11 +46,11 @@ check_variables () { [[ -z ${!1} ]] && export $1="$2" ;}
if [[ "$1" == "--debug" ]] ; then if [[ "$1" == "--debug" ]] ; then
check_variables WINEDEBUG "+loaddll,+seh" check_variables WINEDEBUG "+loaddll,+seh"
export DXVK_LOG_LEVEL="error" export DXVK_LOG_LEVEL="error"
export VKD3D_DEBUG "error" export VKD3D_DEBUG="error"
export WINE_MONO_TRACE "E:System.NotImplementedException" export WINE_MONO_TRACE="E:System.NotImplementedException"
export VK_LOADER_DEBUG "error" export VK_LOADER_DEBUG="error"
export VKBASALT_LOG_LEVEL "error" export VKBASALT_LOG_LEVEL="error"
export DXVK_NVAPI_LOG_LEVEL "error" export DXVK_NVAPI_LOG_LEVEL="error"
shift shift
else else
check_variables WINEDEBUG "-all" check_variables WINEDEBUG "-all"