Jump to content

[SOLVED] Bash commands for dock position not working on List Filter


Recommended Posts

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.

 

1585568713_Screenshot2018-05-1721_19_58.thumb.png.2893f295e1f7e4a1c5b3a6b969e57877.png

 

 

2007666187_Screenshot2018-05-1721_20_13.thumb.png.c564b37ce1b621c6ef0fab7307ee6b97.png

Edited by Bhishan
Link to comment

@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.

 

1101664949_Screenshot2018-05-1810_15_32.png.4c1a5cab7e7b08004dfe9bce7537463d.png

Link to comment

@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 by Bhishan
Link to comment

 

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 by Bhishan
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...