Gnome2::Client(3)

πŸ“¦
version 1.048 Β· 2 versions
, in fedora 43

πŸ’– Gnome2::Client πŸ’–

okay bestie, gather round, because this one is a whole wrapper for GnomeClient and she is serving session-management realness. it's Gnome2::Client, she lives in the User Contributed Perl Documentation section of your man pages, and she's about to tell your app how to behave when the whole desktop session is doing its little save-yourself dance. no cap. πŸŽ€


🌈 HIERARCHY 🌈

the family tree, and yes she is descended from greatness:

Glib::Object
+----Glib::InitiallyUnowned
     +----Gtk2::Object
          +----Gnome2::Client

so like, she's a Gtk2::Object at heart, which is a Glib::InitiallyUnowned, which is a Glib::Object. iconic lineage fr fr πŸ‘‘


✨ METHODS ✨

every single one, no skipping, we don't do that here πŸ’…

  • client = Gnome2::Client->new β€” makes you a fresh client, fully connected and everything πŸ¦‹
  • client = Gnome2::Client->new_without_connection β€” same vibe, except she does not connect. antisocial queen behavior, but make it intentional.
  • $client->add_static_arg (...) β€” adds a static arg. the args are a list:
    • ... (list)
  • $client->set_clone_command (...) β€” sets the clone command, because sometimes you gotta be cloned:
    • ... (list)
  • string = $client->get_config_prefix β€” hands you the config prefix as a string 🌸
  • $client->connect β€” connect! that's it. that's the whole thing.
  • boolean = $client->connected β€” are we connected? boolean, bestie. true or false, no in-between.
  • $client->set_current_directory ($dir) β€” tell her where you live:
    • $dir (string)
  • string = $client->get_desktop_id β€” returns your desktop id, as a string ⭐
  • $client->set_discard_command (...) β€” the discard command. for when we're discarding:
    • ... (list)
  • $client->disconnect β€” bye! disconnect. we love a clean exit 🫢
  • $client->set_environment ($name, $value) β€” sets an environment variable, name and value style:
    • $name (string)
    • $value (string)
  • clientflags = $client->get_flags β€” gives you back a clientflags (that's a Gnome2::ClientFlags, see below πŸ‘‡)
  • $client->flush β€” flush it. do it. πŸ’…
  • string = $client->get_global_config_prefix β€” the global config prefix, as a string. she's international.
  • $client->set_global_config_prefix ($prefix) β€” set that global config prefix:
    • $prefix (string)
  • string = $client->get_id β€” your id! as a string! everyone needs an id ✨
  • Gnome2::Client->interaction_key_return ($key, $cancel_shutdown) β€” class method, returning an interaction key:
    • $key (integer)
    • $cancel_shutdown (boolean)
  • client = Gnome2::Client->master β€” returns the master client. main character energy, literally πŸ‘‘
  • string = $client->get_previous_id β€” the id from before, as a string. her ex, basically πŸ™ˆ
  • $client->set_priority ($priority) β€” set your priority, because some of us are simply more important:
    • $priority (integer)
  • $client->request_interaction ($dialog_type, $function, $data=undef) β€” request an interaction, note that $data defaults to undef:
    • $dialog_type (Gnome2::DialogType)
    • $function (scalar)
    • $data (scalar)
  • $client->request_phase_2 β€” phase two!! we made it to phase two πŸŽ‰
  • $client->request_save ($save_style, $shutdown, $interact_style, $fast, $global) β€” request a save, with a whole squad of args:
    • $save_style (Gnome2::SaveStyle)
    • $shutdown (boolean)
    • $interact_style (Gnome2::InteractStyle)
    • $fast (boolean)
    • $global (boolean)
  • $client->set_resign_command (...) β€” the resign command. she's resigning. respect it:
    • ... (list)
  • $client->set_restart_command (...) β€” the restart command, for the comeback era:
    • ... (list)
  • $client->set_restart_style ($style) β€” set how you want to restart:
    • $style (Gnome2::RestartStyle)
  • $client->save_any_dialog ($dialog) β€” save-any dialog time:
    • $dialog (Gtk2::Dialog)
  • $client->save_error_dialog ($dialog) β€” save-error dialog time. it happens to the best of us 😭
    • $dialog (Gtk2::Dialog)
  • $client->set_shutdown_command (...) β€” the shutdown command, last but not least:
    • ... (list)

πŸ”” SIGNALS πŸ””

these are the moments she'll yell at you about. connect accordingly, bestie.

  • connect (Gnome2::Client, boolean)
  • die (Gnome2::Client)
  • disconnect (Gnome2::Client)
  • save-complete (Gnome2::Client)
  • boolean = save-yourself (Gnome2::Client, integer, Gnome2::SaveStyle, boolean, Gnome2::InteractStyle, boolean)
  • shutdown-cancelled (Gnome2::Client)

🧚 ENUMS AND FLAGS 🧚

the vibes catalogue. perl name first, C name after the slash, exactly as written, don't @ me πŸ’œ

flags Gnome2::ClientFlags

  • 'is-connected' / 'GNOME_CLIENT_IS_CONNECTED'
  • 'restarted' / 'GNOME_CLIENT_RESTARTED'
  • 'restored' / 'GNOME_CLIENT_RESTORED'

enum Gnome2::DialogType

  • 'error' / 'GNOME_DIALOG_ERROR'
  • 'normal' / 'GNOME_DIALOG_NORMAL'

enum Gnome2::InteractStyle

  • 'none' / 'GNOME_INTERACT_NONE'
  • 'errors' / 'GNOME_INTERACT_ERRORS'
  • 'any' / 'GNOME_INTERACT_ANY'

enum Gnome2::RestartStyle

  • 'if-running' / 'GNOME_RESTART_IF_RUNNING'
  • 'anyway' / 'GNOME_RESTART_ANYWAY'
  • 'immediately' / 'GNOME_RESTART_IMMEDIATELY'
  • 'never' / 'GNOME_RESTART_NEVER'

enum Gnome2::SaveStyle

  • 'global' / 'GNOME_SAVE_GLOBAL'
  • 'local' / 'GNOME_SAVE_LOCAL'
  • 'both' / 'GNOME_SAVE_BOTH'

πŸ‘€ SEE ALSO πŸ‘€

go read these next, iykyk:

  • Gnome2
  • Glib::Object
  • Glib::InitiallyUnowned
  • Gtk2::Object

Copyright (C) 2003-2004 by the gtk2-perl team.

This software is licensed under the LGPL. See Gnome2 for a full notice.

no cap, that LGPL bit matters β€” go read Gnome2 if you want the whole legal situation πŸ’–

and that's the whole page, bestie!! this one shipped as part of perl v5.42.0, dated 2025-07-25, and it says so right there in the footer. slay, go save a session πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from