Skip to content

Commit

Permalink
Change "toggle" to conditional "show/hide" for desktop icons
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-pennyworth committed Jun 1, 2021
1 parent cbbd163 commit c7fe96b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
Binary file modified icons/annotate-and-pin.sketch
Binary file not shown.
Binary file added icons/hide-desktop-icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/show-desktop-icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ open -g "cleanshot://$1"</string>
<key>variablesdontexport</key>
<array/>
<key>version</key>
<string>0.0.3</string>
<string>0.0.4</string>
<key>webaddress</key>
<string>https://github.com/mr-pennyworth/alfred-cleanshot</string>
</dict>
Expand Down
29 changes: 26 additions & 3 deletions items.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
#!/bin/bash

# CleanShot X hides desktop icons by creating
# a window that spans the entire screen and has
# the same background as the wallpaper.
function desktopIconsVisible() {
osascript -l JavaScript <<EOF | grep 0 > /dev/null
Application("System Events")
.applicationProcesses.byName("CleanShot X")
.windows()
.length
EOF
}

if desktopIconsVisible; then
toggle_icons_title="Toggle Desktop Icons: Hide"
toggle_icons_subtitle="Hide clutter on your Desktop."
toggle_icons_icon_path="hide-desktop-icons.png"
else
toggle_icons_title="Toggle Desktop Icons: Show"
toggle_icons_subtitle="Show previously hidden icons on your Desktop."
toggle_icons_icon_path="show-desktop-icons.png"
fi


cat <<EOF
{
"items": [
Expand Down Expand Up @@ -121,11 +144,11 @@ cat <<EOF
"uid": "self-timer"
},
{
"title": "Toggle Desktop Icons",
"subtitle": "Hide clutter on your Desktop.",
"title": "$toggle_icons_title",
"subtitle": "$toggle_icons_subtitle",
"arg": "toggle-desktop-icons",
"icon": {
"path": "icons/toggle-desktop-icons.png"
"path": "icons/$toggle_icons_icon_path"
},
"uid": "toggle-desktop-icons"
}
Expand Down

0 comments on commit c7fe96b

Please sign in to comment.