Gnome2::Client(3)
π 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 aclientflags(that's aGnome2::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$datadefaults toundef:$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:
Gnome2Glib::ObjectGlib::InitiallyUnownedGtk2::Object
π COPYRIGHT π
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
- fedora 43: perl-Gnome2 1.048-18.fc43 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms