Desktop commands | vasak-desktop
Commands implemented in vasak-desktop that new desktop features can use
Audio#
get_audio_volume()- Get the current volumeset_audio_volume(volume: u32)- Set the volumetoggle_audio_mute()- Toggle muteget_audio_devices()- List audio devicesset_audio_device(device_id: String)- Switch devicetoggle_audio_applet()- Show/hide the audio applet
Brightness#
get_brightness_info()- Current brightness informationset_brightness_info(brightness: u32)- Set the brightness
Notifications#
send_notify(notification: NotificationData)- Send a notificationclear_notifications()- Clear all notificationsget_all_notifications()- Get the list of notificationsdelete_notification(id: String)- Delete a specific notificationinvoke_notification_action(id: String, action: String)- Run an action
Network#
toggle_network_applet()- Show/hide the network applet
Bluetooth#
toggle_bluetooth_applet()- Show/hide the Bluetooth applet
Music (MPRIS)#
music_play_pause()- Play/Pausemusic_next_track()- Next trackmusic_previous_track()- Previous trackmusic_now_playing()- Current track information
Search#
Global search is no longer part of vasak-desktop: it lives in the launcher,
vasak-prism
, a separate
application that stays resident. The global_search, execute_search_result
and toggle_search commands left the desktop with
vasak-desktop#104
and
can no longer be invoked from the frontend.
What the desktop keeps is a D-Bus forward: the OpenSearch and
ToggleSearch methods of the org.vasak.os.Desktop service still exist so
that a shortcut, script or configuration that still calls them does not go
dead. They do not run the search: they call the launcher’s Toggle method,
which shows or hides its window.
| Bus name | Object | Interface | Method | |
|---|---|---|---|---|
| Desktop (forwards) | org.vasak.os.Desktop | any | any | OpenSearch, ToggleSearch |
| Launcher (target) | ar.net.vasak.Prism | /ar/net/vasak/Prism | ar.net.vasak.Prism | Toggle |
| |
The desktop service handles everything addressed to its name without looking
at the object or the interface, so the path in the first example is a
convention, not a requirement. Since vasak-desktop 1.64.1 every method of the
service replies, so the call returns right away. What it replies depends on the
method:
ListWindowsreturns the window list as JSON.PresentWindow,OpenMenu,OpenControlCenter,OpenWallpaperPicker,PauseWallpaperandResumeWallpaperperform the action before replying: an empty return if it worked,org.vasak.os.Desktop.Errorwith the reason if not.OpenSearch,ToggleSearch,OpenSessionPopup,PowerButtonPressed,ClearScreenTimeandPresentAppkeep working in another task, so they reply with an empty return as soon as the request is dispatched. If something fails afterwards —for instance, the forward tovasak-prism— it is logged by the desktop, not reported in the reply.PresentWindowandPresentAppwithout the argument they expect returnorg.freedesktop.DBus.Error.InvalidArgs.- A name the service does not have returns
org.freedesktop.DBus.Error.UnknownMethod.
Callers that ask for no reply (--expect-reply=no in busctl, or dbus-send
without --print-reply) keep working the same: they get none. Before 1.64.1
almost no method replied, and a call without that flag hung until the D-Bus
timeout. The launcher installs a D-Bus activation file:
if it is not running, the bus starts it on that same call. If vasak-prism is
not installed, the forward fails and the desktop logs it without crashing. The
launcher also exposes Show and Hide on the same object.
Keyboard Shortcuts#
get_shortcuts()- Get all shortcutsupdate_shortcut(id: String, new_keys: Vec<String>)- Update a shortcutadd_custom_shortcut(shortcut: CustomShortcut)- Add a custom shortcutdelete_shortcut(id: String)- Delete a shortcutexecute_shortcut(command: String)- Run a shortcut commandcheck_shortcut_conflicts(keys: Vec<String>)- Check for conflicts
System#
get_system_info()- System informationget_cpu_usage_only()- CPU usageget_memory_usage_only()- Memory usageget_system_config()- System configurationset_system_config(config: SystemConfig)- Set the configurationget_current_system_state()- Current system state
Theme#
toggle_system_theme()- Toggle dark/light themeget_gtk_themes()- List the available GTK themesget_cursor_themes()- List the cursor themesget_icon_packs()- List the icon packs
Session#
logout()- Log outshutdown()- Shut down the systemreboot()- Reboot the systemsuspend()- Suspend the systemdetect_display_server()- Detect X11/Wayland
Location: All of these commands are defined in src-tauri/src/commands/ and registered in src-tauri/src/lib.rs.