diff --git a/apps/default_commands.sh b/apps/default_commands.sh index 8eabb61..c7878d8 100644 --- a/apps/default_commands.sh +++ b/apps/default_commands.sh @@ -27,16 +27,16 @@ all(){ ### top buttons "main" | "notification" | "settings" | "task_manager" | "search") - echo "no default action assigned to $1" + echo "button all_$1 is no-op" ;; "browser") - helper_find_or_open firefox + find_or_open firefox ;; "file_explorer") - helper_find_or_open kodi + find_or_open kodi ;; "action_center") - helper_find_or_open steam + find_or_open steam ;; ### arrow buttons @@ -56,7 +56,7 @@ all(){ echo "sucessful test" ;; *) - echo "unexpected action: ${1-}" + echo "button $1 not found" ;; esac diff --git a/apps/kodi.sh b/apps/kodi.sh index 0951544..8883a9c 100644 --- a/apps/kodi.sh +++ b/apps/kodi.sh @@ -10,10 +10,12 @@ kodi(){ kodi-send --action="SkipPrevious" } split_up(){ - xdotool_helper "key p" + sleep .2 + xdotool key p } move_up(){ - xdotool_helper "key o" + sleep .2 + xdotool key o } search(){ kodi-send --action="VideoLibrary.Search" diff --git a/find_or_open.sh b/find_or_open.sh index 20851d4..3d0a0b6 100755 --- a/find_or_open.sh +++ b/find_or_open.sh @@ -1,5 +1,5 @@ #!/bin/bash -helper_find_or_open(){ +find_or_open(){ windows=$(wmctrl -l) if [[ "${windows,,}" == *"$1"* ]]; then xdotool windowactivate "$(wmctrl -l | grep -i "$1" | cut -d " " -f 1)" @@ -9,3 +9,7 @@ helper_find_or_open(){ echo "opening $1" fi } + +if [[ ! -z $1 ]]; then + find_or_open $1 +fi