Package: gmrun
Version: 0.9.1-2.4
Severity: wishlist
Tags: patch

Attached is a dpatch to add support for a Selected option in the
configuration file.  Setting it to 1 makes the text selected (any
keypress replaces it), while 0 puts the cursor after the last letter, so
any keypress adds text to the command to be launched.

I also updated the documentation (60-manpage.dpatch), for this, for an
undocumented ShowLast option, and for the patch that fixes #460135.

Dropping the file in debian/patches, updating 00list, and debuilding
works fine here.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages gmrun depends on:
ii  libatk1.0-0                   1.22.0-1   The ATK accessibility toolkit
ii  libc6                         2.7-13     GNU C Library: Shared libraries
ii  libcairo2                     1.6.4-6    The Cairo 2D vector graphics libra
ii  libgcc1                       1:4.3.2-1  GCC support library
ii  libglib2.0-0                  2.16.5-1   The GLib library of C routines
ii  libgtk2.0-0                   2.12.11-3  The GTK+ graphical user interface 
ii  libpango1.0-0                 1.20.5-2   Layout and rendering of internatio
ii  libstdc++6                    4.3.2-1    The GNU Standard C++ Library v3

gmrun recommends no packages.

gmrun suggests no packages.

-- no debconf information
#! /bin/sh /usr/share/dpatch/dpatch-run
## 50-selectoption.dpatch by Fernando Vezzosi <[EMAIL PROTECTED]>
##
## DP: add "Selected" config option

@DPATCH@

--- gmrun-0.9.1/src/main.cc	2008-01-12 00:35:33.000000000 +0100
+++ gmrun-0.9.1/src/main.cc	2008-01-12 02:32:48.000000000 +0100
@@ -599,6 +599,10 @@
   if (!configuration.get_int("ShowLast", shows_last_history_item)) {
     shows_last_history_item = 0;
   }
+  int last_history_selected = 0;
+  if (!configuration.get_int("Selected", last_history_selected)) {
+    last_history_selected = 1;
+  }
   if (shows_last_history_item) {
     gtk_completion_line_last_history_item(GTK_COMPLETION_LINE(compline));
   }
@@ -612,7 +612,11 @@
   gtk_widget_set_uposition(win, prefs_left, prefs_top);
   gtk_widget_show(win);
 
-  gtk_window_set_focus(GTK_WINDOW(win), compline);
+  if(last_history_selected){
+    gtk_entry_select_region(GTK_ENTRY(compline), 0, strlen(gtk_entry_get_text(GTK_ENTRY(compline))));
+  }else{
+    gtk_entry_set_position(GTK_ENTRY(compline), -1);
+  }
 
   gtk_main();
 }
#! /bin/sh /usr/share/dpatch/dpatch-run
## 60-manpage.dpatch by Fernando Vezzosi <[EMAIL PROTECTED]>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Add documentation for cmdline arg, ShowLast and Selected options

@DPATCH@
diff -urNad gmrun-0.9.1~/debian/gmrun.1 gmrun-0.9.1/debian/gmrun.1
--- gmrun-0.9.1~/debian/gmrun.1	2008-09-21 20:54:22.000000000 +0200
+++ gmrun-0.9.1/debian/gmrun.1	2008-09-21 21:01:32.000000000 +0200
@@ -18,7 +18,7 @@
 .SH NAME
 gmrun \- Featureful CLI-like GTK+ application launcher
 .SH SYNOPSIS
-.B gmrun
+.B gmrun [\fITEXT\fR]
 .br
 .SH DESCRIPTION
 This manual page documents briefly the
@@ -32,7 +32,9 @@
 .\" respectively.
 \fBgmrun\fP is a program that allows a user to use a CLI-like interface to launch applications from within the X11 windowing environment. It is based on the GTK+ toolkit.
 .SH OPTIONS
-gmrun does not current accept any command-line parameters. However, gmrun can be customized using a configuration file, ~/.gmrunrc . The system-wide configuration file is /etc/gmrunrc .
+If gmrun is invoked with a command-line parameter, that will be the initial content of the dialog box.
+.PP
+gmrun can be customized using a configuration file, ~/.gmrunrc . The system-wide configuration file is /etc/gmrunrc .
 .PP
 The format of the configuration file is simple; "variable = value". To refer to a variable as opposed to setting it, enclose the variable in ${}.
 .TP
@@ -57,6 +59,12 @@
 .TP
 .B History
 Number of entered commands which should be kept in gmrun's history(~/.gmrun_history). Using the Up and Down arrow keys within the gmrun window will cycle through the history. You can search backwards through the history with Ctrl+R, and foward with Ctrl+S. To cancel a search, hit Ctrl+G. Otherwise, after you have found the history item you wish to run, hit Enter.
+.TP
+.B ShowLast
+Whether to show the last command as initial text, or an empty textarea (1 or 0)
+.TP
+.B Selected
+Whether the initial text should be selected or not (1 or 0)
 .SH URL HANDLING
 As opposed to entering a command, gmrun supports the entering of URLs. The included configuration file(/etc/gmrunrc) gives some examples. To set up your own url, create a variable in /etc/gmrunrc or ~/.gmrunrc with the format of "URL_protocol". For instance, URL_http. Here is an example:
 .TP

Reply via email to