Jump to content


Photo

Wi-Fi toggle, Network Location, Fast User Switching, Finder Settings...

Workflows Finder Wi-Fi

  • Please log in to reply
41 replies to this topic

#1 Jonas Eriksen

Jonas Eriksen

    Member

  • Member
  • PipPip
  • 115 posts
  • LocationDenmark

Posted 16 January 2013 - 12:23 AM

Hi,

 

Here are my first workflows, hope some of you might find them useful:

 

Fast User Switching

 

(I have linked to this one in here before)

 

Screenshot-Fast-User-Switching.png

 

https://github.com/a....alfredworkflow

 

 

Finder Settings

 

Change setting for: Hidden files, User Library and what to show on the Desktop.

More setting might be added later.

 

Screenshot-Finder.png

 

Screenshot-Desktop.png

 

https://github.com/a....alfredworkflow

 

 

Wi-Fi toggle

 

A rewrite of my Wi-Fi toggle extension for Alfred 1.x

 

Screenshot-Wi-Fi.png

 

https://github.com/a....alfredworkflow

 

 

Network Location

 

Also a rewrite...

 

Screenshot-Network-Location.png

 

https://github.com/a....alfredworkflow

 

 

And a nice little File Action, to uninstall apps with AppCleaner

 

https://github.com/a....alfredworkflow


Edited by Jonas Eriksen, 30 March 2013 - 02:07 PM.

  • Tyler Eich, drking, thec13 and 3 others like this

#2 Tyler Eich

Tyler Eich

    Advanced Member

  • Member
  • PipPipPip
  • 603 posts
  • LocationIndiana, USA

Posted 16 January 2013 - 12:43 AM

Awesome extensions! I had been working on a Fast User Switching workflow myself, but yours is way better.

 

I did notice, however, that your 

<valid>yes</valid>

 node should be an attribute, like this:

valid="yes"

http://www.alfredfor...k-in-workflows/



#3 Jonas Eriksen

Jonas Eriksen

    Member

  • Member
  • PipPip
  • 115 posts
  • LocationDenmark

Posted 16 January 2013 - 12:54 AM

You are absolutely right.

But I think they should be removed all together, as"valid" is only making a difference if

valid="no"

Thanks for pointing it out :)


  • Tyler Eich likes this

#4 David Ferguson

David Ferguson

    Alfred Guru

  • Staff
  • 1,804 posts
  • LocationHuntsville, AL

Posted 16 January 2013 - 01:26 AM

Nice set of workflows. I made some of these myself but didn't release them. Great work!


Twitter: jdfwarrior | Blog: dferg.us

#5 Adeiko

Adeiko

    Newbie

  • Member
  • Pip
  • 7 posts

Posted 22 January 2013 - 09:37 PM

Love the Finder settings one, i use show hidden icons all the time. But i also use TotalFinder, and when it relaunches the Finder it doesn't open with it. 

 

Is there a way you could add a line to the workflow so it opens totalfinder after restarting the finder? 



#6 Jonas Eriksen

Jonas Eriksen

    Member

  • Member
  • PipPip
  • 115 posts
  • LocationDenmark

Posted 25 January 2013 - 06:58 PM

TotalFinder has a shortcut for showing/hiding hidden files (TotalFinder calls then system files) the default shortcut is: command + Shift + . 

 

I think this is the best option when using TotalFinder as it is a little slow at starting up.



#7 Shawn Rice

Shawn Rice

    Advanced Member

  • Member
  • PipPipPip
  • 557 posts
  • LocationBrooklyn, NY

Posted 25 February 2013 - 10:17 AM

The Wifi Toggle Link is missing a hyphen.

 

Here's the new one: https://github.com/a....alfredworkflow


Find and share your workflows and themes on www.packal.org.

Some Shared Workflows: Caffeinate Control | Alfred Bundler | Alfred CronWorkflows Help Workflow | F.luxBarrel Roll | Sudoers
Web: Github


#8 civilian

civilian

    Member

  • Member
  • PipPip
  • 41 posts

Posted 25 February 2013 - 10:32 AM

Is it possible to select a wifi network from the available networks ? currently, the Wifi Toggle workflow is showing the selected network and the IP address as shown in the screenshot of the workflow.



#9 Jonas Eriksen

Jonas Eriksen

    Member

  • Member
  • PipPip
  • 115 posts
  • LocationDenmark

