Bhishan Posted May 18, 2018 Share Posted May 18, 2018 (edited) I was trying to run dock repositioning commands in Alfred using List filter. The link is given in github. I was can see the list names, but when I click them none of them works. How can we fix them ? Help will be truly appreciated. Edited May 19, 2018 by Bhishan Link to comment
vitor Posted May 18, 2018 Share Posted May 18, 2018 You’re making it more complicated than it needs to be. The python Run Script is unnecessary, as is the duck Keyword. Just have the List Filter with the options spelled out and the bash Run Script. Link to comment
Bhishan Posted May 18, 2018 Author Share Posted May 18, 2018 @vitor I deleted the redundant python script, but this still does not work. The List Filter is giving problem, If I delete LIST FILTER the script works, but I want to keep it. Is there any way I keep the list filter and when we click on "Hide" on list filter, it will hide the dock ? The updated link is shared here. Link to comment
vitor Posted May 18, 2018 Share Posted May 18, 2018 (edited) This is how it should look: Edited May 18, 2018 by vitor Link to comment
Bhishan Posted May 18, 2018 Author Share Posted May 18, 2018 (edited) @vitor Thanks a lot. It works now. But, can we change the bash script like this: # Wanted version [[ "${1}" == 'var_show' ]] && defaults write com.apple.Dock autohide -bool FALSE; killall Dock [[ "${1}" == 'var_hide' ]] && defaults write com.apple.Dock autohide -bool TRUE; killall Dock # Ugly but working version: query=$1 if [ $query = "hide" ]; then defaults write com.apple.Dock autohide -bool TRUE; killall Dock fi if [ $query = "show" ]; then defaults write com.apple.Dock autohide -bool FALSE; killall Dock fi Edited May 18, 2018 by Bhishan Link to comment
vitor Posted May 18, 2018 Share Posted May 18, 2018 1 hour ago, Bhishan said: But, can we change the bash script like this I don’t understand your question. Link to comment
Bhishan Posted May 18, 2018 Author Share Posted May 18, 2018 (edited) The last bash script in the workflow has following code: query=$1 if [ $query = "hide" ]; then defaults write com.apple.Dock autohide -bool TRUE; killall Dock fi if [ $query = "show" ]; then defaults write com.apple.Dock autohide -bool FALSE; killall Dock fi Can we refactor this code so that it would look nicer, and still works on Alfred? My attempt was this, but it did not work: [[ "${1}" == 'var_show' ]] && defaults write com.apple.Dock autohide -bool FALSE; killall Dock [[ "${1}" == 'var_hide' ]] && defaults write com.apple.Dock autohide -bool TRUE; killall Dock Edited May 18, 2018 by Bhishan Link to comment
vitor Posted May 18, 2018 Share Posted May 18, 2018 The problem is the var_. Remove those and it’ll work. Link to comment
Bhishan Posted May 18, 2018 Author Share Posted May 18, 2018 Thanks, it works now. I was using var_show previously, forgot to remove var_. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now