From 9a34d89e519a33653d38a202138854a708124234 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Thu, 1 Feb 2018 21:52:54 +0100 Subject: Bump version to 1.5.0 --- Changelog | 2 +- configure.ac | 2 +- meson.build | 2 +- themes/DarkBlue.rasi | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Changelog b/Changelog index a872a629..bb56241d 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,4 @@ -v1.5.0 (dev): +v1.5.0: - [Theme] Accept integer notation for double properties. (#752) - [View] Theme textboxes are vertically sized and horizontal wrapped. (#754) - Rofi 1.4.2 doesn't capture ←, ↑, →, ↓ binding to keys to work in combination with Mode_switch (#744) diff --git a/configure.ac b/configure.ac index 9357964e..d2e5f487 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rofi], [1.4.99-dev], [https://github.com/DaveDavenport/rofi/],[],[https://reddit.com/r/qtools/]) +AC_INIT([rofi], [1.5.0], [https://github.com/DaveDavenport/rofi/],[],[https://reddit.com/r/qtools/]) AC_CONFIG_SRCDIR([source/rofi.c]) AC_CONFIG_HEADER([config.h]) diff --git a/meson.build b/meson.build index b98f5c2a..1a3e4acd 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('rofi', 'c', - version: '1.4.99-dev', + version: '1.5.0', meson_version: '>=0.39.1', license: [ 'MIT' ], default_options: [ diff --git a/themes/DarkBlue.rasi b/themes/DarkBlue.rasi index 977720af..ade80e65 100644 --- a/themes/DarkBlue.rasi +++ b/themes/DarkBlue.rasi @@ -53,7 +53,7 @@ textbox { text-color: @foreground; } listview { - fixed-height: 0; + fixed-height: false; border: 2px 0px 0px ; border-color: @separatorcolor; spacing: 2px ; -- cgit v1.2.3 From f0ba23a4899418492ef455a299a555158282fd06 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Thu, 1 Feb 2018 22:01:01 +0100 Subject: Tag as dev version. --- configure.ac | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d2e5f487..f71dafc7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rofi], [1.5.0], [https://github.com/DaveDavenport/rofi/],[],[https://reddit.com/r/qtools/]) +AC_INIT([rofi], [1.5.0-dev], [https://github.com/DaveDavenport/rofi/],[],[https://reddit.com/r/qtools/]) AC_CONFIG_SRCDIR([source/rofi.c]) AC_CONFIG_HEADER([config.h]) diff --git a/meson.build b/meson.build index 1a3e4acd..40f36a01 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('rofi', 'c', - version: '1.5.0', + version: '1.5.0-dev', meson_version: '>=0.39.1', license: [ 'MIT' ], default_options: [ -- cgit v1.2.3 From dab263b07ddf9f90d4023e1e66bfc291bd791123 Mon Sep 17 00:00:00 2001 From: Egor Zvorykin Date: Sat, 3 Feb 2018 14:02:20 +0300 Subject: Fix several typos in theme manpage --- doc/rofi-theme.5 | 12 ++++++------ doc/rofi-theme.5.markdown | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/rofi-theme.5 b/doc/rofi-theme.5 index c4ea5408..61819787 100644 --- a/doc/rofi-theme.5 +++ b/doc/rofi-theme.5 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "ROFI\-THEME" "5" "December 2017" "" "" +.TH "ROFI\-THEME" "5" "February 2018" "" "" . .SH "NAME" \fBrofi\-theme\fR \- Rofi theme format files @@ -118,7 +118,7 @@ It is advised to define the \fIglobal properties section\fR on top of the file t .IP "" 0 . .P -If there are mulitple sections with the same name, they are merged\. Duplicate properties are overwritten and the last parsed entry kept\. +If there are multiple sections with the same name, they are merged\. Duplicate properties are overwritten and the last parsed entry kept\. . .SH "Global properties section" A theme can have one or more global properties sections\. If there is more than one, they will be merged\. @@ -169,7 +169,7 @@ element normal normal, button { .IP "" 0 . .P -Each section inherits the global properties\. Properties can be explicitely inherited from there parent with the \fBinherit\fR keyword\. In the following example: +Each section inherits the global properties\. Properties can be explicitly inherited from their parent with the \fBinherit\fR keyword\. In the following example: . .IP "" 4 . @@ -221,7 +221,7 @@ The properties in a section consist of: .IP "" 0 . .P -Both fields are manditory for a property\. +Both fields are mandatory for a property\. . .P The \fBidentifier\fR names the specified property\. Identifiers can consist of any combination of numbers, letters and \'\-\'\. It must not contain any whitespace\. The structure of the \fBvalue\fR defines the type of the property\. The current parser does not define or enforce a certain type of a particular \fBidentifier\fR\. When used, values with the wrong type that cannot be converted are ignored\. @@ -419,7 +419,7 @@ The white\-space format proposed in CSS4 is also supported\. The different values are: . .IP "\(bu" 4 -\fB{HEX}\fR is a hexidecimal number (\'0\-9a\-f\' case insensitive)\. +\fB{HEX}\fR is a hexadecimal number (\'0\-9a\-f\' case insensitive)\. . .IP "\(bu" 4 \fB{INTEGER}\fR value can be between 0 and 255 or 0\-100 when representing percentage\. @@ -888,7 +888,7 @@ nametotextbox selected\.active { .IP "" 0 . .P -Sets all selected textboxes marked active to the given foreground and background color\. Note that a state modifies the original element, it therefor contains all the properties of that element\. +Sets all selected textboxes marked active to the given foreground and background color\. Note that a state modifies the original element, it therefore contains all the properties of that element\. . .SS "Scrollbar" The scrollbar uses the \fBhandle\fR state when drawing the small scrollbar handle\. This allows the colors used for drawing the handle to be set independently\. diff --git a/doc/rofi-theme.5.markdown b/doc/rofi-theme.5.markdown index 6bcc28c5..37b68732 100644 --- a/doc/rofi-theme.5.markdown +++ b/doc/rofi-theme.5.markdown @@ -87,7 +87,7 @@ make inheritance of properties clearer. } ``` -If there are mulitple sections with the same name, they are merged. Duplicate properties are overwritten and the last +If there are multiple sections with the same name, they are merged. Duplicate properties are overwritten and the last parsed entry kept. ## Global properties section @@ -129,7 +129,7 @@ element normal normal, button { } ``` -Each section inherits the global properties. Properties can be explicitely inherited from there parent with the +Each section inherits the global properties. Properties can be explicitly inherited from their parent with the `inherit` keyword. In the following example: @@ -165,7 +165,7 @@ The properties in a section consist of: {identifier}: {value}; ``` -Both fields are manditory for a property. +Both fields are mandatory for a property. The `identifier` names the specified property. Identifiers can consist of any combination of numbers, letters and '-'. It must not contain any whitespace. @@ -265,7 +265,7 @@ The white-space format proposed in CSS4 is also supported. The different values are: - * `{HEX}` is a hexidecimal number ('0-9a-f' case insensitive). + * `{HEX}` is a hexadecimal number ('0-9a-f' case insensitive). * `{INTEGER}` value can be between 0 and 255 or 0-100 when representing percentage. * `{ANGLE}` is the angle on the color wheel, can be in `deg`, `rad`, `grad` or `turn`. When no unit is specified, degrees is assumed. * `{PERCENTAGE}` can be between 0-1.0, or 0%-100% @@ -549,7 +549,7 @@ nametotextbox selected.active { ``` Sets all selected textboxes marked active to the given foreground and background color. -Note that a state modifies the original element, it therefor contains all the properties of that element. +Note that a state modifies the original element, it therefore contains all the properties of that element. ### Scrollbar -- cgit v1.2.3 From 4df7bc4fec563e11308fb98c9823a6453597b02c Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 3 Feb 2018 13:25:19 +0000 Subject: Update README.md I couldn't get the configuration file to work in `~/.local` but it did work in `~/.config`. This might be distro specific but I believe it is the norm now. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b164c24d..a80e71fa 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,7 @@ For the full list of key bindings, see: `rofi -show keys` or `rofi -help`. There are currently three methods of setting configuration options: - * Local configuration. Normally, depending on XDG, in `~/.local/rofi/config`. This uses the Xresources format. + * Local configuration. Normally, depending on XDG, in `~/.config/rofi/config`. This uses the Xresources format. * Xresources: A method of storing key values in the Xserver. See [here](https://en.wikipedia.org/wiki/X_resources) for more information. * Command line options: Arguments are passed to **Rofi**. -- cgit v1.2.3 From 03a6e53e36e780ff6ea9f9258eec10b66b4c3190 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Sat, 3 Feb 2018 18:24:52 +0100 Subject: gitmodules: Update libnkutils Signed-off-by: Quentin Glidic --- subprojects/libnkutils | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/libnkutils b/subprojects/libnkutils index 1f0e3b3d..3b5de1a4 160000 --- a/subprojects/libnkutils +++ b/subprojects/libnkutils @@ -1 +1 @@ -Subproject commit 1f0e3b3d12aa39d9f01c4b0bc9a2de34e79184c5 +Subproject commit 3b5de1a4d59dba544dedcf9724ed547b30b826cb -- cgit v1.2.3 From 23b7af56d099a0bcc3f4280862a2811d2da3a8a7 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Sun, 4 Feb 2018 20:11:33 +0100 Subject: gitmodules: Update libnkutils Fixes #763 Signed-off-by: Quentin Glidic --- subprojects/libnkutils | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/libnkutils b/subprojects/libnkutils index 3b5de1a4..463b7e19 160000 --- a/subprojects/libnkutils +++ b/subprojects/libnkutils @@ -1 +1 @@ -Subproject commit 3b5de1a4d59dba544dedcf9724ed547b30b826cb +Subproject commit 463b7e19a569d748a49a65ab16b0b95009e12ba1 -- cgit v1.2.3 From ac29c537dd15677e42b4c4bb76fc4678b18f35f7 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Tue, 6 Feb 2018 21:03:07 +0100 Subject: [SSH] Reload ssh when entry is deleted. --- source/dialogs/ssh.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/source/dialogs/ssh.c b/source/dialogs/ssh.c index 8b20ccb8..4f9bb46f 100644 --- a/source/dialogs/ssh.c +++ b/source/dialogs/ssh.c @@ -433,6 +433,20 @@ static unsigned int ssh_mode_get_num_entries ( const Mode *sw ) const SSHModePrivateData *rmpd = (const SSHModePrivateData *) mode_get_private_data ( sw ); return rmpd->hosts_list_length; } +/** + * @param sw Object handle to the SSH Mode object + * + * Cleanup the SSH Mode. Free all allocated memory and NULL the private data pointer. + */ +static void ssh_mode_destroy ( Mode *sw ) +{ + SSHModePrivateData *rmpd = (SSHModePrivateData *) mode_get_private_data ( sw ); + if ( rmpd != NULL ) { + g_strfreev ( rmpd->hosts_list ); + g_free ( rmpd ); + mode_set_private_data ( sw, NULL ); + } +} /** * @param sw Object handle to the SSH Mode object @@ -465,29 +479,14 @@ static ModeMode ssh_mode_result ( Mode *sw, int mretv, char **input, unsigned in } else if ( ( mretv & MENU_ENTRY_DELETE ) && rmpd->hosts_list[selected_line] ) { delete_ssh ( rmpd->hosts_list[selected_line] ); - g_strfreev ( rmpd->hosts_list ); - rmpd->hosts_list_length = 0; - rmpd->hosts_list = NULL; // Stay retv = RELOAD_DIALOG; + ssh_mode_destroy ( sw ); + ssh_mode_init ( sw ); } return retv; } -/** - * @param sw Object handle to the SSH Mode object - * - * Cleanup the SSH Mode. Free all allocated memory and NULL the private data pointer. - */ -static void ssh_mode_destroy ( Mode *sw ) -{ - SSHModePrivateData *rmpd = (SSHModePrivateData *) mode_get_private_data ( sw ); - if ( rmpd != NULL ) { - g_strfreev ( rmpd->hosts_list ); - g_free ( rmpd ); - mode_set_private_data ( sw, NULL ); - } -} /** * @param sw Object handle to the SSH Mode object -- cgit v1.2.3 From 521843e9be17686624fbeef973e5cd0f520f02d1 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Wed, 7 Feb 2018 16:06:16 +0100 Subject: I749 (#766) * [XCB] Use randr monitor API to get monitors. Hopefully helps with issue #749. * Add check for randr header version * Fix API version check, and check the version of the server. * Add some comments to the code. --- source/xcb.c | 495 ++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 290 insertions(+), 205 deletions(-) diff --git a/source/xcb.c b/source/xcb.c index 72a30152..2d8069c9 100644 --- a/source/xcb.c +++ b/source/xcb.c @@ -62,6 +62,11 @@ #include "timings.h" #include + +/** Minimal randr prefered for running rofi (1.5) */ +#define RANDR_PREF_MAJOR_VERSION 1 +#define RANDR_PREF_MINOR_VERSION 5 + /** Checks if the if x and y is inside rectangle. */ #define INTERSECT( x, y, x1, y1, w1, h1 ) ( ( ( ( x ) >= ( x1 ) ) && ( ( x ) < ( x1 + w1 ) ) ) && ( ( ( y ) >= ( y1 ) ) && ( ( y ) < ( y1 + h1 ) ) ) ) WindowManagerQuirk current_window_manager = WM_EWHM; @@ -99,25 +104,25 @@ const char *netatom_names[] = { EWMH_ATOMS ( ATOM_CHAR ) }; cairo_surface_t *x11_helper_get_screenshot_surface ( void ) { return cairo_xcb_surface_create ( xcb->connection, - xcb_stuff_get_root_window (), root_visual, - xcb->screen->width_in_pixels, xcb->screen->height_in_pixels ); + xcb_stuff_get_root_window (), root_visual, + xcb->screen->width_in_pixels, xcb->screen->height_in_pixels ); } static xcb_pixmap_t get_root_pixmap ( xcb_connection_t *c, - xcb_screen_t *screen, - xcb_atom_t atom ) + xcb_screen_t *screen, + xcb_atom_t atom ) { xcb_get_property_cookie_t cookie; xcb_get_property_reply_t *reply; xcb_pixmap_t rootpixmap = XCB_NONE; cookie = xcb_get_property ( c, - 0, - screen->root, - atom, - XCB_ATOM_PIXMAP, - 0, - 1 ); + 0, + screen->root, + atom, + XCB_ATOM_PIXMAP, + 0, + 1 ); reply = xcb_get_property_reply ( c, cookie, NULL ); @@ -138,7 +143,7 @@ cairo_surface_t * x11_helper_get_bg_surface ( void ) return NULL; } return cairo_xcb_surface_create ( xcb->connection, pm, root_visual, - xcb->screen->width_in_pixels, xcb->screen->height_in_pixels ); + xcb->screen->width_in_pixels, xcb->screen->height_in_pixels ); } // retrieve a text property from a window @@ -234,6 +239,51 @@ static workarea * x11_get_monitor_from_output ( xcb_randr_output_t out ) return retv; } +#if ( ( (XCB_RANDR_MAJOR_VERSION >= RANDR_PREF_MAJOR_VERSION ) && (XCB_RANDR_MINOR_VERSION >= RANDR_PREF_MINOR_VERSION ) ) \ + || XCB_RANDR_MAJOR_VERSION > RANDR_PREF_MAJOR_VERSION ) +/** + * @param mon The randr monitor to parse. + * + * Create monitor based on xrandr monitor id. + * + * @returns A workarea representing the monitor mon + */ +static workarea *x11_get_monitor_from_randr_monitor ( xcb_randr_monitor_info_t *mon ) +{ + // Query to the name of the monitor. + xcb_generic_error_t *err; + xcb_get_atom_name_cookie_t anc = xcb_get_atom_name(xcb->connection, mon->name); + xcb_get_atom_name_reply_t *atom_reply = xcb_get_atom_name_reply( xcb->connection, anc, &err); + if (err != NULL) { + g_warning ("Could not get RandR monitor name: X11 error code %d\n", err->error_code); + free(err); + return NULL; + } + workarea *retv = g_malloc0 ( sizeof ( workarea ) ); + + // Is primary monitor. + retv->primary = mon->primary; + + // Position and size. + retv->x = mon->x; + retv->y = mon->y; + retv->w = mon->width; + retv->h = mon->height; + + // Physical + retv->mw = mon->width_in_millimeters; + retv->mh = mon->height_in_millimeters; + + // Name + retv->name = g_strdup_printf("%.*s", xcb_get_atom_name_name_length(atom_reply), xcb_get_atom_name_name(atom_reply)); + + // Free name atom. + free ( atom_reply ); + + return retv; +} +#endif + static int x11_is_extension_present ( const char *extension ) { xcb_query_extension_cookie_t randr_cookie = xcb_query_extension ( xcb->connection, strlen ( extension ), extension ); @@ -250,18 +300,18 @@ static int x11_is_extension_present ( const char *extension ) static void x11_build_monitor_layout_xinerama () { xcb_xinerama_query_screens_cookie_t screens_cookie = xcb_xinerama_query_screens_unchecked ( - xcb->connection - ); + xcb->connection + ); xcb_xinerama_query_screens_reply_t *screens_reply = xcb_xinerama_query_screens_reply ( - xcb->connection, - screens_cookie, - NULL - ); + xcb->connection, + screens_cookie, + NULL + ); xcb_xinerama_screen_info_iterator_t screens_iterator = xcb_xinerama_query_screens_screen_info_iterator ( - screens_reply - ); + screens_reply + ); for (; screens_iterator.rem > 0; xcb_xinerama_screen_info_next ( &screens_iterator ) ) { workarea *w = g_malloc0 ( sizeof ( workarea ) ); @@ -301,40 +351,75 @@ static void x11_build_monitor_layout () } g_debug ( "Query RANDR for monitor layout." ); - xcb_randr_get_screen_resources_current_reply_t *res_reply; - xcb_randr_get_screen_resources_current_cookie_t src; - src = xcb_randr_get_screen_resources_current ( xcb->connection, xcb->screen->root ); - res_reply = xcb_randr_get_screen_resources_current_reply ( xcb->connection, src, NULL ); - if ( !res_reply ) { - return; //just report error - } - int mon_num = xcb_randr_get_screen_resources_current_outputs_length ( res_reply ); - xcb_randr_output_t *ops = xcb_randr_get_screen_resources_current_outputs ( res_reply ); - - // Get primary. - xcb_randr_get_output_primary_cookie_t pc = xcb_randr_get_output_primary ( xcb->connection, xcb->screen->root ); - xcb_randr_get_output_primary_reply_t *pc_rep = xcb_randr_get_output_primary_reply ( xcb->connection, pc, NULL ); - - for ( int i = mon_num - 1; i >= 0; i-- ) { - workarea *w = x11_get_monitor_from_output ( ops[i] ); - if ( w ) { - w->next = xcb->monitors; - xcb->monitors = w; - if ( pc_rep && pc_rep->output == ops[i] ) { - w->primary = TRUE; + g_debug ( "Randr XCB api version: %d.%d.", XCB_RANDR_MAJOR_VERSION, XCB_RANDR_MINOR_VERSION ); +#if ( ( ( XCB_RANDR_MAJOR_VERSION == RANDR_PREF_MAJOR_VERSION ) && (XCB_RANDR_MINOR_VERSION >= RANDR_PREF_MINOR_VERSION ) ) \ + || XCB_RANDR_MAJOR_VERSION > RANDR_PREF_MAJOR_VERSION ) + xcb_randr_query_version_cookie_t cversion = xcb_randr_query_version(xcb->connection, + RANDR_PREF_MAJOR_VERSION, RANDR_PREF_MINOR_VERSION); + xcb_randr_query_version_reply_t *rversion = xcb_randr_query_version_reply( xcb->connection, cversion, NULL ); + if ( rversion ) { + g_debug ( "Found randr version: %d.%d", rversion->major_version, rversion->minor_version ); + // Check if we are 1.5 and up. + if ( ( ( rversion->major_version == XCB_RANDR_MAJOR_VERSION ) && (rversion->minor_version >= XCB_RANDR_MINOR_VERSION ) ) || + ( rversion->major_version > XCB_RANDR_MAJOR_VERSION ) ){ + xcb_randr_get_monitors_cookie_t t = xcb_randr_get_monitors( xcb->connection, xcb->screen->root, 1 ); + xcb_randr_get_monitors_reply_t *mreply = xcb_randr_get_monitors_reply ( xcb->connection, t, NULL ); + if( mreply ) { + xcb_randr_monitor_info_iterator_t iter = xcb_randr_get_monitors_monitors_iterator ( mreply ); + while ( iter.rem > 0 ) { + workarea *w = x11_get_monitor_from_randr_monitor ( iter.data ); + if ( w ) { + w->next = xcb->monitors; + xcb->monitors = w; + } + xcb_randr_monitor_info_next (&iter); + } + free ( mreply ); } } + free ( rversion ); + } +#endif + + // If no monitors found. + if ( xcb->monitors == NULL ) { + xcb_randr_get_screen_resources_current_reply_t *res_reply; + xcb_randr_get_screen_resources_current_cookie_t src; + src = xcb_randr_get_screen_resources_current ( xcb->connection, xcb->screen->root ); + res_reply = xcb_randr_get_screen_resources_current_reply ( xcb->connection, src, NULL ); + if ( !res_reply ) { + return; //just report error + } + int mon_num = xcb_randr_get_screen_resources_current_outputs_length ( res_reply ); + xcb_randr_output_t *ops = xcb_randr_get_screen_resources_current_outputs ( res_reply ); + + // Get primary. + xcb_randr_get_output_primary_cookie_t pc = xcb_randr_get_output_primary ( xcb->connection, xcb->screen->root ); + xcb_randr_get_output_primary_reply_t *pc_rep = xcb_randr_get_output_primary_reply ( xcb->connection, pc, NULL ); + + for ( int i = mon_num - 1; i >= 0; i-- ) { + workarea *w = x11_get_monitor_from_output ( ops[i] ); + if ( w ) { + w->next = xcb->monitors; + xcb->monitors = w; + if ( pc_rep && pc_rep->output == ops[i] ) { + w->primary = TRUE; + } + } + } + // If exists, free primary output reply. + if ( pc_rep ) { + free ( pc_rep ); + } + free ( res_reply ); + } + // Number monitor int index = 0; for ( workarea *iter = xcb->monitors; iter; iter = iter->next ) { iter->monitor_id = index++; } - // If exists, free primary output reply. - if ( pc_rep ) { - free ( pc_rep ); - } - free ( res_reply ); } void display_dump_monitor_layout ( void ) @@ -352,13 +437,13 @@ void display_dump_monitor_layout ( void ) printf ( "%s size%s: %d,%d\n", ( is_term ) ? color_bold : "", is_term ? color_reset : "", iter->w, iter->h ); if ( iter->mw > 0 && iter->mh > 0 ) { printf ( "%s size%s: %dmm,%dmm dpi: %.0f,%.0f\n", - ( is_term ) ? color_bold : "", - is_term ? color_reset : "", - iter->mw, - iter->mh, - iter->w * 25.4 / (double) iter->mw, - iter->h * 25.4 / (double) iter->mh - ); + ( is_term ) ? color_bold : "", + is_term ? color_reset : "", + iter->mw, + iter->mh, + iter->w * 25.4 / (double) iter->mw, + iter->h * 25.4 / (double) iter->mh + ); } printf ( "\n" ); } @@ -556,7 +641,7 @@ static int monitor_active_from_id ( int mon_id, workarea *mon ) if ( xcb_ewmh_get_desktop_viewport_reply ( &xcb->ewmh, c, &vp, NULL ) ) { if ( current_desktop < vp.desktop_viewport_len ) { monitor_dimensions ( vp.desktop_viewport[current_desktop].x, - vp.desktop_viewport[current_desktop].y, mon ); + vp.desktop_viewport[current_desktop].y, mon ); xcb_ewmh_get_desktop_viewport_reply_wipe ( &vp ); return TRUE; } @@ -675,28 +760,28 @@ static gboolean x11_button_to_nk_bindings_button ( guint32 x11_button, NkBinding { switch ( x11_button ) { - case 1: - *button = NK_BINDINGS_MOUSE_BUTTON_PRIMARY; - break; - case 3: - *button = NK_BINDINGS_MOUSE_BUTTON_SECONDARY; - break; - case 2: - *button = NK_BINDINGS_MOUSE_BUTTON_MIDDLE; - break; - case 8: - *button = NK_BINDINGS_MOUSE_BUTTON_BACK; - break; - case 9: - *button = NK_BINDINGS_MOUSE_BUTTON_FORWARD; - break; - case 4: - case 5: - case 6: - case 7: - return FALSE; - default: - *button = NK_BINDINGS_MOUSE_BUTTON_EXTRA + x11_button; + case 1: + *button = NK_BINDINGS_MOUSE_BUTTON_PRIMARY; + break; + case 3: + *button = NK_BINDINGS_MOUSE_BUTTON_SECONDARY; + break; + case 2: + *button = NK_BINDINGS_MOUSE_BUTTON_MIDDLE; + break; + case 8: + *button = NK_BINDINGS_MOUSE_BUTTON_BACK; + break; + case 9: + *button = NK_BINDINGS_MOUSE_BUTTON_FORWARD; + break; + case 4: + case 5: + case 6: + case 7: + return FALSE; + default: + *button = NK_BINDINGS_MOUSE_BUTTON_EXTRA + x11_button; } return TRUE; } @@ -706,20 +791,20 @@ static gboolean x11_button_to_nk_bindings_scroll ( guint32 x11_button, NkBinding *steps = 1; switch ( x11_button ) { - case 4: - *steps = -1; - /* fallthrough */ - case 5: - *axis = NK_BINDINGS_SCROLL_AXIS_VERTICAL; - break; - case 6: - *steps = -1; - /* fallthrough */ - case 7: - *axis = NK_BINDINGS_SCROLL_AXIS_HORIZONTAL; - break; - default: - return FALSE; + case 4: + *steps = -1; + /* fallthrough */ + case 5: + *axis = NK_BINDINGS_SCROLL_AXIS_VERTICAL; + break; + case 6: + *steps = -1; + /* fallthrough */ + case 7: + *axis = NK_BINDINGS_SCROLL_AXIS_HORIZONTAL; + break; + default: + return FALSE; } return TRUE; } @@ -736,93 +821,93 @@ static void main_loop_x11_event_handler_view ( xcb_generic_event_t *event ) switch ( event->response_type & ~0x80 ) { - case XCB_EXPOSE: - rofi_view_frame_callback (); - break; - case XCB_CONFIGURE_NOTIFY: - { - xcb_configure_notify_event_t *xce = (xcb_configure_notify_event_t *) event; - rofi_view_temp_configure_notify ( state, xce ); - break; - } - case XCB_MOTION_NOTIFY: - { - if ( config.click_to_exit == TRUE ) { - xcb->mouse_seen = TRUE; - } - xcb_motion_notify_event_t *xme = (xcb_motion_notify_event_t *) event; - rofi_view_handle_mouse_motion ( state, xme->event_x, xme->event_y ); - break; - } - case XCB_BUTTON_PRESS: - { - xcb_button_press_event_t *bpe = (xcb_button_press_event_t *) event; - NkBindingsMouseButton button; - NkBindingsScrollAxis axis; - gint32 steps; - - xcb->last_timestamp = bpe->time; - rofi_view_handle_mouse_motion ( state, bpe->event_x, bpe->event_y ); - if ( x11_button_to_nk_bindings_button ( bpe->detail, &button ) ) - nk_bindings_seat_handle_button ( xcb->bindings_seat, NULL, button, NK_BINDINGS_BUTTON_STATE_PRESS, bpe->time ); - else if ( x11_button_to_nk_bindings_scroll ( bpe->detail, &axis, &steps) ) - nk_bindings_seat_handle_scroll ( xcb->bindings_seat, NULL, axis, steps ); - break; - } - case XCB_BUTTON_RELEASE: - { - xcb_button_release_event_t *bre = (xcb_button_release_event_t *) event; - NkBindingsMouseButton button; - - xcb->last_timestamp = bre->time; - if ( x11_button_to_nk_bindings_button ( bre->detail, &button ) ) - nk_bindings_seat_handle_button ( xcb->bindings_seat, NULL, button, NK_BINDINGS_BUTTON_STATE_RELEASE, bre->time ); - if ( config.click_to_exit == TRUE ) { - if ( !xcb->mouse_seen ) { - rofi_view_temp_click_to_exit ( state, bre->event ); + case XCB_EXPOSE: + rofi_view_frame_callback (); + break; + case XCB_CONFIGURE_NOTIFY: + { + xcb_configure_notify_event_t *xce = (xcb_configure_notify_event_t *) event; + rofi_view_temp_configure_notify ( state, xce ); + break; } - xcb->mouse_seen = FALSE; - } - break; - } - // Paste event. - case XCB_SELECTION_NOTIFY: - rofi_view_paste ( state, (xcb_selection_notify_event_t *) event ); - break; - case XCB_KEYMAP_NOTIFY: - { - xcb_keymap_notify_event_t *kne = (xcb_keymap_notify_event_t *) event; - for ( gint32 by = 0; by < 31; ++by ) { - for ( gint8 bi = 0; bi < 7; ++bi ) { - if ( kne->keys[by] & ( 1 << bi ) ) { - // X11 keycodes starts at 8 - nk_bindings_seat_handle_key ( xcb->bindings_seat, NULL, ( 8 * by + bi ) + 8, NK_BINDINGS_KEY_STATE_PRESSED ); + case XCB_MOTION_NOTIFY: + { + if ( config.click_to_exit == TRUE ) { + xcb->mouse_seen = TRUE; } + xcb_motion_notify_event_t *xme = (xcb_motion_notify_event_t *) event; + rofi_view_handle_mouse_motion ( state, xme->event_x, xme->event_y ); + break; } - } - break; - } - case XCB_KEY_PRESS: - { - xcb_key_press_event_t *xkpe = (xcb_key_press_event_t *) event; - gchar *text; - - xcb->last_timestamp = xkpe->time; - text = nk_bindings_seat_handle_key_with_modmask ( xcb->bindings_seat, NULL, xkpe->state, xkpe->detail, NK_BINDINGS_KEY_STATE_PRESS ); - if ( text != NULL ) { - rofi_view_handle_text ( state, text ); - } - break; - } - case XCB_KEY_RELEASE: - { - xcb_key_release_event_t *xkre = (xcb_key_release_event_t *) event; - xcb->last_timestamp = xkre->time; - nk_bindings_seat_handle_key ( xcb->bindings_seat, NULL, xkre->detail, NK_BINDINGS_KEY_STATE_RELEASE ); - break; - } - default: - break; + case XCB_BUTTON_PRESS: + { + xcb_button_press_event_t *bpe = (xcb_button_press_event_t *) event; + NkBindingsMouseButton button; + NkBindingsScrollAxis axis; + gint32 steps; + + xcb->last_timestamp = bpe->time; + rofi_view_handle_mouse_motion ( state, bpe->event_x, bpe->event_y ); + if ( x11_button_to_nk_bindings_button ( bpe->detail, &button ) ) + nk_bindings_seat_handle_button ( xcb->bindings_seat, NULL, button, NK_BINDINGS_BUTTON_STATE_PRESS, bpe->time ); + else if ( x11_button_to_nk_bindings_scroll ( bpe->detail, &axis, &steps) ) + nk_bindings_seat_handle_scroll ( xcb->bindings_seat, NULL, axis, steps ); + break; + } + case XCB_BUTTON_RELEASE: + { + xcb_button_release_event_t *bre = (xcb_button_release_event_t *) event; + NkBindingsMouseButton button; + + xcb->last_timestamp = bre->time; + if ( x11_button_to_nk_bindings_button ( bre->detail, &button ) ) + nk_bindings_seat_handle_button ( xcb->bindings_seat, NULL, button, NK_BINDINGS_BUTTON_STATE_RELEASE, bre->time ); + if ( config.click_to_exit == TRUE ) { + if ( !xcb->mouse_seen ) { + rofi_view_temp_click_to_exit ( state, bre->event ); + } + xcb->mouse_seen = FALSE; + } + break; + } + // Paste event. + case XCB_SELECTION_NOTIFY: + rofi_view_paste ( state, (xcb_selection_notify_event_t *) event ); + break; + case XCB_KEYMAP_NOTIFY: + { + xcb_keymap_notify_event_t *kne = (xcb_keymap_notify_event_t *) event; + for ( gint32 by = 0; by < 31; ++by ) { + for ( gint8 bi = 0; bi < 7; ++bi ) { + if ( kne->keys[by] & ( 1 << bi ) ) { + // X11 keycodes starts at 8 + nk_bindings_seat_handle_key ( xcb->bindings_seat, NULL, ( 8 * by + bi ) + 8, NK_BINDINGS_KEY_STATE_PRESSED ); + } + } + } + break; + } + case XCB_KEY_PRESS: + { + xcb_key_press_event_t *xkpe = (xcb_key_press_event_t *) event; + gchar *text; + + xcb->last_timestamp = xkpe->time; + text = nk_bindings_seat_handle_key_with_modmask ( xcb->bindings_seat, NULL, xkpe->state, xkpe->detail, NK_BINDINGS_KEY_STATE_PRESS ); + if ( text != NULL ) { + rofi_view_handle_text ( state, text ); + } + break; + } + case XCB_KEY_RELEASE: + { + xcb_key_release_event_t *xkre = (xcb_key_release_event_t *) event; + xcb->last_timestamp = xkre->time; + nk_bindings_seat_handle_key ( xcb->bindings_seat, NULL, xkre->detail, NK_BINDINGS_KEY_STATE_RELEASE ); + break; + } + default: + break; } rofi_view_maybe_update ( state ); } @@ -845,28 +930,28 @@ static gboolean main_loop_x11_event_handler ( xcb_generic_event_t *ev, G_GNUC_UN if ( type == xcb->xkb.first_event ) { switch ( ev->pad0 ) { - case XCB_XKB_MAP_NOTIFY: - { - struct xkb_keymap *keymap = xkb_x11_keymap_new_from_device ( nk_bindings_seat_get_context ( xcb->bindings_seat ), xcb->connection, xcb->xkb.device_id, 0 ); - struct xkb_state *state = xkb_x11_state_new_from_device ( keymap, xcb->connection, xcb->xkb.device_id ); - nk_bindings_seat_update_keymap ( xcb->bindings_seat, keymap, state ); - xkb_keymap_unref ( keymap ); - xkb_state_unref ( state ); - break; - } - case XCB_XKB_STATE_NOTIFY: - { - xcb_xkb_state_notify_event_t *ksne = (xcb_xkb_state_notify_event_t *) ev; - nk_bindings_seat_update_mask ( xcb->bindings_seat, NULL, - ksne->baseMods, - ksne->latchedMods, - ksne->lockedMods, - ksne->baseGroup, - ksne->latchedGroup, - ksne->lockedGroup ); - rofi_view_maybe_update ( rofi_view_get_active () ); - break; - } + case XCB_XKB_MAP_NOTIFY: + { + struct xkb_keymap *keymap = xkb_x11_keymap_new_from_device ( nk_bindings_seat_get_context ( xcb->bindings_seat ), xcb->connection, xcb->xkb.device_id, 0 ); + struct xkb_state *state = xkb_x11_state_new_from_device ( keymap, xcb->connection, xcb->xkb.device_id ); + nk_bindings_seat_update_keymap ( xcb->bindings_seat, keymap, state ); + xkb_keymap_unref ( keymap ); + xkb_state_unref ( state ); + break; + } + case XCB_XKB_STATE_NOTIFY: + { + xcb_xkb_state_notify_event_t *ksne = (xcb_xkb_state_notify_event_t *) ev; + nk_bindings_seat_update_mask ( xcb->bindings_seat, NULL, + ksne->baseMods, + ksne->latchedMods, + ksne->lockedMods, + ksne->baseGroup, + ksne->latchedGroup, + ksne->lockedGroup ); + rofi_view_maybe_update ( rofi_view_get_active () ); + break; + } } return G_SOURCE_CONTINUE; } @@ -886,7 +971,7 @@ static int take_pointer ( xcb_window_t w, int iters ) exit ( EXIT_FAILURE ); } xcb_grab_pointer_cookie_t cc = xcb_grab_pointer ( xcb->connection, 1, w, XCB_EVENT_MASK_BUTTON_RELEASE, - XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, w, XCB_NONE, XCB_CURRENT_TIME ); + XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, w, XCB_NONE, XCB_CURRENT_TIME ); xcb_grab_pointer_reply_t *r = xcb_grab_pointer_reply ( xcb->connection, cc, NULL ); if ( r ) { if ( r->status == XCB_GRAB_STATUS_SUCCESS ) { @@ -912,8 +997,8 @@ static int take_keyboard ( xcb_window_t w, int iters ) exit ( EXIT_FAILURE ); } xcb_grab_keyboard_cookie_t cc = xcb_grab_keyboard ( xcb->connection, - 1, w, XCB_CURRENT_TIME, XCB_GRAB_MODE_ASYNC, - XCB_GRAB_MODE_ASYNC ); + 1, w, XCB_CURRENT_TIME, XCB_GRAB_MODE_ASYNC, + XCB_GRAB_MODE_ASYNC ); xcb_grab_keyboard_reply_t *r = xcb_grab_keyboard_reply ( xcb->connection, cc, NULL ); if ( r ) { if ( r->status == XCB_GRAB_STATUS_SUCCESS ) { @@ -977,7 +1062,7 @@ static void x11_helper_discover_window_manager ( void ) { xcb_window_t wm_win = 0; xcb_get_property_cookie_t cc = xcb_ewmh_get_supporting_wm_check_unchecked ( &xcb->ewmh, - xcb_stuff_get_root_window () ); + xcb_stuff_get_root_window () ); if ( xcb_ewmh_get_supporting_wm_check_reply ( &xcb->ewmh, cc, &wm_win, NULL ) ) { xcb_ewmh_get_utf8_strings_reply_t wtitle; @@ -1027,7 +1112,7 @@ gboolean display_setup ( GMainLoop *main_loop, NkBindings *bindings ) TICK_N ( "Setup XCB" ); if ( xkb_x11_setup_xkb_extension ( xcb->connection, XKB_X11_MIN_MAJOR_XKB_VERSION, XKB_X11_MIN_MINOR_XKB_VERSION, - XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS, NULL, NULL, &xcb->xkb.first_event, NULL ) < 0 ) { + XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS, NULL, NULL, &xcb->xkb.first_event, NULL ) < 0 ) { g_warning ( "cannot setup XKB extension!" ); return FALSE; } @@ -1069,11 +1154,11 @@ gboolean display_setup ( GMainLoop *main_loop, NkBindings *bindings ) .stateDetails = required_state_details, }; xcb_xkb_select_events ( xcb->connection, xcb->xkb.device_id, required_events, /* affectWhich */ - 0, /* clear */ - required_events, /* selectAll */ - required_map_parts, /* affectMap */ - required_map_parts, /* map */ - &details ); + 0, /* clear */ + required_events, /* selectAll */ + required_map_parts, /* affectMap */ + required_map_parts, /* map */ + &details ); xcb->bindings_seat = nk_bindings_seat_new ( bindings, XKB_CONTEXT_NO_FLAGS ); struct xkb_keymap *keymap = xkb_x11_keymap_new_from_device ( nk_bindings_seat_get_context ( xcb->bindings_seat ), xcb->connection, xcb->xkb.device_id, XKB_KEYMAP_COMPILE_NO_FLAGS ); -- cgit v1.2.3 From 0f1717f829e95d7f3e1ac5b213d3f73f09b0da62 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Thu, 8 Feb 2018 17:56:31 +0100 Subject: [Script] Reset highlighting when reload view Issue: #767 --- Examples/test_script_mode.sh | 35 +++++++++++++++++++++++------------ source/dialogs/script.c | 17 ++++++++++++++++- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/Examples/test_script_mode.sh b/Examples/test_script_mode.sh index 61e29141..a58ef83e 100755 --- a/Examples/test_script_mode.sh +++ b/Examples/test_script_mode.sh @@ -1,17 +1,28 @@ #!/usr/bin/env bash -echo -en "\x00prompt\x1ftesting\n" -echo -en "\0urgent\x1f0,2\n" -echo -en "\0active\x1f1\n" -echo -en "\0markup-rows\x1ftrue\n" -echo -en "\0message\x1fSpecial boldmessage\n" +if [ x"$@" = x"quit" ] +then + exit 0 +fi -echo "aap" -echo "noot" -echo "mies" -echo "testing" -echo "Bold" -if [ -n "$@" ] +if [ "$@" ] then - echo "$@" + for a in {1..10} + do + echo "$a" + done + echo "quit" +else + echo -en "\x00prompt\x1ftesting\n" + echo -en "\0urgent\x1f0,2\n" + echo -en "\0active\x1f1\n" + echo -en "\0markup-rows\x1ftrue\n" + echo -en "\0message\x1fSpecial boldmessage\n" + + echo "aap" + echo "noot" + echo "mies" + echo "testing" + echo "Bold" + echo "quit" fi diff --git a/source/dialogs/script.c b/source/dialogs/script.c index 9daf1354..4f53ee3e 100644 --- a/source/dialogs/script.c +++ b/source/dialogs/script.c @@ -78,7 +78,7 @@ static void parse_header_entry ( Mode *sw, char *line, ssize_t length ) char *value = line + length_key + 1; if ( strcasecmp ( line, "message" ) == 0 ) { g_free ( pd->message ); - pd->message = g_strdup ( value ); + pd->message = strlen(value)? g_strdup ( value ):NULL; } else if ( strcasecmp ( line, "prompt" ) == 0 ) { g_free ( pd->prompt ); @@ -187,6 +187,19 @@ static unsigned int script_mode_get_num_entries ( const Mode *sw ) return rmpd->cmd_list_length; } +static void script_mode_reset_highlight ( Mode *sw ) +{ + ScriptModePrivateData *rmpd = (ScriptModePrivateData *) sw->private_data; + + rmpd->num_urgent_list = 0; + g_free ( rmpd->urgent_list ); + rmpd->urgent_list = NULL; + rmpd->num_active_list = 0; + g_free ( rmpd->active_list ); + rmpd->active_list = NULL; + +} + static ModeMode script_mode_result ( Mode *sw, int mretv, char **input, unsigned int selected_line ) { ScriptModePrivateData *rmpd = (ScriptModePrivateData *) sw->private_data; @@ -204,9 +217,11 @@ static ModeMode script_mode_result ( Mode *sw, int mretv, char **input, unsigned retv = ( mretv & MENU_LOWER_MASK ); } else if ( ( mretv & MENU_OK ) && rmpd->cmd_list[selected_line] != NULL ) { + script_mode_reset_highlight ( sw ); new_list = execute_executor ( sw, rmpd->cmd_list[selected_line], &new_length ); } else if ( ( mretv & MENU_CUSTOM_INPUT ) && *input != NULL && *input[0] != '\0' ) { + script_mode_reset_highlight ( sw ); new_list = execute_executor ( sw, *input, &new_length ); } -- cgit v1.2.3 From c37e2bc43f78979f672cae55ec919b401869204f Mon Sep 17 00:00:00 2001 From: dragon788 Date: Sun, 11 Feb 2018 07:30:27 -0600 Subject: Add some additional info on installing on 16.04 (#743) --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index e4da8f99..0f52d450 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -191,7 +191,7 @@ apt install rofi **Please note that the latest version of rofi in Ubuntu 16.04 is extremely outdated (v0.15.11)** -This will cause issues with newer scripts (i.e. with clerk) and we recommend to manually download and install the deb file for zesty instead. You can find the deb on [ubuntu's launchpad page for rofi](https://launchpad.net/ubuntu/+source/rofi). +This will cause issues with newer scripts (i.e. with clerk) and we recommend to manually download and install newer deb files for rofi and dependencies from Zesty instead. You can find the rofi deb on [ubuntu's launchpad page for rofi](https://launchpad.net/ubuntu/+source/rofi) and you will also need [xcb-util-xrm](https://launchpad.net/ubuntu/+source/xcb-util-xrm) and a newer [libxkbcommon](https://launchpad.net/ubuntu/+source/libxkbcommon). First install the dependencies using `sudo dpkg -i .deb` and then you should be able to `sudo dpkg -i rofi*.deb` and enjoy the features of the latest version. ### Fedora -- cgit v1.2.3 From d088e3a98b16d5560a2e3cc9efdf49f4723568af Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sun, 11 Feb 2018 15:34:51 +0100 Subject: Add warning to INSTALL. --- INSTALL.md | 1 + 1 file changed, 1 insertion(+) diff --git a/INSTALL.md b/INSTALL.md index 0f52d450..e36af7c4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -190,6 +190,7 @@ apt install rofi #### Ubuntu 16.04 Xenial **Please note that the latest version of rofi in Ubuntu 16.04 is extremely outdated (v0.15.11)** +**This workaround of installing packages from later versions is not adviced, use at your own risk.** This will cause issues with newer scripts (i.e. with clerk) and we recommend to manually download and install newer deb files for rofi and dependencies from Zesty instead. You can find the rofi deb on [ubuntu's launchpad page for rofi](https://launchpad.net/ubuntu/+source/rofi) and you will also need [xcb-util-xrm](https://launchpad.net/ubuntu/+source/xcb-util-xrm) and a newer [libxkbcommon](https://launchpad.net/ubuntu/+source/libxkbcommon). First install the dependencies using `sudo dpkg -i .deb` and then you should be able to `sudo dpkg -i rofi*.deb` and enjoy the features of the latest version. -- cgit v1.2.3 From 10e656c7ff5462fcc2e36b4f5fd0274d97a96e8d Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sun, 11 Feb 2018 15:45:03 +0100 Subject: Fix typo in INSTALL.MD --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index e36af7c4..1eda2e38 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -190,7 +190,7 @@ apt install rofi #### Ubuntu 16.04 Xenial **Please note that the latest version of rofi in Ubuntu 16.04 is extremely outdated (v0.15.11)** -**This workaround of installing packages from later versions is not adviced, use at your own risk.** +**This workaround of installing packages from later versions is not advised, use at your own risk.** This will cause issues with newer scripts (i.e. with clerk) and we recommend to manually download and install newer deb files for rofi and dependencies from Zesty instead. You can find the rofi deb on [ubuntu's launchpad page for rofi](https://launchpad.net/ubuntu/+source/rofi) and you will also need [xcb-util-xrm](https://launchpad.net/ubuntu/+source/xcb-util-xrm) and a newer [libxkbcommon](https://launchpad.net/ubuntu/+source/libxkbcommon). First install the dependencies using `sudo dpkg -i .deb` and then you should be able to `sudo dpkg -i rofi*.deb` and enjoy the features of the latest version. -- cgit v1.2.3 From 2c6782033761cbf230a6677470ac5bd3db24abbd Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Mon, 12 Feb 2018 21:37:29 +0100 Subject: Update 16.04 instruction for updating newer rofi. Remove instructions as they where considered dangerous. Basically we do not support 16.04 --- INSTALL.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 1eda2e38..66fb4a5a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -190,9 +190,10 @@ apt install rofi #### Ubuntu 16.04 Xenial **Please note that the latest version of rofi in Ubuntu 16.04 is extremely outdated (v0.15.11)** -**This workaround of installing packages from later versions is not advised, use at your own risk.** -This will cause issues with newer scripts (i.e. with clerk) and we recommend to manually download and install newer deb files for rofi and dependencies from Zesty instead. You can find the rofi deb on [ubuntu's launchpad page for rofi](https://launchpad.net/ubuntu/+source/rofi) and you will also need [xcb-util-xrm](https://launchpad.net/ubuntu/+source/xcb-util-xrm) and a newer [libxkbcommon](https://launchpad.net/ubuntu/+source/libxkbcommon). First install the dependencies using `sudo dpkg -i .deb` and then you should be able to `sudo dpkg -i rofi*.deb` and enjoy the features of the latest version. +This will cause issues with newer scripts (i.e. with clerk) and misses important updates and bug-fixes. +Newer versions of Rofi however requires versions of xcb-util-xrm and libxkbcommon then are not available in the 16.04 repositories. +These need to be manually installed before rofi can be installed either via source code or Zesty version from the [ubuntu's launchpad page for rofi](https://launchpad.net/ubuntu/+source/rofi). ### Fedora -- cgit v1.2.3 From cf5cbac823aabdf4957abfb17e0fd85d4c8536a5 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Mon, 12 Feb 2018 21:38:24 +0100 Subject: Fix type in install.md 16.04 instruction. --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 66fb4a5a..e59366af 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -192,7 +192,7 @@ apt install rofi **Please note that the latest version of rofi in Ubuntu 16.04 is extremely outdated (v0.15.11)** This will cause issues with newer scripts (i.e. with clerk) and misses important updates and bug-fixes. -Newer versions of Rofi however requires versions of xcb-util-xrm and libxkbcommon then are not available in the 16.04 repositories. +Newer versions of Rofi however requires versions of xcb-util-xrm and libxkbcommon that are not available in the 16.04 repositories. These need to be manually installed before rofi can be installed either via source code or Zesty version from the [ubuntu's launchpad page for rofi](https://launchpad.net/ubuntu/+source/rofi). ### Fedora -- cgit v1.2.3 From 0ccfef4289aae787c487dd13a9d5ef11f430c3e3 Mon Sep 17 00:00:00 2001 From: Diki Ananta Date: Mon, 19 Feb 2018 20:01:20 +0700 Subject: [Doc] Fix border in layout structure --- doc/rofi-theme.5 | 2 +- doc/rofi-theme.5.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/rofi-theme.5 b/doc/rofi-theme.5 index 61819787..0f8a34b2 100644 --- a/doc/rofi-theme.5 +++ b/doc/rofi-theme.5 @@ -1073,7 +1073,7 @@ The current layout of \fBrofi\fR is structured as follows: | | |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| | | | | | | | |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| | | -| | | sidebar {BOX:horizontal} | | | +| | | sidebar {BOX:horizontal} | | | | | | |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| |\-\-\-\-\-\-\-\-\-\-\-\-\-\-| |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| | | | | | | | Button | | Button | | Button | | Button | | | | | | | |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| |\-\-\-\-\-\-\-\-\-\-\-\-\-\-| |\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-| | | | diff --git a/doc/rofi-theme.5.markdown b/doc/rofi-theme.5.markdown index 37b68732..655f640e 100644 --- a/doc/rofi-theme.5.markdown +++ b/doc/rofi-theme.5.markdown @@ -686,7 +686,7 @@ The current layout of **rofi** is structured as follows: | | |-----------------------------------------------------------------------------| | | | | | | | |---------------------------------------------------------------------------| | | -| | | sidebar {BOX:horizontal} | | | +| | | sidebar {BOX:horizontal} | | | | | | |---------------| |---------------| |--------------| |---------------| | | | | | | | Button | | Button | | Button | | Button | | | | | | | |---------------| |---------------| |--------------| |---------------| | | | -- cgit v1.2.3 From d9d3724615d393d82da3f0913eb06447771fb171 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sun, 25 Feb 2018 15:18:37 +0100 Subject: Update themes from rofi-themes repository --- Makefile.am | 2 + meson.build | 2 + themes/Adapta-Nokto.rasi | 9 ++ themes/Arc-Dark.rasi | 146 ++++++++++++++++++++++++++++++ themes/Arc.rasi | 9 ++ themes/DarkBlue.rasi | 58 ++++++------ themes/Indego.rasi | 9 ++ themes/Monokai.rasi | 9 ++ themes/Paper.rasi | 9 ++ themes/Pop-Dark.rasi | 9 ++ themes/android_notification.rasi | 9 ++ themes/arthur.rasi | 9 +- themes/blue.rasi | 9 ++ themes/c64.rasi | 54 +++++------ themes/glue_pro_blue.rasi | 56 ++++++------ themes/gruvbox-common.rasi | 127 ++++++++++++++++++++++++++ themes/gruvbox-dark-hard.rasi | 190 ++++++++++++-------------------------- themes/gruvbox-dark-soft.rasi | 191 ++++++++++++--------------------------- themes/gruvbox-dark.rasi | 191 ++++++++++++--------------------------- themes/gruvbox-light-hard.rasi | 190 ++++++++++++-------------------------- themes/gruvbox-light-soft.rasi | 191 ++++++++++++--------------------------- themes/gruvbox-light.rasi | 191 ++++++++++++--------------------------- themes/lb.rasi | 9 ++ themes/paper-float.rasi | 9 ++ themes/purple.rasi | 54 +++++------ themes/sidebar.rasi | 26 +++++- themes/solarized.rasi | 54 +++++------ themes/solarized_alternate.rasi | 54 +++++------ 28 files changed, 906 insertions(+), 970 deletions(-) create mode 100644 themes/Arc-Dark.rasi create mode 100644 themes/gruvbox-common.rasi diff --git a/Makefile.am b/Makefile.am index efa65c4b..ab22637b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -195,6 +195,7 @@ themedir=$(pkgdatadir)/themes/ theme_DATA=\ themes/Adapta-Nokto.rasi\ themes/Arc.rasi\ + themes/Arc-Dark.rasi\ themes/DarkBlue.rasi\ themes/Pop-Dark.rasi\ themes/Indego.rasi\ @@ -206,6 +207,7 @@ theme_DATA=\ themes/c64.rasi\ themes/dmenu.rasi\ themes/glue_pro_blue.rasi\ + themes/gruvbox-common.rasi\ themes/gruvbox-dark-hard.rasi\ themes/gruvbox-dark-soft.rasi\ themes/gruvbox-dark.rasi\ diff --git a/meson.build b/meson.build index 40f36a01..c5cfbe53 100644 --- a/meson.build +++ b/meson.build @@ -218,6 +218,7 @@ install_man( install_data( 'themes/Adapta-Nokto.rasi', 'themes/Arc.rasi', + 'themes/Arc-Dark.rasi', 'themes/DarkBlue.rasi', 'themes/Pop-Dark.rasi', 'themes/Indego.rasi', @@ -229,6 +230,7 @@ install_data( 'themes/c64.rasi', 'themes/dmenu.rasi', 'themes/glue_pro_blue.rasi', + 'themes/gruvbox-common.rasi', 'themes/gruvbox-dark-hard.rasi', 'themes/gruvbox-dark-soft.rasi', 'themes/gruvbox-dark.rasi', diff --git a/themes/Adapta-Nokto.rasi b/themes/Adapta-Nokto.rasi index fdbe95b8..bc69bb10 100644 --- a/themes/Adapta-Nokto.rasi +++ b/themes/Adapta-Nokto.rasi @@ -132,3 +132,12 @@ spacing: 0; text-color: @normal-foreground; } +#inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +#textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em ; + text-color: @normal-foreground; +} diff --git a/themes/Arc-Dark.rasi b/themes/Arc-Dark.rasi new file mode 100644 index 00000000..5f5cf399 --- /dev/null +++ b/themes/Arc-Dark.rasi @@ -0,0 +1,146 @@ +/************************************************ + * ROFI Color theme + * User: leofa + * Copyright: 2017 leofa + ***********************************************/ + +* { + selected-normal-foreground: rgba ( 249, 249, 249, 100 % ); + foreground: rgba ( 196, 203, 212, 100 % ); + normal-foreground: @foreground; + alternate-normal-background: rgba ( 64, 69, 82, 59 % ); + red: rgba ( 220, 50, 47, 100 % ); + selected-urgent-foreground: rgba ( 249, 249, 249, 100 % ); + blue: rgba ( 38, 139, 210, 100 % ); + urgent-foreground: rgba ( 204, 102, 102, 100 % ); + alternate-urgent-background: rgba ( 75, 81, 96, 90 % ); + active-foreground: rgba ( 101, 172, 255, 100 % ); + lightbg: rgba ( 238, 232, 213, 100 % ); + selected-active-foreground: rgba ( 249, 249, 249, 100 % ); + alternate-active-background: rgba ( 75, 81, 96, 89 % ); + background: rgba ( 45, 48, 59, 95 % ); + alternate-normal-foreground: @foreground; + normal-background: @background; + lightfg: rgba ( 88, 104, 117, 100 % ); + selected-normal-background: rgba ( 64, 132, 214, 100 % ); + border-color: rgba ( 124, 131, 137, 100 % ); + spacing: 2; + separatorcolor: rgba ( 29, 31, 33, 100 % ); + urgent-background: rgba ( 29, 31, 33, 17 % ); + selected-urgent-background: rgba ( 165, 66, 66, 100 % ); + alternate-urgent-foreground: @urgent-foreground; + background-color: rgba ( 0, 0, 0, 0 % ); + alternate-active-foreground: @active-foreground; + active-background: rgba ( 29, 31, 33, 17 % ); + selected-active-background: rgba ( 68, 145, 237, 100 % ); +} +#window { + background-color: @background; + border: 1; + padding: 5; +} +#mainbox { + border: 0; + padding: 0; +} +#message { + border: 2px 0px 0px ; + border-color: @separatorcolor; + padding: 1px ; +} +#textbox { + text-color: @foreground; +} +#listview { + fixed-height: 0; + border: 2px 0px 0px ; + border-color: @separatorcolor; + spacing: 2px ; + scrollbar: true; + padding: 2px 0px 0px ; +} +#element { + border: 0; + padding: 1px ; +} +#element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} +#element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} +#element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} +#element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +#element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} +#element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} +#element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} +#element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} +#element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} +#scrollbar { + width: 4px ; + border: 0; + handle-color: @normal-foreground; + handle-width: 8px ; + padding: 0; +} +#sidebar { + border: 2px 0px 0px ; + border-color: @separatorcolor; +} +#button { + spacing: 0; + text-color: @normal-foreground; +} +#button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} +#inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px ; +} +#case-indicator { + spacing: 0; + text-color: @normal-foreground; +} +#entry { + spacing: 0; + text-color: @normal-foreground; +} +#prompt { + spacing: 0; + text-color: @normal-foreground; +} +#inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +#textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em ; + text-color: @normal-foreground; +} diff --git a/themes/Arc.rasi b/themes/Arc.rasi index 48d83ec5..7d065755 100644 --- a/themes/Arc.rasi +++ b/themes/Arc.rasi @@ -131,3 +131,12 @@ spacing: 0; text-color: @normal-foreground; } +#inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} +#textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em ; + text-color: @normal-foreground; +} diff --git a/themes/DarkBlue.rasi b/themes/DarkBlue.rasi index ade80e65..ef073f36 100644 --- a/themes/DarkBlue.rasi +++ b/themes/DarkBlue.rasi @@ -35,106 +35,108 @@ active-background: rgba ( 0, 0, 208, 0 % ); selected-active-background: rgba ( 138, 196, 255, 100 % ); } -window { +#window { background-color: @background; border: 1; padding: 5; } -mainbox { +#mainbox { border: 0; padding: 0; } -message { +#message { border: 2px 0px 0px ; border-color: @separatorcolor; padding: 1px ; } -textbox { +#textbox { text-color: @foreground; } -listview { - fixed-height: false; +#listview { + fixed-height: 0; border: 2px 0px 0px ; border-color: @separatorcolor; spacing: 2px ; scrollbar: true; padding: 2px 0px 0px ; } -element { +#element { border: 0; padding: 1px ; } -element.normal.normal { +#element.normal.normal { background-color: @normal-background; text-color: @normal-foreground; } -element.normal.urgent { +#element.normal.urgent { background-color: @urgent-background; text-color: @urgent-foreground; } -element.normal.active { +#element.normal.active { background-color: @active-background; text-color: @active-foreground; } -element.selected.normal { +#element.selected.normal { background-color: @selected-normal-background; text-color: @selected-normal-foreground; } -element.selected.urgent { +#element.selected.urgent { background-color: @selected-urgent-background; text-color: @selected-urgent-foreground; } -element.selected.active { +#element.selected.active { background-color: @selected-active-background; text-color: @selected-active-foreground; } -element.alternate.normal { +#element.alternate.normal { background-color: @alternate-normal-background; text-color: @alternate-normal-foreground; } -element.alternate.urgent { +#element.alternate.urgent { background-color: @alternate-urgent-background; text-color: @alternate-urgent-foreground; } -element.alternate.active { +#element.alternate.active { background-color: @alternate-active-background; text-color: @alternate-active-foreground; } -scrollbar { +#scrollbar { width: 4px ; border: 0; handle-width: 8px ; padding: 0; } -sidebar { +#sidebar { border: 2px 0px 0px ; border-color: @separatorcolor; } -button.selected { +#button.selected { background-color: @selected-normal-background; text-color: @selected-normal-foreground; } -inputbar { +#inputbar { spacing: 0;