# Action to Show/Hide desktop icons

**URL:** <https://community.folivora.ai/t/action-to-show-hide-desktop-icons/28089>\
**Category:** Feature Requests\
**Tags:** keyboard, desktop\
**Created:** [August 18, 2022, 3:01pm UTC](https://community.folivora.ai/t/action-to-show-hide-desktop-icons/28089 "2022-08-18T15:01:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Radu](https://community.folivora.ai/user_avatar/community.folivora.ai/radu/32/12686_2.png) [@Radu](https://community.folivora.ai/u/Radu)\
**Post date:** [August 18, 2022, 3:01pm UTC](https://community.folivora.ai/t/action-to-show-hide-desktop-icons/28089/1 "2022-08-18T15:01:26Z")

</div>

Hi there,

I would love to configure a shortcut that toggles showing/hiding my desktop icons. Whenever I share my screen with colleagues, I would love to quickly hide all icons on my desktop.

This can be achieved with the following script:

```auto
defaults write com.apple.finder CreateDesktop false
killall Finder

```

The only problem right now is that I have to assign two shortcuts executing shell commands, one to show and one to hide the icons.

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [August 18, 2022, 3:06pm UTC](https://community.folivora.ai/t/action-to-show-hide-desktop-icons/28089/2 "2022-08-18T15:06:00Z")

</div>

If that's the only issue, you can use the "Cycle though multiple actions (on repeated trigger)" helper action. It allows you to execute different stuff when triggering a trigger multiple times.

---

<div class="post-metadata">

**Author:** ![Radu](https://community.folivora.ai/user_avatar/community.folivora.ai/radu/32/12686_2.png) [@Radu](https://community.folivora.ai/u/Radu)\
**Post date:** [August 18, 2022, 7:01pm UTC](https://community.folivora.ai/t/action-to-show-hide-desktop-icons/28089/3 "2022-08-18T19:01:23Z")

</div>

Thanks a lot for your quick reply, this is brilliant! 😄 Wasn't aware of this helper action.

This solved my problem, although it might sitll be nice to have show/hide desktop icons as a predefined action - it offers some privacy in times of remote work and lots of screen sharing 😊

---

<div class="post-metadata">

**Author:** ![Targumanu](https://community.folivora.ai/user_avatar/community.folivora.ai/targumanu/32/216_2.png) [@Targumanu](https://community.folivora.ai/u/Targumanu)\
**Post date:** [September 4, 2022, 7:51pm UTC](https://community.folivora.ai/t/action-to-show-hide-desktop-icons/28089/4 "2022-09-04T19:51:50Z")

</div>

IMO, a more reliable solution would be to invert the current desktop state by extending your script a bit:

```auto
state=$(defaults read com.apple.finder CreateDesktop)
((state ^= 1))
defaults write com.apple.finder CreateDesktop $state
killall Finder

```

And this way you won't have to assign a second shortcut

---

<div class="post-metadata">

**Author:** ![Radu](https://community.folivora.ai/user_avatar/community.folivora.ai/radu/32/12686_2.png) [@Radu](https://community.folivora.ai/u/Radu)\
**Post date:** [September 9, 2022, 2:23pm UTC](https://community.folivora.ai/t/action-to-show-hide-desktop-icons/28089/5 "2022-09-09T14:23:49Z")

</div>

Awesome, thanks!

---

<div class="post-metadata">

**Author:** ![CarlosUnch](https://community.folivora.ai/user_avatar/community.folivora.ai/carlosunch/32/19129_2.png) [@CarlosUnch](https://community.folivora.ai/u/CarlosUnch)\
**Post date:** [November 6, 2024, 5:33pm UTC](https://community.folivora.ai/t/action-to-show-hide-desktop-icons/28089/6 "2024-11-06T17:33:12Z")

</div>

So helpful, thanks!!
