برای برنامههای مستقل این امکان را ندیدم. بعضی مدیر پنجرهها این امکان را شاید به کاربر بدهند اما چنین چیزی در متاسیتی وجود ندارد (یا شاید من نمیدانم). به هر حال این هم IrixTerminal که شاید نیاز شما را رفع کند. اگه امکانات زیادی نداره شرمنده
. هر چی باشه با دو ساعت برنامهنویسی چیزی بهتر از این نمیشه ساخت. برای کمپایل برنامه به Gtk2.8 به بالا و libvte نیاز داری.
این برنامه یه ترمینال سادهی گنوم با قابلیت حذف از taskbar، قابلیت تمامصفحه شدن، ارتباط با کلبپبورد را به همراه یک رابط مجهز به منو و toolbar ارائه میکند.
کد :
#include <stdlib.h>
#include <gtk/gtk.h>
#include <vte/vte.h>
/* i defined these vars global only for simplisity :) */
GtkWindow *window;
VteTerminal *terminal;
void
term_copy (GtkAction *action, gpointer user_data)
{
vte_terminal_copy_clipboard (terminal);
}
void
term_paste (GtkAction *action, gpointer user_data)
{
vte_terminal_paste_clipboard (terminal);
}
void
term_fullscreen (GtkToggleAction *action, gpointer user_data)
{
if (gtk_toggle_action_get_active (action))
{
g_object_set (G_OBJECT (action), "tooltip", "Exit fullscreen mode",
"stock-id", GTK_STOCK_LEAVE_FULLSCREEN,
NULL);
gtk_window_fullscreen (window);
}
else
{
g_object_set (G_OBJECT (action), "tooltip", "Switch to fullscreen mode",
"stock-id", GTK_STOCK_FULLSCREEN,
NULL);
gtk_window_unfullscreen (window);
}
}
void
term_skip_taskbar (GtkToggleAction *action, gpointer user_data)
{
gboolean active = gtk_toggle_action_get_active (action);
gtk_window_set_skip_taskbar_hint (window, active);
if (active)
g_object_set (G_OBJECT (action), "tooltip", "Don't skip taskbar hints",
"stock-id", GTK_STOCK_GO_DOWN,
NULL);
else
g_object_set (G_OBJECT (action), "tooltip", "Skip taskbar hints",
"stock-id", GTK_STOCK_GO_UP,
NULL);
}
static const GtkActionEntry action_entries[] = {
{ "file-menu", NULL, "_File" },
{ "edit-menu", NULL, "_Edit" },
{ "view-menu", NULL, "_View" },
{ "file-quit", GTK_STOCK_QUIT, "_Quit", "<shift><control>Q",
"Quit the terminal", gtk_main_quit },
{ "edit-copy", GTK_STOCK_COPY, "_Copy", "<shift><control>C",
"Copy to clipboard", G_CALLBACK (term_copy) },
{ "edit-paste", GTK_STOCK_PASTE, "_Paste", "<shift><control>V",
"Paste from clipboard", G_CALLBACK (term_paste) }
};
static const GtkToggleActionEntry toggle_action_entries[] = {
{ "view-fullscreen", GTK_STOCK_FULLSCREEN, "_Full Screen", "F11",
"Switch to fullscreen mode", G_CALLBACK (term_fullscreen), FALSE },
{ "view-skip-taskbar", GTK_STOCK_GO_UP, "_Toggle Taskbar Hints", "F12",
"Skip taskbar hints", G_CALLBACK (term_skip_taskbar), FALSE }
};
static const char *ui_description =
"<ui>"
" <menubar name='main-menu'>"
" <menu action='file-menu'>"
" <menuitem action='file-quit'/>"
" </menu>"
" <menu action='edit-menu'>"
" <menuitem action='edit-copy'/>"
" <menuitem action='edit-paste'/>"
" </menu>"
" <menu action='view-menu'>"
" <menuitem action='view-fullscreen'/>"
" <menuitem action='view-skip-taskbar'/>"
" </menu>"
" </menubar>"
" <toolbar name='main-toolbar'>"
" <toolitem action='file-quit'/>"
" <separator/>"
" <toolitem action='edit-copy'/>"
" <toolitem action='edit-paste'/>"
" <separator/>"
" <toolitem action='view-fullscreen'/>"
" <separator/>"
" <toolitem action='view-skip-taskbar'/>"
" </toolbar>"
"</ui>";
int
main (int argc, char **argv)
{
GtkWidget *vbox;
GtkWidget *menubar;
GtkWidget *toolbar;
GtkActionGroup *action_group;
GtkUIManager *ui_manager;
GtkAccelGroup *accel_group;
GError *error;
gtk_init (&argc, &argv);
window = (GtkWindow *) gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (window, "Irix Terminal");
g_signal_connect (G_OBJECT (window), "destroy", gtk_main_quit, NULL);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
action_group = gtk_action_group_new ("terminal-actions");
gtk_action_group_add_actions (action_group, action_entries,
G_N_ELEMENTS (action_entries), NULL);
gtk_action_group_add_toggle_actions (action_group, toggle_action_entries,
G_N_ELEMENTS (toggle_action_entries),
NULL);
ui_manager = gtk_ui_manager_new ();
gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
accel_group = gtk_ui_manager_get_accel_group (ui_manager);
gtk_window_add_accel_group (window, accel_group);
error = NULL;
if (!gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, -1,
&error))
{
g_message ("building gui-interface failed: %s", error->message);
g_error_free (error);
exit (EXIT_FAILURE);
}
menubar = gtk_ui_manager_get_widget (ui_manager, "/main-menu");
gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE, 0);
toolbar = gtk_ui_manager_get_widget (ui_manager, "/main-toolbar");
gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, FALSE, 0);
terminal = (VteTerminal *) vte_terminal_new ();
vte_terminal_set_emulation (terminal, "xterm");
vte_terminal_set_allow_bold (terminal, TRUE);
vte_terminal_set_scroll_on_output (terminal, TRUE);
vte_terminal_set_scroll_on_keystroke (terminal, TRUE);
vte_terminal_set_encoding (terminal, "utf-8");
vte_terminal_fork_command (terminal, NULL, NULL, NULL, NULL, TRUE, TRUE,
TRUE);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (terminal), TRUE, TRUE, 0);
gtk_window_set_focus (window, GTK_WIDGET (terminal));
gtk_widget_show_all (GTK_WIDGET (window));
gtk_main ();
return EXIT_SUCCESS;
}