{"action":"created","issue":{"url":"https://api.github.com/repos/kozec/sc-controller/issues/427","repository_url":"https://api.github.com/repos/kozec/sc-controller","labels_url":"https://api.github.com/repos/kozec/sc-controller/issues/427/labels{/name}","comments_url":"https://api.github.com/repos/kozec/sc-controller/issues/427/comments","events_url":"https://api.github.com/repos/kozec/sc-controller/issues/427/events","html_url":"https://github.com/kozec/sc-controller/issues/427","id":372253954,"node_id":"MDU6SXNzdWUzNzIyNTM5NTQ=","number":427,"title":"Feature request: Custom action: Do something only if shell() exits in success","user":{"login":"Jimi-James","id":5751606,"node_id":"MDQ6VXNlcjU3NTE2MDY=","avatar_url":"https://avatars3.githubusercontent.com/u/5751606?v=4","gravatar_id":"","url":"https://api.github.com/users/Jimi-James","html_url":"https://github.com/Jimi-James","followers_url":"https://api.github.com/users/Jimi-James/followers","following_url":"https://api.github.com/users/Jimi-James/following{/other_user}","gists_url":"https://api.github.com/users/Jimi-James/gists{/gist_id}","starred_url":"https://api.github.com/users/Jimi-James/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jimi-James/subscriptions","organizations_url":"https://api.github.com/users/Jimi-James/orgs","repos_url":"https://api.github.com/users/Jimi-James/repos","events_url":"https://api.github.com/users/Jimi-James/events{/privacy}","received_events_url":"https://api.github.com/users/Jimi-James/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-10-20T21:20:15Z","updated_at":"2018-12-21T19:35:25Z","closed_at":"2018-12-14T22:11:54Z","author_association":"NONE","body":"I want to be able to use the Guide button on my controllers sometimes, like with PPSSPP, but I don't want to have to deal with that thing Steam does where it *can't not* enter BPM if the Steam window is focused.\r\n\r\nI could set the button to a script that checks if my focused window is Steam, and if so does nothing. But I don't actually know how to make that script send a controller button to my entire desktop, and running a whole separate script file is pretty roundabout for a one-line xdotool poll.\r\n\r\nSo what if I could do something like this?\r\n\r\n`shell(bash -c 'WINDOW=$(xdotool getwindowname $(xdotool getactivewindow)); if [ \"$WINDOW\" = \"Steam\" ]; then exit 1; else exit 0').onsuccess(button(Keys.BTN_MODE))`\r\n \r\nMaybe one could even go the whole mile and have a full if-statement by also having `.onfailure()` or something."},"comment":{"url":"https://api.github.com/repos/kozec/sc-controller/issues/comments/449479364","html_url":"https://github.com/kozec/sc-controller/issues/427#issuecomment-449479364","issue_url":"https://api.github.com/repos/kozec/sc-controller/issues/427","id":449479364,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTQ3OTM2NA==","user":{"login":"Jimi-James","id":5751606,"node_id":"MDQ6VXNlcjU3NTE2MDY=","avatar_url":"https://avatars3.githubusercontent.com/u/5751606?v=4","gravatar_id":"","url":"https://api.github.com/users/Jimi-James","html_url":"https://github.com/Jimi-James","followers_url":"https://api.github.com/users/Jimi-James/followers","following_url":"https://api.github.com/users/Jimi-James/following{/other_user}","gists_url":"https://api.github.com/users/Jimi-James/gists{/gist_id}","starred_url":"https://api.github.com/users/Jimi-James/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jimi-James/subscriptions","organizations_url":"https://api.github.com/users/Jimi-James/orgs","repos_url":"https://api.github.com/users/Jimi-James/repos","events_url":"https://api.github.com/users/Jimi-James/events{/privacy}","received_events_url":"https://api.github.com/users/Jimi-James/received_events","type":"User","site_admin":false},"created_at":"2018-12-21T19:35:25Z","updated_at":"2018-12-21T19:35:25Z","author_association":"NONE","body":"It's definitely doing something, but I can't tell if it's working, or if I'm doing something wrong? I have:\r\n\r\n```\r\nhold(menu('Default.menu',DEFAULT,B,A), mode(\r\n  shell('test [[ \"$(xdotool getwindowname $(xdotool getactivewindow))\" =~ \"Steam\" ]]'),menu('Default.menu',DEFAULT,B,A),\r\n  button(Keys.BTN_MODE)\r\n), 0.3)\r\n```\r\n\r\nThe behavior I get with the Mode button *without* using shell('command') is, the Steam window appears as soon as I press the button, and then BPM mode starts if I press it again with Steam focused. The behavior I get with this code I'm trying is pretty much the exact same thing, only I have to press the button a few times in a row within a second (i.e. tap it really fast), usually about 3 times, for the system to even register any sort of button press at all, regardless of whether the Steam window is focused or now.\r\n\r\nSo it seems like all it's doing is making the Mode button just not work sometimes. I checked and made sure those xdotool commands finish in less than 500ms. They definitely do. I also tried using bash -c, and the if-then format I typed earlier instead of a test. The behavior doesn't change. I'm not sure what else to try."}}
{"actor":{"display_login":"Jimi-James"}}