1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-02-10 15:44:41 -05:00

Merge remote-tracking branch 'origin/master' into highlight_match

This commit is contained in:
Dave Davenport 2016-06-07 09:02:03 +02:00
commit 0b84d63959
12 changed files with 130 additions and 83 deletions

19
AUTHORS
View file

@ -1,32 +1,45 @@
Benjamin Cremer
Benjamin R. Haskell
Bruno Braga
Buglloc
Chris Salzberg
Daniel Hahler
DanteFireX
Dave Davenport
Deiwin Sarjas
Dimitar Yordanov
Edwin Pujols
Eric Engeström
Gabriel Holodak
Gareth Poole
Georgios Bitzes
Greg Fitzgerald
Guy Hughes
Hexchain Tong
James Vaughan
Jason Pleau
Jasper Lievisse Adriaanse
Klemens Schölhorn
marduk
Michael Vetter
N. Izumi
Paulo Flabiano Smorigo
Peter Cannici
qedi
Quentin Glidic
Rasmus Steinke
Roomcays
Sebastian Reuße
Sebastian Reuße
Simon Hanna
Thomas Adam
Thorsten Wißmann
Tilman Blumenbach
Tobias Kortkamp
Tom Hinton
Yaroslav
seanpringle
vimeitor
daemoni
eigengrau
koppa
qedi
seanpringle
vimeitor

View file

