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 post

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

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

 

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 post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...