Posted 25 February 2013 - 01:17 PM

Is it possible to select a wifi network from the available networks ? currently, the Wifi Toggle workflow is showing the selected network and the IP address as shown in the screenshot of the workflow.

 

This is on the drawing board along with more details about the current network... stay tuned  :)



#10 cortig

cortig

    Member

  • Member
  • PipPip
  • 40 posts

Posted 25 February 2013 - 07:29 PM

Nice workflows!!

I'm having problems with the Switch User workflow though.

I see it's looking for users in group 20 (staff) and therefore lists a number of active services (eg: Notification center, Calendar server, etc) if you're running Mac OS X Server.

It might be a good isea to exclude all com.apple.* “users” from the list  :)

 

 

          Corentin


#11 Jonas Eriksen

Jonas Eriksen

    Member

  • Member
  • PipPip
  • 115 posts
  • LocationDenmark

Posted 25 February 2013 - 11:13 PM

Nice workflows!!

I'm having problems with the Switch User workflow though.

I see it's looking for users in group 20 (staff) and therefore lists a number of active services (eg: Notification center, Calendar server, etc) if you're running Mac OS X Server.

It might be a good isea to exclude all com.apple.* “users” from the list  :)

 

 

          Corentin

 

I have found another (hopefully better) way of listing user accounts. Give it a try and please report back if it does not work as intended.

 

https://github.com/a....alfredworkflow

 

( I have changed the workflow bundle id, so you have uninstall the old version of the workflow yourself )

 

Cheers,

Jonas



#12 Shawn Rice

Shawn Rice

    Advanced Member

  • Member
  • PipPipPip
  • 557 posts
  • LocationBrooklyn, NY

Posted 26 February 2013 - 01:29 AM

Here are two commands that might be able to help out here:

 

List all the available networks:

 

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s
 

 

 

Command to switch to a particular network in applescript:

 

do shell script "/usr/sbin/networksetup -switchtolocation 'NETWORKNAME' "
 

Find and share your workflows and themes on www.packal.org.

Some Shared Workflows: Caffeinate Control | Alfred Bundler | Alfred CronWorkflows Help Workflow | F.luxBarrel Roll | Sudoers
Web: Github


#13 morphorod

morphorod

    Newbie

  • Member
  • Pip
  • 15 posts

Posted 26 February 2013 - 03:13 AM

Nice set of workflows. I made some of these myself but didn't release them. Great work!

What else are you hiding from us?  ;)



#14 Jonas Eriksen

Jonas Eriksen

    Member

  • Member
  • PipPip
  • 115 posts
  • LocationDenmark

Posted 26 February 2013 - 07:48 AM

Here are two commands that might be able to help out here:

 

List all the available networks:

 

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s
 

 

 

Command to switch to a particular network in applescript:

 

do shell script "/usr/sbin/networksetup -switchtolocation 'NETWORKNAME' "
 

 

If you take a look at the workflow script you will see that I already use

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport  :)

 

'networksetup -switchtolocation' Changes the Network Location, not the Wi-Fi network. You should see my Network Location Workflow for that functionality...

For changing the Wi-Fi network you should use 'networksetup -setairportnetwork' it requires a device name, network name and password.

 

There is some issues with implementing this, first there is a 3 seconds delay to scan for networks. Second there need to be a way for requesting a password for the network. I'm still looking into how this could be implemented best...

 

Cheers,

Jonas



#15 cortig

cortig

    Member

  • Member
  • PipPip
  • 40 posts

Posted 26 February 2013 - 02:10 PM

I have found another (hopefully better) way of listing user accounts. Give it a try and please report back if it does not work as intended.

 

https://github.com/a....alfredworkflow

 

( I have changed the workflow bundle id, so you have uninstall the old version of the workflow yourself )

 

Cheers,

Jonas

 

 

This one works great. It only lists real users.

On 10.7 it looks as intended, but for some reason, on 10.8 it lists all users and  adds “(Logged in)” at the end (even though that's not the case — they're not logged in). e.g.:

RealName: Bob (Logged In)

 

Not super critical, but I thought it was worth mentioning,

 

 

          Corentin


#16 Jonas Eriksen

Jonas Eriksen

    Member

  • Member
  • PipPip
  • 115 posts
  • LocationDenmark

