diff options
64 files changed, 1890 insertions, 1196 deletions
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 5eac0df8..f6452165 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,3 +1,5 @@ + :arrow_right: First read the [guidelines](https://github.com/DaveDavenport/rofi/blob/next/.github/CONTRIBUTING.md)! :arrow_left: + ## Version Output of `rofi -v` @@ -1,3 +1,24 @@ +v1.4.3 (dev): + - Dump theme without # prefix and separator . + - Store default theme in rofi binary using GResources. + - Add extra margin between prompt and entry. + - Remove colon from prompt. (#637) + - Add support for passing extra properties in script mode. + - Better error message on invalid argb syntax. + - Fix default theme border. + - Make '#' in the parser optional. + - Update themes. + - Add -drun/window-match-fields option (thx to Askrenteam) for drun/window menu. (#690/#656) + - Implement negated match. (#665) + - Fix parsing of non-existing fields. (#700) + - rofi-theme-selector fixes. + - Fix spelling error (thx to jmkjaer) + - Fix test on i686/arm. (#692) + - Fix error in theme manpage. (#686) + - Allow history size to be specified. (#613) + - Fix drun history implementation. (#579) + - Add gentoo install instruction. (#685) + v1.4.2: - Add sort to manpage. (#682) - Add tranaparent to theme manpage. (#688) diff --git a/Examples/test_script_mode.sh b/Examples/test_script_mode.sh new file mode 100755 index 00000000..a57c9040 --- /dev/null +++ b/Examples/test_script_mode.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +echo -en "\0prompt\x1ftesting\n" +echo -en "\0urgent\x1f0,2\n" +echo -en "\0active\x1f1\n" +echo -en "\0message\x1fSpecial message\n" + +echo "aap" +echo "noot" +echo "mies" +echo "testing" +if [ -n "$@" ] +then + echo "$@" +fi diff --git a/Makefile.am b/Makefile.am index adf4d94c..df9c2294 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,17 @@ pkgconfig_DATA = pkgconfig/rofi.pc BUILT_SOURCES=\ lexer/theme-parser.h\ lexer/theme-parser.c\ - lexer/theme-lexer.c + lexer/theme-lexer.c\ + resources/resources.c\ + resources/resources.h + +$(top_builddir)/resources/resources.c: $(top_srcdir)/resources/resources.xml + mkdir -p $(top_builddir)/resources/ + $(GLIB_COMPILE_RESOURCES) $< --generate-source --target=$@ --sourcedir=$(top_srcdir) + +$(top_builddir)/resources/resources.h: $(top_srcdir)/resources/resources.xml + mkdir -p $(top_builddir)/resources/ + $(GLIB_COMPILE_RESOURCES) $< --generate-header --target=$@ --sourcedir=$(top_srcdir) $(top_builddir)/lexer/theme-lexer.c: $(top_srcdir)/lexer/theme-lexer.l @@ -32,7 +42,8 @@ rofiincludedir=${includedir}/rofi rofiinclude_HEADERS=\ include/mode.h\ include/mode-private.h\ - include/helper.h + include/helper.h\ + include/rofi-types.h ## # Rofi the program @@ -91,7 +102,6 @@ SOURCES=\ include/history.h\ include/theme.h\ include/css-colors.h\ - include/default-theme.h\ include/widgets/box.h\ include/widgets/container.h\ include/widgets/widget.h\ @@ -108,11 +118,14 @@ SOURCES=\ include/dialogs/script.h\ include/dialogs/window.h\ include/dialogs/dialogs.h\ - include/dialogs/help-keys.h + include/dialogs/help-keys.h\ + resources/resources.c\ + resources/resources.h rofi_SOURCES=\ lexer/theme-parser.y\ lexer/theme-lexer.l\ + resources/resources.xml\ $(SOURCES) rofi_CFLAGS=\ @@ -128,6 +141,7 @@ rofi_CFLAGS=\ -I$(top_srcdir)/include/\ -I$(top_builddir)/lexer/\ -I$(top_srcdir)/lexer/\ + -I$(top_builddir)/resources/\ -I$(top_srcdir)/config/\ -I$(top_builddir)/\ -Werror=missing-prototypes\ @@ -216,6 +230,7 @@ EXTRA_DIST+=\ doc/rofi.doxy.in\ script/get_git_rev.sh\ $(theme_DATA)\ + doc/default_theme.rasi\ Changelog ## # Indent @@ -235,14 +250,13 @@ check_PROGRAMS+=\ helper_test\ helper_expand\ helper_pidfile\ - helper_tokenize\ helper_config_cmdline_parser\ widget_test\ box_test\ scrollbar_test if USE_CHECK -check_PROGRAMS+=mode_test theme_parser_test +check_PROGRAMS+=mode_test theme_parser_test helper_tokenize endif @@ -316,22 +330,6 @@ helper_pidfile_SOURCES=\ source/xrmoptions.c\ test/helper-pidfile.c -helper_tokenize_CFLAGS=$(textbox_test_CFLAGS) -helper_tokenize_LDADD=$(textbox_test_LDADD) -helper_tokenize_SOURCES=\ - config/config.c\ - include/rofi.h\ - include/mode.h\ - include/mode-private.h\ - source/helper.c\ - source/rofi-types.c\ - include/rofi-types.h\ - include/helper.h\ - include/helper-theme.h\ - include/xrmoptions.h\ - source/xrmoptions.c\ - test/helper-tokenize.c - widget_test_LDADD=$(textbox_test_LDADD) widget_test_CFLAGS=$(textbox_test_CFLAGS) widget_test_SOURCES=\ @@ -519,6 +517,22 @@ mode_test_SOURCES=\ source/keyb.c\ include/mode.h\ include/mode-private.h +helper_tokenize_CFLAGS=$(textbox_test_CFLAGS) $(check_CFLAGS) +helper_tokenize_LDADD=$(textbox_test_LDADD) $(check_LIBS) +helper_tokenize_SOURCES=\ + config/config.c\ + include/rofi.h\ + include/mode.h\ + include/mode-private.h\ + source/helper.c\ + source/rofi-types.c\ + include/rofi-types.h\ + include/helper.h\ + include/helper-theme.h\ + include/xrmoptions.h\ + source/xrmoptions.c\ + test/helper-tokenize.c + endif TESTS+=\ @@ -526,7 +540,6 @@ TESTS+=\ helper_test\ helper_expand\ helper_pidfile\ - helper_tokenize\ helper_config_cmdline_parser\ textbox_test\ widget_test\ @@ -535,6 +548,7 @@ TESTS+=\ if USE_CHECK TESTS+=theme_parser_test\ + helper_tokenize\ mode_test endif @@ -564,6 +578,8 @@ doxy: doc/rofi.doxy $(rofi_SOURCES) clean-local: -rm $(top_builddir)/gitconfig.h + -rm $(top_builddir)/resources/resources.h + -rm $(top_builddir)/resources/resources.c $(top_builddir)/gitconfig.h: .FORCE $(top_srcdir)/script/get_git_rev.sh $(top_srcdir) $(top_builddir)/gitconfig.h diff --git a/config/config.c b/config/config.c index 501ea008..7c43abf9 100644 --- a/config/config.c +++ b/config/config.c @@ -36,39 +36,39 @@ Settings config = { /** List of enabled modi. */ /** -modi */ #ifdef WINDOW_MODE - .modi = "window,run,ssh", + .modi = "window,run,ssh", #else - .modi = "run,ssh", + .modi = "run,ssh", #endif /** Border width around the window. */ - .menu_bw = 1, + .menu_bw = 1, /** The width of the switcher. (0100 in % > 100 in pixels) */ - .menu_width = 50, + .menu_width = 50, /** Maximum number of options to show. */ - .menu_lines = 15, + .menu_lines = 15, /** Number of columns */ - .menu_columns = 1, + .menu_columns = 1, /** Font */ - .menu_font = "mono 12", + .menu_font = "mono 12", /** Whether to load and show icons */ - .show_icons = FALSE, + .show_icons = FALSE, /** Terminal to use. (for ssh and open in terminal) */ .terminal_emulator = "rofi-sensible-terminal", .ssh_client = "ssh", /** Command when executing ssh. */ - .ssh_command = "{terminal} -e {ssh-client} {host}", + .ssh_command = "{terminal} -e {ssh-client} {host}", /** Command when running */ - .run_command = "{cmd}", + .run_command = "{cmd}", /** Command used to list executable commands. empty -> internal */ - .run_list_command = "", + .run_list_command = "", /** Command executed when running application in terminal */ - .run_shell_command = "{terminal} -e {cmd}", + .run_shell_command = "{terminal} -e {cmd}", /** Command executed on accep-entry-custom for window modus */ - .window_command = "xkill -id {window}", + .window_command = "xkill -id {window}", /** No default icon theme, we search Adwaita and gnome as fallback */ - .drun_icon_theme = NULL, + .drun_icon_theme = NULL, /** * Location of the window. * Enumeration indicating location or gravity of window. @@ -80,49 +80,53 @@ Settings config = { * WL_SOUTH_WEST WL_SOUTH WL_SOUTH_EAST * */ - .location = WL_CENTER, + .location = WL_CENTER, /** Padding between elements */ - .padding = 5, + .padding = 5, /** Y offset */ - .y_offset = 0, + .y_offset = 0, /** X offset */ - .x_offset = 0, + .x_offset = 0, /** Always show config.menu_lines lines, even if less lines are available */ - .fixed_num_lines = TRUE, + .fixed_num_lines = TRUE, /** Do not use history */ - .disable_history = FALSE, + .disable_history = FALSE, /** Sort the displayed list */ - .sort = FALSE, + .sort = FALSE, /** Use levenshtein sorting when matching */ - .levenshtein_sort = FALSE, + .levenshtein_sort = FALSE, /** Case sensitivity of the search */ - .case_sensitive = FALSE, + .case_sensitive = FALSE, /** Cycle through in the element list */ - .cycle = TRUE, + .cycle = TRUE, /** Height of an element in #chars */ - .element_height = 1, + .element_height = 1, /** Sidebar mode, show the modi */ - .sidebar_mode = FALSE, + .sidebar_mode = FALSE, /** auto select */ - .auto_select = FALSE, + .auto_select = FALSE, /** Parse /etc/hosts file in ssh view. */ - .parse_hosts = FALSE, + .parse_hosts = FALSE, /** Parse ~/.ssh/known_hosts file in ssh view. */ - .parse_known_hosts = TRUE, + .parse_known_hosts = TRUE, /** Modi to combine into one view. */ .combi_modi = "window,run", .tokenize = TRUE, .matching = "normal", .matching_method = MM_NORMAL, + /** Desktop entry fields to match*/ + .drun_match_fields = "all", + /** Window fields to match in window mode*/ + .window_match_fields = "all", /** Monitor */ - .monitor = "-5", + .monitor = "-5", /** set line margin */ .line_margin = 2, .line_padding = 1, /** Set filter */ - .filter = NULL, + .filter = NULL, /** Separator style: dash/solid */ - .separator_style = "dash", + .separator_style = "dash", /** Hide scrollbar */ .hide_scrollbar = FALSE, .fullscreen = FALSE, @@ -141,4 +145,5 @@ Settings config = { .color_urgent = NULL, .color_window = NULL, .plugin_path = PLUGIN_PATH, + .max_history_size = 25, }; diff --git a/configure.ac b/configure.ac index 4591e668..9357964e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rofi], [1.4.2], [https://github.com/DaveDavenport/rofi/],[],[https://reddit.com/r/qtools/]) +AC_INIT([rofi], [1.4.99-dev], [https://github.com/DaveDavenport/rofi/],[],[https://reddit.com/r/qtools/]) AC_CONFIG_SRCDIR([source/rofi.c]) AC_CONFIG_HEADER([config.h]) @@ -135,6 +135,11 @@ AS_IF([test "x${enable_check}" != "xno"], [ PKG_CHECK_MODULES([check],[check >= AM_CONDITIONAL([USE_CHECK], [test "x${enable_check}" != "xno" && test "$HAVE_CHECK" -eq 1]) +dnl --------------------------------------------------------------------- +dnl Gets the resource compile tool path. +dnl --------------------------------------------------------------------- +AM_PATH_GLIB_2_0 + dnl --------------------------------------------------------------------- dnl Add extra compiler flags diff --git a/doc/default_theme.rasi b/doc/default_theme.rasi index 67a606cb..ebf9bbbb 100644 --- a/doc/default_theme.rasi +++ b/doc/default_theme.rasi @@ -1,3 +1,6 @@ +/** + * rofi -dump-theme output. + **/ * { selected-normal-foreground: @lightbg; foreground: rgba ( 0, 43, 54, 100 % ); @@ -28,24 +31,24 @@ active-background: @background; selected-active-background: @blue; } -#window { +window { background-color: @background; border: 1; padding: 5; } -#mainbox { +mainbox { border: 0; padding: 0; } -#message { - border: 1px dash 0px 0px ; +message { + border: 2px dash 0px 0px ; border-color: @separatorcolor; padding: 1px ; } -#textbox { +textbox { text-color: @foreground; } -#listview { +listview { fixed-height: 0; border: 2px dash 0px 0px ; border-color: @separatorcolor; @@ -53,79 +56,79 @@ 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-color: @normal-foreground; handle-width: 8px ; padding: 0; } -#sidebar { +sidebar { border: 2px dash 0px 0px ; border-color: @separatorcolor; } -#button { +button { spacing: 0; text-color: @normal-foreground; } -#button.selected { +button selected { background-color: @selected-normal-background; text-color: @selected-normal-foreground; } -#inputbar { - spacing: 0; +inputbar { + spacing: 3px ; text-color: @normal-foreground; padding: 1px ; } -#case-indicator { +case-indicator { spacing: 0; text-color: @normal-foreground; } -#entry { +entry { spacing: 0; text-color: @normal-foreground; } -#prompt { +prompt { spacing: 0; text-color: @normal-foreground; } diff --git a/doc/help-output.txt b/doc/help-output.txt index d89449e1..f740c4fa 100644 --- a/doc/help-output.txt +++ b/doc/help-output.txt @@ -15,6 +15,7 @@ Command line only options: -show [mode] Show the mode 'mode' and exit. The mode has to be enabled. -no-lazy-grab Disable lazy grab that, when fail to grab keyboard, does not block but retry later. -no-plugins |