mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
If argv[0] is dmenu, launch in dmenu mode.
This commit is contained in:
parent
da7ba544fc
commit
b27725834c
3 changed files with 37 additions and 23 deletions
|
@ -329,6 +329,14 @@ the following keys can be used that will be replaced at runtime:
|
||||||
* `{ssh-client}`: The configured ssh client (See -ssh-client)
|
* `{ssh-client}`: The configured ssh client (See -ssh-client)
|
||||||
* `{cmd}`: The command to execute.
|
* `{cmd}`: The command to execute.
|
||||||
|
|
||||||
|
## Dmenu replacemnt
|
||||||
|
|
||||||
|
If `argv[0]` (calling command) is dmenu, **rofi** will start in dmenu mode.
|
||||||
|
This way it can be used as a drop-in replacement for dmenu. just copy or symlink **rofi** to dmenu in `$PATH`.
|
||||||
|
|
||||||
|
|
||||||
|
ln -s /usr/bin/dmenu /usr/bin/rofi
|
||||||
|
|
||||||
## Keybindings
|
## Keybindings
|
||||||
|
|
||||||
Rofi supports the following keybindings:
|
Rofi supports the following keybindings:
|
||||||
|
|
22
doc/rofi.1
22
doc/rofi.1
|
@ -412,6 +412,16 @@ the following keys can be used that will be replaced at runtime:
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fC{cmd}\fR: The command to execute.
|
\fB\fC{cmd}\fR: The command to execute.
|
||||||
.RE
|
.RE
|
||||||
|
.SH Dmenu replacemnt
|
||||||
|
.PP
|
||||||
|
If \fB\fCargv[0]\fR (calling command) is dmenu, \fBrofi\fP will start in dmenu mode.
|
||||||
|
This way it can be used as a drop\-in replacement for dmenu. just copy or symlink \fBrofi\fP to dmenu in \fB\fC$PATH\fR\&.
|
||||||
|
.PP
|
||||||
|
.RS
|
||||||
|
.nf
|
||||||
|
ln \-s /usr/bin/dmenu /usr/bin/rofi
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
.SH Keybindings
|
.SH Keybindings
|
||||||
.PP
|
.PP
|
||||||
Rofi supports the following keybindings:
|
Rofi supports the following keybindings:
|
||||||
|
@ -456,18 +466,14 @@ Rofi supports the following keybindings:
|
||||||
.SH WEBSITE
|
.SH WEBSITE
|
||||||
.PP
|
.PP
|
||||||
\fBrofi\fP website can be found at here
|
\fBrofi\fP website can be found at here
|
||||||
.UR https://davedavenport.github.io/rofi/
|
\[la]https://davedavenport.github.io/rofi/\[ra]
|
||||||
.UE
|
|
||||||
.PP
|
.PP
|
||||||
\fBrofi\fP bugtracker can be found here
|
\fBrofi\fP bugtracker can be found here
|
||||||
.UR https://github.com/DaveDavenport/rofi/issues
|
\[la]https://github.com/DaveDavenport/rofi/issues\[ra]
|
||||||
.UE
|
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
.PP
|
.PP
|
||||||
Qball Cow
|
Qball Cow
|
||||||
.MT qball@gmpclient.org
|
\[la]qball@gmpclient.org\[ra]
|
||||||
.ME
|
|
||||||
.PP
|
.PP
|
||||||
Original code based on work by: Sean Pringle
|
Original code based on work by: Sean Pringle
|
||||||
.MT sean.pringle@gmail.com
|
\[la]sean.pringle@gmail.com\[ra]
|
||||||
.ME
|
|
||||||
|
|
|
@ -2320,7 +2320,7 @@ static void config_sanity_check ( void )
|
||||||
exit ( 1 );
|
exit ( 1 );
|
||||||
}
|
}
|
||||||
if ( config.element_height < 1 ) {
|
if ( config.element_height < 1 ) {
|
||||||
fprintf( stderr, "config.element_height is invalid. It needs to be atleast 1 line high.\n");
|
fprintf ( stderr, "config.element_height is invalid. It needs to be atleast 1 line high.\n" );
|
||||||
exit ( 1 );
|
exit ( 1 );
|
||||||
}
|
}
|
||||||
if ( config.menu_columns == 0 ) {
|
if ( config.menu_columns == 0 ) {
|
||||||
|
@ -2477,7 +2477,15 @@ int main ( int argc, char *argv[] )
|
||||||
|
|
||||||
// flags to run immediately and exit
|
// flags to run immediately and exit
|
||||||
char *sname = NULL;
|
char *sname = NULL;
|
||||||
if ( find_arg_str ( argc, argv, "-show", &sname ) == TRUE ) {
|
if ( find_arg ( argc, argv, "-dmenu" ) >= 0 || strcmp ( argv[0], "dmenu" ) == 0 ) {
|
||||||
|
find_arg_str ( argc, argv, "-p", &dmenu_prompt );
|
||||||
|
int retv = run_dmenu ();
|
||||||
|
// User cancelled the operation.
|
||||||
|
if ( retv == FALSE ) {
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( find_arg_str ( argc, argv, "-show", &sname ) == TRUE ) {
|
||||||
int index = switcher_get ( sname );
|
int index = switcher_get ( sname );
|
||||||
if ( index >= 0 ) {
|
if ( index >= 0 ) {
|
||||||
run_switcher ( FALSE, index );
|
run_switcher ( FALSE, index );
|
||||||
|
@ -2514,14 +2522,6 @@ int main ( int argc, char *argv[] )
|
||||||
fprintf ( stderr, "The ssh dialog has not been enabled\n" );
|
fprintf ( stderr, "The ssh dialog has not been enabled\n" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( find_arg ( argc, argv, "-dmenu" ) >= 0 ) {
|
|
||||||
find_arg_str ( argc, argv, "-p", &dmenu_prompt );
|
|
||||||
int retv = run_dmenu ();
|
|
||||||
// User cancelled the operation.
|
|
||||||
if ( retv == FALSE ) {
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
else{
|
||||||
// Daemon mode, Listen to key presses..
|
// Daemon mode, Listen to key presses..
|
||||||
if ( switcher_get ( "window" ) >= 0 ) {
|
if ( switcher_get ( "window" ) >= 0 ) {
|
||||||
|
|
Loading…
Reference in a new issue