Jump to content

List, filter and activate network locations from within Alfred


Recommended Posts

View and change your network location from Alfred.
 
screenshot.png

Installation

Download the workflow from Packal or GitHub.

Usage

  • netloc [<query>] — Show list of network locations filtered by <query> if one is specified
  • — Activate selected network location
  • ⌘+↩ — Open Network Preferences

Note: You will probably be asked to enter your password to change the network location.
Licence

This workflow is released under the MIT Licence.

Edited by deanishe
Link to comment
  • 5 months later...
  • 3 years later...

@deanishe This is very useful as I'm always changing between network locations.  I noticed that you're using the networksetup command to change locations.  I've found that if you use the "scselect <location name>" command instead of "networksetup -switchtolocation <location name>" to change locations, it doesn't throw up that annoying password prompt.  Perhaps consider modifying your python script to use the "scselect" command to change locations.

 

Thanks!

Link to comment
  • 3 years later...

@deanishe looks like macos 12.3 has killed your very useful workflow. I run it now in debug and get:

 

[13:58:07.700] Logging Started...
[13:58:43.347] Network Location[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.9298)] Queuing argument ''
[13:58:43.361] Network Location[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.9298....)] Script with argv '' finished
[13:58:43.364] ERROR: Network Location[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.929...)] Code 127: /Users/xxxxxx/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/F98...:1: command not found: python

I have python 3 (via Anaconda) on my machine, and the command "python" is defined. Maybe a python 2 versus 3 issue? Do you have time to fix it?

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