Posted 26 February 2013 - 04:31 PM

This one works great. It only lists real users.

On 10.7 it looks as intended, but for some reason, on 10.8 it lists all users and  adds “(Logged in)” at the end (even though that's not the case — they're not logged in). e.g.:

RealName: Bob (Logged In)

 

Not super critical, but I thought it was worth mentioning,

 

 

          Corentin

 

Hmm this sounds weird, the workflow writes "(logged in)" on users who are listed by the "who" command. I made a small mistake so it will also match a username that is a subset of another username that is logged in... But otherwise it should reliable identify logged in users...

I will correct the mistake when I come home.



#17 cortig

cortig

    Member

  • Member
  • PipPip
  • 40 posts

Posted 26 February 2013 - 05:10 PM

Hmm this sounds weird, the workflow writes "(logged in)" on users who are listed by the "who" command. I made a small mistake so it will also match a username that is a subset of another username that is logged in... But otherwise it should reliable identify logged in users...

I will correct the mistake when I come home.

Well I checked with who on my Mac and everything there is right, plus the other usernames appearing as logged-in are not subsets of the other ones.

I posted a capture (removing the usernames) here.

 

On the capture, only the first user is logged in.

This part of the script is not excluding entries that get 0 through who:

 

        # check if the user is logged in, if so then add (logged in) to the name


        if [[ $(who | grep -c "$USERNAME ") -gt 0 ]]


            then


            LOGINSTATUS=" (Logged In)"


        fi

 

 

It also looks like the syntax of the entries doesn't match the one on your first capture (e.g.: $RealName is not parsed as my real name):

 

        # fuzzymatch with real name and username 


        if [[ " $REALNAME" == *\ $QUERY* || $USERNAME == $QUERY* ]]


            then


            # if match is found display the user


            echo "<item uid=\"fastuserswitch $USERNAME\" arg=\"$USERNAME\">"


            echo "<title>$REALNAME$LOGINSTATUS</title><subtitle>Switch to $REALNAME</subtitle>"


            echo "<icon>$PICTURE</icon></item>"


        fi

 
 
Corentin


#18 Jonas Eriksen

Jonas Eriksen

    Member

  • Member
  • PipPip
  • 115 posts
  • LocationDenmark

Posted 26 February 2013 - 09:25 PM

Well I checked with who on my Mac and everything there is right, plus the other usernames appearing as logged-in are not subsets of the other ones.

I posted a capture (removing the usernames) here.

 

On the capture, only the first user is logged in.

This part of the script is not excluding entries that get 0 through who:

 

        # check if the user is logged in, if so then add (logged in) to the name


        if [[ $(who | grep -c "$USERNAME ") -gt 0 ]]


            then


            LOGINSTATUS=" (Logged In)"


        fi

 

 

It also looks like the syntax of the entries doesn't match the one on your first capture (e.g.: $RealName is not parsed as my real name):

 

        # fuzzymatch with real name and username 


        if [[ " $REALNAME" == *\ $QUERY* || $USERNAME == $QUERY* ]]


            then


            # if match is found display the user


            echo "<item uid=\"fastuserswitch $USERNAME\" arg=\"$USERNAME\">"


            echo "<title>$REALNAME$LOGINSTATUS</title><subtitle>Switch to $REALNAME</subtitle>"


            echo "<icon>$PICTURE</icon></item>"


        fi

 
 
Corentin

 

I don't understand what is not working for you... You get the list of users on your system and the name of the users are correct?

But then you get "(logged in)" on all of them?

And when you type "who" into terminal.app you only see a list of the users who is logged in?



#19 cortig

cortig

    Member

  • Member
  • PipPip
  • 40 posts

Posted 26 February 2013 - 09:30 PM

I have 4 user accounts on this Mac (with completely different names). The workflow lists them all, telling me they are all logged-in. who lists 2 (which reflects the reality).

In addition, instead of displaying something like "Switch to Bob", as on your capture, it says "Switch to RealName: Bob".

 

 

          Corentin


#20 Jonas Eriksen

Jonas Eriksen

    Member

  • Member
  • PipPip
  • 115 posts
  • LocationDenmark

Posted 27 February 2013 - 12:16 PM

I have updated Fast User Switching which fixes the "(logged in)" and "RealName:" issues.

 

https://github.com/a....alfredworkflow




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users