Permalink
Browse files

Source files - init commit

  • Loading branch information...
aiyodk committed Mar 24, 2013
1 parent 7536206 commit e6fb706371aa04943b7423bf71e87920b0eb1276
Showing with 1,763 additions and 0 deletions.
  1. BIN AlfredApp_2.x/AppCleaner/source/icon.png
  2. +156 −0 AlfredApp_2.x/AppCleaner/source/info.plist
  3. +81 −0 AlfredApp_2.x/Fast-User-Switching/source/fastUserSwitching.sh
  4. BIN AlfredApp_2.x/Fast-User-Switching/source/icon.png
  5. +136 −0 AlfredApp_2.x/Fast-User-Switching/source/info.plist
  6. BIN AlfredApp_2.x/Finder-Settings/source/F6C3BD5E-67E1-4F65-A7DC-474BE5657ED0.png
  7. +54 −0 AlfredApp_2.x/Finder-Settings/source/desktopSettings.sh
  8. +62 −0 AlfredApp_2.x/Finder-Settings/source/finderSettings.sh
  9. BIN AlfredApp_2.x/Finder-Settings/source/icon.png
  10. +201 −0 AlfredApp_2.x/Finder-Settings/source/info.plist
  11. BIN AlfredApp_2.x/Network-Location/source/icon.png
  12. +93 −0 AlfredApp_2.x/Network-Location/source/info.plist
  13. +36 −0 AlfredApp_2.x/Network-Location/source/networklocation.sh
  14. BIN AlfredApp_2.x/Send-URL/source/Adium.png
  15. +104 −0 AlfredApp_2.x/Send-URL/source/actionURL.sh
  16. +30 −0 AlfredApp_2.x/Send-URL/source/cacheApps.sh
  17. +44 −0 AlfredApp_2.x/Send-URL/source/createLink.sh
  18. +54 −0 AlfredApp_2.x/Send-URL/source/getURL.sh
  19. BIN AlfredApp_2.x/Send-URL/source/gmail.png
  20. BIN AlfredApp_2.x/Send-URL/source/icon.png
  21. +137 −0 AlfredApp_2.x/Send-URL/source/info.plist
  22. BIN AlfredApp_2.x/Send-URL/source/instapaper.png
  23. +28 −0 AlfredApp_2.x/Send-URL/source/mobilize.sh
  24. BIN AlfredApp_2.x/Send-URL/source/scpt/fetchURLfromCamino.scpt
  25. BIN AlfredApp_2.x/Send-URL/source/scpt/fetchURLfromChrome.scpt
  26. BIN AlfredApp_2.x/Send-URL/source/scpt/fetchURLfromChromeCanary.scpt
  27. BIN AlfredApp_2.x/Send-URL/source/scpt/fetchURLfromOmniWeb.scpt
  28. BIN AlfredApp_2.x/Send-URL/source/scpt/fetchURLfromOpera.scpt
  29. BIN AlfredApp_2.x/Send-URL/source/scpt/fetchURLfromSafari.scpt
  30. BIN AlfredApp_2.x/Send-URL/source/scpt/fetchURLfromWebKit.scpt
  31. BIN AlfredApp_2.x/Send-URL/source/scpt/getFrontMostApp.scpt
  32. +165 −0 AlfredApp_2.x/Send-URL/source/sendURL.sh
  33. +21 −0 AlfredApp_2.x/Send-URL/source/supportedApplications.txt
  34. BIN AlfredApp_2.x/VirtualBox-Control/source/debian.png
  35. BIN AlfredApp_2.x/VirtualBox-Control/source/fedora.png
  36. BIN AlfredApp_2.x/VirtualBox-Control/source/freebsd.png
  37. BIN AlfredApp_2.x/VirtualBox-Control/source/icon.png
  38. +101 −0 AlfredApp_2.x/VirtualBox-Control/source/info.plist
  39. BIN AlfredApp_2.x/VirtualBox-Control/source/linux.png
  40. BIN AlfredApp_2.x/VirtualBox-Control/source/netbsd.png
  41. BIN AlfredApp_2.x/VirtualBox-Control/source/openbsd.png
  42. BIN AlfredApp_2.x/VirtualBox-Control/source/osx.png
  43. BIN AlfredApp_2.x/VirtualBox-Control/source/redhat.png
  44. BIN AlfredApp_2.x/VirtualBox-Control/source/suse.png
  45. BIN AlfredApp_2.x/VirtualBox-Control/source/ubuntu.png
  46. +260 −0 AlfredApp_2.x/VirtualBox-Control/source/virtualbox_control.sh
  47. BIN AlfredApp_2.x/VirtualBox-Control/source/windows.png