@ -4,6 +4,7 @@ unreleased
- Stop cycling option (#407) (Thx to Yaroslav)
- Kill window on delete entry (#316)
Improvements
- Add Control+Backspace as remove word back keybinding.
- Allow user to use X11 background for fake transparency (#390)
- Allow user to specify background image.
- Improved keybinding handling, allowing on-release and modifier only (#384).

View file

@ -35,9 +35,6 @@
[ -a *row* ]
[ -u *row* ]
[ -pid *path* ]
[ -now ]
[ -rnow ]
[ -snow ]
[ -version ]
[ -help ]
[ -dump-xresources ]
@ -583,6 +580,11 @@ Reads from *file* instead of stdin.
Hide the input text. This should not be considered secure!
`-markup-rows`
Tell **rofi** that DMenu input is pango markup encoded and should be rendered.
See [here](https://developer.gnome.org/pango/stable/PangoMarkupFormat.html) for details about pango markup.
### Message dialog
@ -801,6 +803,8 @@ The indicator shows:
**rofi** bugtracker can be found [here](https://github.com/DaveDavenport/rofi/issues)
**rofi** support can be obtained [here](irc://irc.freenode.net/#rofi) (#rofi on irc.freenode.net)
## AUTHOR
Qball Cow <qball@gmpclient.org>
@ -809,6 +813,7 @@ Rasmus Steinke <rasi@xssn.at>
Quentin Glidic <sardemff7+rofi@sardemff7.net>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file.

View file

@ -1,13 +1,13 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "ROFI\-MANPAGE" "" "May 2016" "" ""
.TH "ROFI\-MANPAGE" "" "June 2016" "" ""
.
.SH "NAME"
\fBrofi\fR \- A window switcher, run launcher, ssh dialog and dmenu replacement
.
.SH "SYNOPSIS"
\fBrofi\fR [ \-width \fIpct_scr\fR ] [ \-lines \fIlines\fR ] [ \-columns \fIcolumns\fR ] [ \-font \fIpangofont\fR ] [ \-terminal \fIterminal\fR ] [ \-location \fIposition\fR ] [ \-fixed\-num\-lines ] [ \-padding \fIpadding\fR ] [ \-opacity \fIopacity%\fR ] [ \-display \fIdisplay\fR ] [ \-bw \fIwidth\fR ] [ \-dmenu [ \-p \fIprompt\fR ] [ \-sep \fIseparator\fR ] [ \-l \fIselected line\fR ] [ \-mesg ] [ \-select ] [ \-input \fIinput\fR ] ] [ \-filter \fIfilter\fR ] [ \-ssh\-client \fIclient\fR ] [ \-ssh\-command \fIcommand\fR ] [ \-window\-command \fIcommand\fR ] [ \-disable\-history ] [ \-levenshtein\-sort ] [ \-case\-sensitive ] [ \-cycle ] [ \-show \fImode\fR ] [ \-modi \fImode1,mode2\fR ] [ \-eh \fIelement height\fR ] [ \-lazy\-filter\-limit \fIlimit\fR ] [ \-e \fImessage\fR] [ \-a \fIrow\fR ] [ \-u \fIrow\fR ] [ \-pid \fIpath\fR ] [ \-now ] [ \-rnow ] [ \-snow ] [ \-version ] [ \-help ] [ \-dump\-xresources ] [ \-dump\-xresources\-theme ] [ \-auto\-select ] [ \-parse\-hosts ] [ \-no\-parse\-known\-hosts ] [ \-combi\-modi \fImode1,mode2\fR ] [ \-normal\-window ] [ \-fake\-transparency ] [ \-glob ] [ \-regex ] [ \-tokenize ] [ \-threads \fInum\fR ] [ \-config \fIfilename\fR ]
\fBrofi\fR [ \-width \fIpct_scr\fR ] [ \-lines \fIlines\fR ] [ \-columns \fIcolumns\fR ] [ \-font \fIpangofont\fR ] [ \-terminal \fIterminal\fR ] [ \-location \fIposition\fR ] [ \-fixed\-num\-lines ] [ \-padding \fIpadding\fR ] [ \-opacity \fIopacity%\fR ] [ \-display \fIdisplay\fR ] [ \-bw \fIwidth\fR ] [ \-dmenu [ \-p \fIprompt\fR ] [ \-sep \fIseparator\fR ] [ \-l \fIselected line\fR ] [ \-mesg ] [ \-select ] [ \-input \fIinput\fR ] ] [ \-filter \fIfilter\fR ] [ \-ssh\-client \fIclient\fR ] [ \-ssh\-command \fIcommand\fR ] [ \-window\-command \fIcommand\fR ] [ \-disable\-history ] [ \-levenshtein\-sort ] [ \-case\-sensitive ] [ \-cycle ] [ \-show \fImode\fR ] [ \-modi \fImode1,mode2\fR ] [ \-eh \fIelement height\fR ] [ \-lazy\-filter\-limit \fIlimit\fR ] [ \-e \fImessage\fR] [ \-a \fIrow\fR ] [ \-u \fIrow\fR ] [ \-pid \fIpath\fR ] [ \-version ] [ \-help ] [ \-dump\-xresources ] [ \-dump\-xresources\-theme ] [ \-auto\-select ] [ \-parse\-hosts ] [ \-no\-parse\-known\-hosts ] [ \-combi\-modi \fImode1,mode2\fR ] [ \-normal\-window ] [ \-fake\-transparency ] [ \-glob ] [ \-regex ] [ \-tokenize ] [ \-threads \fInum\fR ] [ \-config \fIfilename\fR ]
.
.SH "DESCRIPTION"
\fBrofi\fR is an X11 popup window switcher, run dialog, dmenu replacement and more\. It focuses on being fast to use and have minimal distraction\. It supports keyboard and mouse navigation, type to filter, tokenized search and more\.
@ -271,7 +271,7 @@ Start in case sensitive mode\.
\fB\-cycle\fR
.
.P
Cycle through the results list\. Default is 'true'\.
Cycle through the results list\. Default is \'true\'\.
.
.P
\fB\-fuzzy\fR
@ -929,6 +929,12 @@ Reads from \fIfile\fR instead of stdin\.
.P
Hide the input text\. This should not be considered secure!
.
.P
\fB\-markup\-rows\fR
.
.P
Tell \fBrofi\fR that DMenu input is pango markup encoded and should be rendered\. See here \fIhttps://developer\.gnome\.org/pango/stable/PangoMarkupFormat\.html\fR for details about pango markup\.
.
.SS "Message dialog"
\fB\-e\fR \fImessage\fR
.

View file

@ -117,7 +117,7 @@ rofi.kb-move-char-back: Left,Control+b
! Move forward one char
rofi.kb-move-char-forward: Right,Control+f
! Delete previous word
rofi.kb-remove-word-back: Control+Alt+h
rofi.kb-remove-word-back: Control+Alt+h,Control+Backspace
! Delete next word
rofi.kb-remove-word-forward: Control+Alt+d
! Delete next char

View file

@ -39,15 +39,15 @@ typedef struct
typedef enum
{
TB_AUTOHEIGHT = 1 << 0,
TB_AUTOWIDTH = 1 << 1,
TB_LEFT = 1 << 16,
TB_RIGHT = 1 << 17,
TB_CENTER = 1 << 18,
TB_EDITABLE = 1 << 19,
TB_MARKUP = 1 << 20,
TB_WRAP = 1 << 21,
TB_PASSWORD = 1 << 22,
TB_AUTOHEIGHT = 1 << 0,
TB_AUTOWIDTH = 1 << 1,
TB_LEFT = 1 << 16,
TB_RIGHT = 1 << 17,
TB_CENTER = 1 << 18,
TB_EDITABLE = 1 << 19,
TB_MARKUP = 1 << 20,
TB_WRAP = 1 << 21,
TB_PASSWORD = 1 << 22,
} TextboxFlags;
typedef enum

View file

@ -32,6 +32,7 @@
#include <limits.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <strings.h>
#include <string.h>
@ -197,27 +198,64 @@ static void read_desktop_file ( DRunModePrivateData *pd, char *path, const char
/**
* Internal spider used to get list of executables.
*/
static void get_apps_dir ( DRunModePrivateData *pd, const char *bp )
static void walk_dir ( DRunModePrivateData *pd, const char *dirname )
{
DIR *dir = opendir ( bp );
DIR *dir;
if ( dir != NULL ) {
struct dirent *dent;
dir = opendir ( dirname );
if ( dir == NULL ) {
return;
}
while ( ( dent = readdir ( dir ) ) != NULL ) {
if ( dent->d_type != DT_REG && dent->d_type != DT_LNK && dent->d_type != DT_UNKNOWN ) {
continue;
}
// Skip dot files.
if ( dent->d_name[0] == '.' ) {
continue;
}
gchar *path = g_build_filename ( bp, dent->d_name, NULL );
read_desktop_file ( pd, path, dent->d_name );
struct dirent *file;
gchar *filename = NULL;
struct stat st;
while ( ( file = readdir ( dir ) ) != NULL ) {
if ( file->d_name[0] == '.' ) {
continue;
}
closedir ( dir );
switch ( file->d_type )
{
case DT_LNK:
case DT_REG:
case DT_DIR:
case DT_UNKNOWN:
filename = g_build_filename ( dirname, file->d_name, NULL );
break;
default:
continue;
}
// On a link, or if FS does not support providing this information
// Fallback to stat method.
if ( file->d_type == DT_LNK || file->d_type == DT_UNKNOWN ) {
file->d_type = DT_UNKNOWN;
if ( stat ( filename, &st ) == 0 ) {
if ( S_ISDIR ( st.st_mode ) ) {
file->d_type = DT_DIR;
}
else if ( S_ISREG ( st.st_mode ) ) {
file->d_type = DT_REG;
}
}
}
switch ( file->d_type )
{
case DT_REG:
read_desktop_file ( pd, filename, file->d_name );
filename = NULL;
break;
case DT_DIR:
walk_dir ( pd, filename );
break;
default:
break;
}
g_free ( filename );
}
closedir ( dir );
}
/**
* @param entry The command entry to remove from history
@ -232,6 +270,7 @@ static void delete_entry_history ( const DRunModeEntry *entry )
g_free ( path );
}
static void get_apps_history ( DRunModePrivateData *pd )
{
unsigned int length = 0;
@ -246,38 +285,21 @@ static void get_apps_history ( DRunModePrivateData *pd )
g_free ( retv );
pd->history_length = pd->cmd_list_length;
}
static void get_apps ( DRunModePrivateData *pd )
{
get_apps_history ( pd );
const char * const * dr = g_get_system_data_dirs ();
const char * const * iter = dr;
while ( iter != NULL && *iter != NULL && **iter != '\0' ) {
gboolean skip = FALSE;
for ( size_t i = 0; !skip && dr[i] != ( *iter ); i++ ) {
skip = ( g_strcmp0 ( *iter, dr[i] ) == 0 );
}
if ( skip ) {
iter++;
continue;
}
gchar *bp = g_build_filename ( *iter, "applications", NULL );
get_apps_dir ( pd, bp );
g_free ( bp );
iter++;
}
const char *d = g_get_user_data_dir ();
for ( size_t i = 0; dr && dr[i] != NULL; i++ ) {
if ( g_strcmp0 ( d, dr[i] ) == 0 ) {
// Done this already, no need to repeat.
return;
}
}
if ( d ) {
gchar *bp = g_build_filename ( d, "applications", NULL );
get_apps_dir ( pd, bp );
g_free ( bp );
gchar *dir;
const gchar * const * sys = g_get_system_data_dirs ();
for (; *sys != NULL; ++sys ) {
dir = g_build_filename ( *sys, "applications", NULL );
walk_dir ( pd, dir );
g_free ( dir );
}
dir = g_build_filename ( g_get_user_data_dir (), "applications", NULL );
walk_dir ( pd, dir );
g_free ( dir );
}
static int drun_mode_init ( Mode *sw )

View file

@ -198,7 +198,7 @@ static char **read_hosts_file ( char ** retv, unsigned int *length )
// Reading one line per time.
while ( getline ( &buffer, &buffer_length, fd ) > 0 ) {
// Evaluate one line.
unsigned int index = 0, ti = 0;
unsigned int index = 0, ti = 0;
char *token = buffer;
// Tokenize it.

View file

@ -43,7 +43,7 @@ DefaultBinding bindings[NUM_ABE] =
{ .id = MOVE_WORD_FORWARD, .name = "kb-move-word-forward", .keybinding = "Alt+f", .comment = "Move forward one word" },
{ .id = MOVE_CHAR_BACK, .name = "kb-move-char-back", .keybinding = "Left,Control+b", .comment = "Move back one char" },
{ .id = MOVE_CHAR_FORWARD, .name = "kb-move-char-forward", .keybinding = "Right,Control+f", .comment = "Move forward one char" },
{ .id = REMOVE_WORD_BACK, .name = "kb-remove-word-back", .keybinding = "Control+Alt+h", .comment = "Delete previous word" },
{ .id = REMOVE_WORD_BACK, .name = "kb-remove-word-back", .keybinding = "Control+Alt+h,Control+Backspace", .comment = "Delete previous word" },
{ .id = REMOVE_WORD_FORWARD, .name = "kb-remove-word-forward", .keybinding = "Control+Alt+d", .comment = "Delete next word" },
{ .id = REMOVE_CHAR_FORWARD, .name = "kb-remove-char-forward", .keybinding = "Delete,Control+d", .comment = "Delete next char" },
{ .id = REMOVE_CHAR_BACK, .name = "kb-remove-char-back", .keybinding = "BackSpace,Control+h", .comment = "Delete previous char" },

View file

@ -74,9 +74,9 @@ struct xkb_stuff xkb = {
.keymap = NULL,
.state = NULL,
.compose = {
.table = NULL,
.state = NULL
}
.table = NULL,
.state = NULL
}
};
char *config_path = NULL;
// Array of modi.
@ -441,22 +441,22 @@ static gboolean main_loop_x11_event_handler ( xcb_generic_event_t *ev, G_GNUC_UN
xkb.state = xkb_x11_state_new_from_device ( xkb.keymap, xcb->connection, xkb.device_id );
break;
case XCB_XKB_STATE_NOTIFY:
{
xcb_xkb_state_notify_event_t *ksne = (xcb_xkb_state_notify_event_t *) ev;
guint modmask;
xkb_state_update_mask ( xkb.state,
ksne->baseMods,
ksne->latchedMods,
ksne->lockedMods,
ksne->baseGroup,
ksne->latchedGroup,
ksne->lockedGroup );
modmask = x11_get_current_mask ( &xkb );
if ( modmask == 0 ) {
abe_trigger_release ( );
{
xcb_xkb_state_notify_event_t *ksne = (xcb_xkb_state_notify_event_t *) ev;
guint modmask;
xkb_state_update_mask ( xkb.state,
ksne->baseMods,
ksne->latchedMods,
ksne->lockedMods,
ksne->baseGroup,
ksne->latchedGroup,
ksne->lockedGroup );
modmask = x11_get_current_mask ( &xkb );
if ( modmask == 0 ) {
abe_trigger_release ( );
}
break;
}
break;
}
}
return G_SOURCE_CONTINUE;
}

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
echo -en "nooty\naap\nnoot\nmies" | rofi -fuzzy -dmenu > output.txt &
echo -en "nooty\naap\nnoot\nmies" | rofi -fuzzy -no-regex -dmenu > output.txt &
RPID=$!
# send enter.

View file

@ -6,7 +6,7 @@ function create_fake_x ( )
{
export DISPLAY=":$1"
echo "Starting fake X: ${DISPLAY}"
Xvfb -screen 0 1280x1024x24 ${DISPLAY} &
Xvfb +extension XINERAMA +xinerama -screen 0 1280x1024x24 -screen 1 800x600x24 ${DISPLAY} &
XPID=$!
sleep 1;
timeout -k 30s 30s fluxbox &