Open Gnome Activities and Applications view with .desktop files

Is it possible to open Activities and Applications view in Gnome with two .desktop files that I can save in ~/.local/share/applications.


for Activities Overview to call from .desktop file, Create a file like callActivitiesView.desktop or any similar name with below content.

[Desktop Entry]
Type = Application
Name = callActivitiesView
Exec = gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval string:'Main.overview.toggle();'
Icon = emoji-people-symbolic

Note: for Icon field, you can put any absolute path as you wish or any system icon that is with known name.

for Applications view to call from .desktop file, Create a file like callApplicationsView.desktop or any similar name with below content.

[Desktop Entry]
Type = Application
Name = callApplicationsView
Exec = /usr/local/bin/cAV.sh
Icon = emoji-people-symbolic

and create a script file with executable permission (change the path to file as you wish) with the belwo content

#!/bin/bash

status=`gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'Main.overview.visible'`

if [ "$status" == "(true, 'false')" ]; then

dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.shellDBusService.ShowApplications()'
else
dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.hide()'
fi

enter image description here