Binary file not shown.
@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>dk.aiyo.appcleaner.v1</string>
<key>connections</key>
<dict>
<key>28CDA04A-2D3E-422F-A22B-D3B8CF2E05AC</key>
<array>
<dict>
<key>destinationuid</key>
<string>9A53B542-4862-4723-A0CF-DF537C09D56A</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
</dict>
</array>
<key>8FCE9436-F5EC-4650-9F97-0DD1338123B4</key>
<array>
<dict>
<key>destinationuid</key>
<string>9A53B542-4862-4723-A0CF-DF537C09D56A</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
</dict>
</array>
<key>9A53B542-4862-4723-A0CF-DF537C09D56A</key>
<array/>
</dict>
<key>createdby</key>
<string>Jonas Eriksen</string>
<key>description</key>
<string></string>
<key>disabled</key>
<false/>
<key>name</key>
<string>Uninstall with AppCleaner</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>acceptsmulti</key>
<false/>
<key>filetypes</key>
<array>
<string>com.apple.application-bundle</string>
<string>com.apple.dashboard-widget</string>
<string>com.apple.plugin</string>
</array>
<key>name</key>
<string>Uninstall with AppCleaner</string>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.action</string>
<key>uid</key>
<string>28CDA04A-2D3E-422F-A22B-D3B8CF2E05AC</string>
</dict>
<dict>
<key>config</key>
<dict>
<key>escaping</key>
<integer>63</integer>
<key>script</key>
<string>open -a /Applications/AppCleaner.app {query}</string>
<key>type</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.action.script</string>
<key>uid</key>
<string>9A53B542-4862-4723-A0CF-DF537C09D56A</string>
</dict>
<dict>
<key>config</key>
<dict>
<key>anchorfields</key>
<true/>
<key>daterange</key>
<integer>0</integer>
<key>fields</key>
<array>
<dict>
<key>field</key>
<string>kMDItemDisplayName</string>
<key>not</key>
<false/>
<key>split</key>
<true/>
<key>value</key>
<string>{query}</string>
<key>words</key>
<true/>
</dict>
<dict>
<key>field</key>
<string>kMDItemFinderComment</string>
<key>not</key>
<false/>
<key>split</key>
<true/>
<key>value</key>
<string>{query}</string>
<key>words</key>
<true/>
</dict>
</array>
<key>includesystem</key>
<false/>
<key>keyword</key>
<string>uninstall</string>
<key>scopes</key>
<array/>
<key>title</key>
<string>Uninstall with AppCleaner</string>
<key>types</key>
<array>
<string>com.apple.application-bundle</string>
<string>com.apple.dashboard-widget</string>
<string>com.apple.plugin</string>
</array>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.filefilter</string>
<key>uid</key>
<string>8FCE9436-F5EC-4650-9F97-0DD1338123B4</string>
</dict>
</array>
<key>uidata</key>
<dict>
<key>28CDA04A-2D3E-422F-A22B-D3B8CF2E05AC</key>
<dict>
<key>ypos</key>
<real>90</real>
</dict>
<key>8FCE9436-F5EC-4650-9F97-0DD1338123B4</key>
<dict>
<key>ypos</key>
<real>10</real>
</dict>
<key>9A53B542-4862-4723-A0CF-DF537C09D56A</key>
<dict>
<key>ypos</key>
<real>10</real>
</dict>
</dict>
<key>webaddress</key>
<string>www.aiyo.dk/alfredapp/v2</string>
</dict>
</plist>
@@ -0,0 +1,81 @@
#!/bin/bash

# we want case-insensitive matching
shopt -s nocasematch

