Skip to main content

vibe_desktop_shortcut 0.1.1 copy "vibe_desktop_shortcut: ^0.1.1" to clipboard
vibe_desktop_shortcut: ^0.1.1 copied to clipboard

PlatformLinux

Registers a system-wide keyboard shortcut that runs a command on Linux desktops (KDE Plasma, GNOME, Hyprland), with conflict check and read-back verification.

example/vibe_desktop_shortcut_example.dart

import 'package:vibe_desktop_shortcut/vibe_desktop_shortcut.dart';

Future<void> main() async {
  final registrar = ShortcutRegistrar();
  final spec = ShortcutSpec(
    id: 'myapp-quick',
    name: 'MyApp Quick Access',
    executable: '/usr/bin/myapp',
    args: ['--quick'],
  );
  final key = KeyCombo.parse('Ctrl+Alt+K')!;

  print('desktop: ${registrar.desktop.name}');
  final result = await registrar.apply(spec, key);
  switch (result.status) {
    case RegistrationStatus.registered:
      print('done');
    case RegistrationStatus.written:
      print('saved, but log out and in to load it');
    case RegistrationStatus.conflict:
      print('already used by: ${result.conflicts.join(', ')}');
    case RegistrationStatus.manual:
      print('bind this command yourself: ${result.command}');
    case RegistrationStatus.missing:
      print('not registered');
  }
  if (result.note.isNotEmpty) print(result.note);
}
0
likes
160
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Registers a system-wide keyboard shortcut that runs a command on Linux desktops (KDE Plasma, GNOME, Hyprland), with conflict check and read-back verification.

Repository (GitHub)
View/report issues

Topics

#linux #shortcut #hotkey #desktop

License

MIT (license)

More

Packages that depend on vibe_desktop_shortcut