Skip to content

Instantly share code, notes, and snippets.

@willurd
Last active January 18, 2020 11:02
Show Gist options
  • Save willurd/5829224 to your computer and use it in GitHub Desktop.
Save willurd/5829224 to your computer and use it in GitHub Desktop.

Revisions

  1. willurd revised this gist Jun 22, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion set-wallpaper.sh
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,3 @@
    read -e IMAGE;
    defaults write com.apple.desktop Background "{default = {ImageFilePath='$IMAGE'; };}"; killall Dock
    defaults write com.apple.desktop Background "{default = {ImageFilePath='$IMAGE'; };}"
    killall Dock
  2. willurd revised this gist Jun 21, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions set-wallpaper.sh
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    read -e WLPR;
    defaults write com.apple.desktop Background "{default = {ImageFilePath='$WLPR'; };}"; killall Dock
    read -e IMAGE;
    defaults write com.apple.desktop Background "{default = {ImageFilePath='$IMAGE'; };}"; killall Dock
  3. willurd revised this gist Jun 21, 2013. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  4. willurd renamed this gist Jun 21, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. willurd revised this gist Jun 21, 2013. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,10 @@
    1. Open Automator and create a new Service
    2. Set "Service receives selected" to "image files"
    3. Add a "Run Shell Script" action to the workflow, remove the default script contents, and paste the `set-wallpaper.sh` script into it
    4. Save as "Set Wallpaper"
    4. Save as "Set as Wallpaper"

    The service should then be available to you when right-clicking image files. You can use an app like [Services Manager][1] to organize your image file services as well.
    The service should then be available to you when right-clicking image files. Right-clicking an image file (png, jpg, etc) in the Finder and choosing "Set as Wallpaper" will set that image as the Desktop Background image for all open Spaces. No need to quit apps or delete Spaces!

    You can use an app like [Services Manager][1] to organize your Finder context menus.

    [1]: http://www.macosxautomation.com/services/servicesmanager/
  6. willurd revised this gist Jun 21, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    1. Open Automator and create a new Service
    2. Set "Service receives selected" to "image files"
    3. Add a "Run Shell Script" action to the workflow and paste the `set-wallpaper.sh` script into it
    3. Add a "Run Shell Script" action to the workflow, remove the default script contents, and paste the `set-wallpaper.sh` script into it
    4. Save as "Set Wallpaper"

    The service should then be available to you when right-clicking image files. You can use an app like [Services Manager][1] to organize your image file services as well.
  7. willurd created this gist Jun 21, 2013.
    10 changes: 10 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # Instructions

    1. Open Automator and create a new Service
    2. Set "Service receives selected" to "image files"
    3. Add a "Run Shell Script" action to the workflow and paste the `set-wallpaper.sh` script into it
    4. Save as "Set Wallpaper"

    The service should then be available to you when right-clicking image files. You can use an app like [Services Manager][1] to organize your image file services as well.

    [1]: http://www.macosxautomation.com/services/servicesmanager/
    2 changes: 2 additions & 0 deletions set-wallpaper.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    read -e WLPR;
    defaults write com.apple.desktop Background "{default = {ImageFilePath='$WLPR'; };}"; killall Dock