# remove pending and trailing whitespace and replace other whitespace with *
QUERY=$(echo "$1" | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' -e 's/ /* /g')
# find out who is current user
ME=$(whoami)
# directory to store cached user icons
CACHEDIR="$(dscl . -read /Users/$ME/ NFSHomeDirectory | sed -e 's/^[^:]*: //')/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/dk.aiyo.fastUserSwitching"

echo "<?xml version=\"1.0\"?>"
echo "<items>"

# list user accounts
GUESTENABLED=$(defaults read /Library/Preferences/com.apple.loginwindow GuestEnabled)
USERS=$(dscl . -list /Users _writers_UserCertificate | sed 's/ .*$//')
for USERNAME in $USERS
do
# only list user who is not current and only list guest user if enabled
if [[ "$USERNAME" != "$ME" ]] && [[ "$USERNAME" != "Guest" || $GUESTENABLED == 1 ]]
then
# Get the real name of the account
REALNAME=$(dscl . -read /Users/$USERNAME/ RealName | tail -n 1 | sed -e 's/^RealName: //' -e 's/^ *//')

# user picture
# first check cache
let "TIME=$(date +%s)-600" # cached icon timeout - 10 minutes
if [[ -f "$CACHEDIR/$USERNAME.jpg" && $(stat -f "%m" "$CACHEDIR/$USERNAME.jpg") -ge $TIME ]]
then
PICTURE="$CACHEDIR/$USERNAME.jpg"
# if no recent cache then check for jpeg image
elif [[ ! -z $(dscl . -read "/Users/$USERNAME/" JPEGPhoto | head -1) ]]
then
# make directory for icon cache if it do not exists
if [[ ! -d "$CACHEDIR" ]]
then
mkdir "$CACHEDIR"
fi
# cache the user icon
dscl . -read "/Users/$USERNAME/" JPEGPhoto | tail -1 | xxd -r -p > "$CACHEDIR/$USERNAME.jpg"
# and get the path to the cache
PICTURE="$CACHEDIR/$USERNAME.jpg"
# if no jpeg image check for the Picture parameter
elif [[ ! -z $(dscl . -read "/Users/$USERNAME/" Picture | head -1) ]]
then
PICTURE=$(dscl . -read "/Users/$USERNAME/" Picture | tail -n 1 | sed 's/^[ \t]*//')
# if not picture - use default (workflow icon)
else
PICTURE="icon.png"
fi
# 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)"
else
LOGINSTATUS=""
fi
# 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</title><subtitle>Switch to $REALNAME $LOGINSTATUS</subtitle>"
echo "<icon>$PICTURE</icon></item>"
fi
fi
done

# login window
if [[ " Login Window" == *\ $QUERY* ]]
then
echo "<item uid=\"fastuserswitch LoginWindow\" arg=\"LoginWindow\">"
echo "<title>Login Window...</title><subtitle>Switch to Login Window</subtitle>"
echo "<icon>icon.png</icon></item>"
fi

echo "</items>"

shopt -u nocasematch
Binary file not shown.
@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>dk.aiyo.fastUserSwitching</string>
<key>connections</key>
<dict>
<key>43659F12-4996-4C4E-8544-4B8DA57DC6A7</key>
<array>
<dict>
<key>destinationuid</key>
<string>61A93C4D-8257-476D-BDAE-6FE3675347E7</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
</dict>
</array>
<key>61A93C4D-8257-476D-BDAE-6FE3675347E7</key>
<array>
<dict>
<key>destinationuid</key>
<string>EB837157-EB80-49AE-90A9-9FCB2EB1313A</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
</dict>
</array>
</dict>
<key>createdby</key>
<string>Jonas Eriksen</string>
<key>description</key>
<string>Quickly switch between accounts</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>Fast User Switching</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>escaping</key>
<integer>63</integer>
<key>script</key>
<string># CGSession
if [[ "{query}" == "LoginWindow" ]]
then
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend

else

/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -switchToUserID $(id -u "{query}")

fi</string>
<key>type</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.action.script</string>
<key>uid</key>
<string>EB837157-EB80-49AE-90A9-9FCB2EB1313A</string>
</dict>
<dict>
<key>config</key>
<dict>
<key>action</key>
<integer>0</integer>
<key>argument</key>
<integer>0</integer>
<key>hotkey</key>
<integer>0</integer>
<key>hotmod</key>
<integer>0</integer>
<key>hotstring</key>
<string></string>
<key>modsmode</key>
<integer>0</integer>
</dict>
<key>type</key>
<string>alfred.workflow.trigger.hotkey</string>
<key>uid</key>
<string>43659F12-4996-4C4E-8544-4B8DA57DC6A7</string>
</dict>
<dict>
<key>config</key>
<dict>
<key>argumenttype</key>
<integer>1</integer>
<key>escaping</key>
<integer>62</integer>
<key>keyword</key>
<string>switch user</string>
<key>script</key>
<string>sh fastUserSwitching.sh "{query}"</string>
<key>subtext</key>
<string>Quickly switch between accounts</string>
<key>title</key>
<string>Fast User Switching...</string>
<key>type</key>
<integer>0</integer>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>61A93C4D-8257-476D-BDAE-6FE3675347E7</string>
</dict>
</array>
<key>readme</key>
<string></string>
<key>uidata</key>
<dict>
<key>43659F12-4996-4C4E-8544-4B8DA57DC6A7</key>
<dict>
<key>ypos</key>
<real>10</real>
</dict>
<key>61A93C4D-8257-476D-BDAE-6FE3675347E7</key>
<dict>
<key>ypos</key>
<real>10</real>
</dict>
<key>EB837157-EB80-49AE-90A9-9FCB2EB1313A</key>
<dict>
<key>ypos</key>
<real>10</real>
</dict>
</dict>
<key>webaddress</key>
<string>www.aiyo.dk/alfredapp/v2</string>
</dict>
</plist>
Oops, something went wrong.

0 comments on commit e6fb706

Please sign in to comment.