Simple maintenance improvements (#1370)

* rofi moved to libera.chat

* unify some theme headers and whitespace

* consistently use the same hashbang for bash

* improve obsolete way of testing equality

see https://github.com/koalaman/shellcheck/wiki/SC2268 for explanation

* use consistent function definitions in bash scripts

* remove duplicated author and fix whitespace

* quote all variables in scripts

fixes many warnings identified through shellcheck

* fix whitespace in scripts

* fix whitespace in non-source files

* fix spelling in non-source files

* fix whitespace and indentation in source files

* fix spelling in source files
This commit is contained in:
a1346054 2021-08-14 11:03:16 +00:00 committed by GitHub
parent 69c6004681
commit c62137f8ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
113 changed files with 784 additions and 832 deletions

View File

@ -69,10 +69,10 @@ When reporting a feature request include the following information:
* A use-case for the feature.
If possible try to explain how you would expect to use feature.
For example, should it be a configuration option or a hot-key.
For example, should it be a configuration option or a hot-key.
Requesting a feature is no guarantee it will be added.
**Please do not submit reports related to wayland, see
[here](https://github.com/DaveDavenport/rofi/wiki/Wayland) for more
information.**

View File

@ -7,5 +7,5 @@ contact_links:
url: https://www.reddit.com/r/qtools/
about: Please ask and answer questions here.
- name: Rofi IRC channel
url: https://webchat.freenode.net/?channels=#rofi
url: https://web.libera.chat/?channels=#rofi
about: Please ask and answer question in real time here.

View File

@ -6,7 +6,7 @@ before_script:
- apt-get install --force-yes -y autoconf automake make libx11-dev libpango1.0-dev libcairo2-dev libstartup-notification0-dev libxcb-icccm4-dev libxcb-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libx11-xcb-dev
- apt-get install --force-yes -y libxcb1-dev xvfb discount xdotool fluxbox libxkbcommon-dev libxkbcommon-x11-dev libxcb-ewmh-dev xutils-dev libtool lcov libxcb-randr0-dev doxygen python flex bison librsvg2-dev texinfo
- git clone --recursive https://github.com/Airblader/xcb-util-xrm.git
- cd xcb-util-xrm
- cd xcb-util-xrm
- ./autogen.sh --prefix=/usr
- make
- sudo make install
@ -34,5 +34,5 @@ build-rofi:
artifacts:
expire_in: 2 weeks
paths:
- coverage
- coverage
- doc/html

11
AUTHORS
View File

@ -1,5 +1,5 @@
Aaron Ash
Adrià Farrés
Aaron Ash
Adrià Farrés
Anton Löfgren
Avatar
bendem
@ -9,7 +9,7 @@ Bruno Braga
Buglloc
Chris Salzberg
daemoni
Dan Beste
Dan Beste
Daniel Hahler
DanteFireX
Dave Davenport
@ -18,9 +18,9 @@ Dimitar Yordanov
Edwin Pujols
eigengrau
Eric Engeström
Fangrui Song
Fangrui Song
fice-t
Florian Franzen
Florian Franzen
Gabriel Holodak
Gareth Poole
Georgios Bitzes
@ -44,7 +44,6 @@ N. Izumi
Paulo Flabiano Smorigo
Peter Cannici
qedi
qedi
Quentin Glidic
Rasmus Steinke
Roomcays

View File

@ -139,14 +139,14 @@ v1.5.0:
- Fix drun history implementation. (#579)
- Add gentoo install instruction. (#685)
v1.4.2:
v1.4.2:
- Add sort to manpage. (#682)
- Add tranaparent to theme manpage. (#688)
- Re-add theme headers. (#679)
- Fix super key. (#684)
- Unknown option libnkutils:uuid. (#677)
- Mode window is not found. (#686)
- Fix meson build in dist file.
- Fix meson build in dist file.
v1.4.1: All Hail Rasi
- Bump meson release version
@ -233,7 +233,7 @@ v1.3.0: Dan vs. Greg: The never ending story.
- Add Control+G for cancel (#452)
- Add padding option to textbox (#449)
- Ctrl-click does alternate accept entry. (#429)
- Hide window decoration in normal window mode.
- Hide window decoration in normal window mode.
- Click to exit option. (#460)
- Fix cursor blinking on moving. (#462)
- Remove entry from history if fails to execute (#466)
@ -244,16 +244,16 @@ v1.3.0: Dan vs. Greg: The never ending story.
- Improve scrollbar behaviour.
Removals
- opacity option. The transparency support in the theme can do the same and more.
v1.2.0
New Features
- Highlight matched part of the string.
- Make window switcher string customizable.
Improvements
- Improved selection mode in dmenu with selection counter.
- Improved selection mode in dmenu with selection counter.
- Improved selection mode with 'dot' indicator.
- Fix Current Desktop window switcher.
- Fix launching in terminal.
- Fix launching in terminal.
- Supports include in config.
- Add Control+k remove till eol keybinding.
- Change clear line to Control+w and make Control+u remove till sol (matching readline)
@ -471,7 +471,7 @@ v1.1.0
- Better way to determine font height.
- Fix font vertical centering.
- One-off when pasting text.
- Improve rendering of boxes (fixed height and margins)
- Improve rendering of boxes (fixed height and margins)
- Fix modi switcher boxes size+layout.
- Reduce work on redraws (do not always calculate new size/position), set text, etc.
- OO-ify the switchers.

View File

@ -1,10 +1,10 @@
#!/bin/bash
#!/usr/bin/env bash
MAX_DESKTOPS=20
WORKSPACES=$(seq -s '\n' 1 1 ${MAX_DESKTOPS})
WORKSPACES=$(seq -s '\n' 1 1 "${MAX_DESKTOPS}")
EMPTY_WORKSPACE=$( (i3-msg -t get_workspaces | tr ',' '\n' | grep num | awk -F: '{print int($2)}' ; \
echo -e ${WORKSPACES} ) | sort -n | uniq -u | head -n 1)
EMPTY_WORKSPACE=$( (i3-msg -t get_workspaces | tr ',' '\n' | grep num | awk -F: '{print int($2)}' ; \
echo -e "${WORKSPACES}" ) | sort -n | uniq -u | head -n 1)
i3-msg workspace ${EMPTY_WORKSPACE}
i3-msg workspace "${EMPTY_WORKSPACE}"

View File

@ -1,18 +1,17 @@
#!/bin/bash
#!/usr/bin/env bash
if [ -z $@ ]
then
function gen_workspaces()
gen_workspaces()
{
i3-msg -t get_workspaces | tr ',' '\n' | grep "name" | sed 's/"name":"\(.*\)"/\1/g' | sort -n
}
echo empty; gen_workspaces
else
WORKSPACE=$@
if [ x"empty" = x"${WORKSPACE}" ]
if [ "${WORKSPACE}" = "empty" ]
then
i3_empty_workspace.sh >/dev/null
elif [ -n "${WORKSPACE}" ]

View File

@ -3,7 +3,7 @@
# Various options for the file browser script:
ROFI_FB_GENERIC_FO="xdg-open" # command used for opening the selection
ROFI_FB_PREV_LOC_FILE=~/.local/share/rofi/rofi_fb_prevloc
ROFI_FB_HISTORY_FILE=~/.local/share/rofi/rofi_fb_history
ROFI_FB_HISTORY_FILE=~/.local/share/rofi/rofi_fb_history
ROFI_FB_HISTORY_MAXCOUNT=5 # maximum number of history entries
# Comment the next variable to always start in the last visited directory,
# otherwise rofi_fb will start in the specified directory:
@ -11,14 +11,13 @@ ROFI_FB_START_DIR=$HOME # starting directory
# Uncomment the following line to disable history:
# ROFI_FB_NO_HISTORY=1
# Beginning of the script:
# Create the directory for the files of the script
if [ ! -d $(dirname "${ROFI_FB_PREV_LOC_FILE}") ]
if [ ! -d "$(dirname "${ROFI_FB_PREV_LOC_FILE}")" ]
then
mkdir -p "$(dirname "${ROFI_FB_PREV_LOC_FILE}")"
fi
if [ ! -d $(dirname "${ROFI_FB_HISTORY_FILE}") ]
if [ ! -d "$(dirname "${ROFI_FB_HISTORY_FILE}")" ]
then
mkdir -p "$(dirname "${ROFI_FB_HISTORY_FILE}")"
fi
@ -34,8 +33,8 @@ fi
# Read last location, otherwise we default to $ROFI_FB_START_DIR or $PWD.
if [ -f "${ROFI_FB_PREV_LOC_FILE}" ]
then
ROFI_FB_CUR_DIR=$(cat "${ROFI_FB_PREV_LOC_FILE}")
fi
ROFI_FB_CUR_DIR=$(cat "${ROFI_FB_PREV_LOC_FILE}")
fi
# Handle argument.
if [ -n "$@" ]
@ -53,7 +52,7 @@ if [ ! -d "${ROFI_FB_CUR_DIR}" ]
then
if [ -x "${ROFI_FB_CUR_DIR}" ]
then
coproc ( "${ROFI_FB_CUR_DIR}" > /dev/null 2>&1 )
coproc ( "${ROFI_FB_CUR_DIR}" >/dev/null 2>&1 )
exec 1>&-
exit;
elif [ -f "${ROFI_FB_CUR_DIR}" ]
@ -64,13 +63,13 @@ then
sed -i "s|${ROFI_FB_CUR_DIR}|##deleted##|g" "${ROFI_FB_HISTORY_FILE}"
sed -i '/##deleted##/d' "${ROFI_FB_HISTORY_FILE}"
echo "${ROFI_FB_CUR_DIR}" >> "${ROFI_FB_HISTORY_FILE}"
if [ $( wc -l < "${ROFI_FB_HISTORY_FILE}" ) -gt ${ROFI_FB_HISTORY_MAXCOUNT} ]
if [ "$( wc -l < "${ROFI_FB_HISTORY_FILE}" )" -gt "${ROFI_FB_HISTORY_MAXCOUNT}" ]
then
sed -i 1d "${ROFI_FB_HISTORY_FILE}"
fi
fi
# Open the selected entry with $ROFI_FB_GENERIC_FO
coproc ( "${ROFI_FB_GENERIC_FO}" "${ROFI_FB_CUR_DIR}" > /dev/null 2>&1 )
coproc ( "${ROFI_FB_GENERIC_FO}" "${ROFI_FB_CUR_DIR}" >/dev/null 2>&1 )
if [ -d "${ROFI_FB_START_DIR}" ]
then
echo "${ROFI_FB_START_DIR}" > "${ROFI_FB_PREV_LOC_FILE}"

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
if [ x"$@" = x"quit" ]
if [ "$@" = "quit" ]
then
exit 0
fi

View File

@ -1,5 +1,5 @@
# Specify automake version.
AUTOMAKE_OPTIONS = 1.11.3
AUTOMAKE_OPTIONS = 1.11.3
ACLOCAL_AMFLAGS = -I subprojects/libnkutils -I subprojects/libgwater ${ACLOCAL_FLAGS}
@ -19,7 +19,6 @@ include $(top_srcdir)/libgwater-xcb-nolibtool.mk
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pkgconfig/rofi.pc
BUILT_SOURCES=\
lexer/theme-parser.h\
lexer/theme-parser.c\
@ -187,7 +186,6 @@ EXTRA_DIST += \
doc/rofi-sensible-terminal.1.markdown \
doc/rofi.1.markdown
##
# Readme.md
##
@ -262,7 +260,6 @@ EXTRA_DIST+=\
# Indent
##
update-manpage: $(top_srcdir)/doc/rofi-theme-selector.1.markdown $(top_srcdir)/doc/rofi.1.markdown $(top_srcdir)/doc/rofi-theme.5.markdown $(top_srcdir)/doc/rofi-script.5.markdown ${top_srcdir}/doc/rofi-sensible-terminal.1.markdown
go-md2man -in $(top_srcdir)/doc/rofi.1.markdown -out $(top_srcdir)/doc/rofi.1
go-md2man -in $(top_srcdir)/doc/rofi-theme-selector.1.markdown -out $(top_srcdir)/doc/rofi-theme-selector.1
@ -288,8 +285,6 @@ if USE_CHECK
check_PROGRAMS+=mode_test theme_parser_test helper_tokenize
endif
history_test_CFLAGS=\
$(AM_CFLAGS)\
$(glib_CFLAGS)\
@ -306,7 +301,6 @@ history_test_LDADD=\
$(glib_LIBS)\
$(NKUTILS_LIBS)
history_test_SOURCES=\
source/history.c\
config/config.c\
@ -387,7 +381,7 @@ box_test_SOURCES=\
source/css-colors.c\
include/theme.h\
include/css-colors.h\
config/config.c\
config/config.c\
test/box-test.c
scrollbar_test_LDADD=$(textbox_test_LDADD)
@ -403,7 +397,7 @@ scrollbar_test_SOURCES=\
source/css-colors.c\
include/theme.h\
include/css-colors.h\
config/config.c\
config/config.c\
test/scrollbar-test.c
textbox_test_SOURCES=\
@ -470,7 +464,6 @@ helper_test_SOURCES=\
include/rofi-types.h\
test/helper-test.c
helper_test_CFLAGS=\
$(AM_CFLAGS)\
$(glib_CFLAGS)\
@ -496,7 +489,6 @@ helper_test_LDADD=\
$(libsn_LIBS)\
$(cairo_LIBS)
helper_expand_SOURCES=\
config/config.c\
include/rofi.h\
@ -534,14 +526,13 @@ helper_config_cmdline_parser_SOURCES=\
source/xrmoptions.c\
test/helper-config-cmdline-parser.c
if USE_CHECK
mode_test_CFLAGS=$(textbox_test_CFLAGS) $(check_CFLAGS)
mode_test_LDADD=$(textbox_test_LDADD) $(check_LIBS)
mode_test_SOURCES=\
config/config.c\
test/mode-test.c\
source/dialogs/help-keys.c\
source/dialogs/help-keys.c\
source/helper.c\
source/theme.c\
source/mode.c\
@ -567,7 +558,6 @@ helper_tokenize_SOURCES=\
include/xrmoptions.h\
source/xrmoptions.c\
test/helper-tokenize.c
endif
TESTS+=\
@ -593,18 +583,15 @@ test-x: $(bin_PROGRAMS)
MESON_BUILD_ROOT="$(top_builddir)" \
$(top_srcdir)/test/run_all_tests.sh
.PHONY: indent
indent: $(SOURCES)
uncrustify -c $(top_srcdir)/data/uncrustify.cfg --replace $^
.PHONY: cppcheck
cppcheck: $(rofi_SOURCES)
cppcheck --std=c99 --platform=unix64 --enable=all -Uerror_dialog --inconclusive -I $(top_srcdir)/include/ $^
.PHONY: ohcount
ohcount: $(rofi_SOURCES)
ohcount -i $(top_srcdir)/source/ $(top_srcdir)/include/
@ -628,7 +615,7 @@ coverage: coverage/index.html
coverage-cli: coverage.info
lcov -l $^
coverage.info: $(top_builddir)/test/*.gcda $(top_builddir)/source/*.gcda $(top_builddir)/source/**/*.gcda
lcov --capture --directory $(top_builddir) --output-file coverage.info
lcov --capture --directory $(top_builddir) --output-file coverage.info
lcov -r $@ /usr/include/\* -o $@
coverage/index.html: coverage.info

View File

@ -102,10 +102,10 @@ Settings config = {
/** Parse ~/.ssh/known_hosts file in ssh view. */
.parse_known_hosts = TRUE,
/** Modi to combine into one view. */
.combi_modi = "window,run",
.tokenize = TRUE,
.matching = "normal",
.matching_method = MM_NORMAL,
.combi_modi = "window,run",
.tokenize = TRUE,
.matching = "normal",
.matching_method = MM_NORMAL,
/** Desktop entries to match in drun */
.drun_match_fields = "name,generic,exec,categories,keywords",
@ -124,20 +124,20 @@ Settings config = {
.monitor = "-5",
/** Set filter */
.filter = NULL,
.dpi = -1,
.threads = 0,
.scroll_method = 0,
.window_format = "{w} {c} {t}",
.click_to_exit = TRUE,
.theme = NULL,
.plugin_path = PLUGIN_PATH,
.max_history_size = 25,
.combi_hide_mode_prefix = FALSE,
.dpi = -1,
.threads = 0,
.scroll_method = 0,
.window_format = "{w} {c} {t}",
.click_to_exit = TRUE,
.theme = NULL,
.plugin_path = PLUGIN_PATH,
.max_history_size = 25,
.combi_hide_mode_prefix = FALSE,
.matching_negate_char = '-',
.cache_dir = NULL,
.window_thumbnail = FALSE,
.cache_dir = NULL,
.window_thumbnail = FALSE,
/** drun cache */
.drun_use_desktop_cache = FALSE,
@ -151,5 +151,5 @@ Settings config = {
/** steal focus */
.steal_focus = FALSE,
/** fallback icon */
.application_fallback_icon = NULL
.application_fallback_icon = NULL
};

View File

@ -146,7 +146,7 @@ AC_DEFINE_UNQUOTED([GLIB_VERSION_MIN_REQUIRED], [(G_ENCODE_VERSION(${glib_min_ma
AC_DEFINE_UNQUOTED([GLIB_VERSION_MAX_ALLOWED], [(G_ENCODE_VERSION(${glib_min_major},${glib_min_minor}))], [The highest GLib version supported])
GW_CHECK_XCB([xcb-aux xcb-xkb xkbcommon xkbcommon-x11 xcb-ewmh xcb-icccm xcb-cursor xcb-randr xcb-xinerama])
PKG_CHECK_MODULES([pango], [pango pangocairo])
PKG_CHECK_MODULES([cairo], [cairo cairo-xcb])
PKG_CHECK_MODULES([cairo], [cairo cairo-xcb])
PKG_CHECK_MODULES([libsn], [libstartup-notification-1.0 ])
PKG_CHECK_MODULES([gdkpixbuf], [gdk-pixbuf-2.0])

View File

@ -1,85 +1,84 @@
#
# My favorite format
#
code_width = 240
nl_max = 2
ls_func_split_full = True
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs
input_tab_size = 8 # original tab size
output_tab_size = 4 # new tab size
indent_columns = output_tab_size
indent_label = 2 # pos: absolute col, neg: relative column
indent_align_string = False # align broken strings
indent_brace = 0
code_width = 240
nl_max = 2
ls_func_split_full = True
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs
input_tab_size = 8 # original tab size
output_tab_size = 4 # new tab size
indent_columns = output_tab_size
indent_label = 2 # pos: absolute col, neg: relative column
indent_align_string = False # align broken strings
indent_brace = 0
nl_enum_brace = add # "enum {" vs "enum \n {"
nl_union_brace = add # "union {" vs "union \n {"
nl_struct_brace = add # "struct {" vs "struct \n {"
nl_do_brace = remove # "do {" vs "do \n {"
nl_if_brace = remove # "if () {" vs "if () \n {"
nl_for_brace = remove # "for () {" vs "for () \n {"
nl_else_brace = remove # "else {" vs "else \n {"
nl_while_brace = remove # "while () {" vs "while () \n {"
nl_switch_brace = add # "switch () {" vs "switch () \n {"
# nl_func_var_def_blk = 1
# nl_before_case = 1
nl_fcall_brace = add # "foo() {" vs "foo()\n{"
nl_fdef_brace = add # "int foo() {" vs "int foo()\n{"
# nl_after_return = TRUE
nl_brace_while = remove
nl_brace_else = add
nl_squeeze_ifdef = FALSE
nl_enum_brace = add # "enum {" vs "enum \n {"
nl_union_brace = add # "union {" vs "union \n {"
nl_struct_brace = add # "struct {" vs "struct \n {"
nl_do_brace = remove # "do {" vs "do \n {"
nl_if_brace = remove # "if () {" vs "if () \n {"
nl_for_brace = remove # "for () {" vs "for () \n {"
nl_else_brace = remove # "else {" vs "else \n {"
nl_while_brace = remove # "while () {" vs "while () \n {"
nl_switch_brace = add # "switch () {" vs "switch () \n {"
# nl_func_var_def_blk = 1
# nl_before_case = 1
nl_fcall_brace = add # "foo() {" vs "foo()\n{"
nl_fdef_brace = add # "int foo() {" vs "int foo()\n{"
# nl_after_return = TRUE
nl_brace_while = remove
nl_brace_else = add
nl_squeeze_ifdef = FALSE
mod_paren_on_return = remove # "return 1;" vs "return (1);"
mod_full_brace_if = add # "if (a) a--;" vs "if (a) { a--; }"
mod_full_brace_for = add # "for () a--;" vs "for () { a--; }"
mod_full_brace_do = add # "do a--; while ();" vs "do { a--; } while ();"
mod_full_brace_while = add # "while (a) a--;" vs "while (a) { a--; }"
mod_paren_on_return = remove # "return 1;" vs "return (1);"
mod_full_brace_if = add # "if (a) a--;" vs "if (a) { a--; }"
mod_full_brace_for = add # "for () a--;" vs "for () { a--; }"
mod_full_brace_do = add # "do a--; while ();" vs "do { a--; } while ();"
mod_full_brace_while = add # "while (a) a--;" vs "while (a) { a--; }"
sp_before_semi = remove
sp_paren_paren = add # space between (( and ))
sp_return_paren = add # "return (1);" vs "return(1);"
sp_sizeof_paren = add # "sizeof (int)" vs "sizeof(int)"
sp_before_sparen = add # "if (" vs "if("
sp_after_sparen = force # "if () {" vs "if (){"
sp_after_cast = add # "(int) a" vs "(int)a"
sp_inside_braces = add # "{ 1 }" vs "{1}"
sp_inside_braces_struct = force # "{ 1 }" vs "{1}"
sp_inside_braces_enum = force # "{ 1 }" vs "{1}"
sp_inside_paren = add
sp_inside_fparen = add
sp_inside_sparen = add
#sp_type_func = ignore
sp_assign = force
sp_arith = force
sp_bool = force
sp_compare = force
sp_assign = force
sp_after_comma = force
sp_func_def_paren = add # "int foo (){" vs "int foo(){"
sp_func_call_paren = add # "foo (" vs "foo("
sp_func_proto_paren = add # "int foo ();" vs "int foo();"
sp_before_semi = remove
sp_paren_paren = add # space between (( and ))
sp_return_paren = add # "return (1);" vs "return(1);"
sp_sizeof_paren = add # "sizeof (int)" vs "sizeof(int)"
sp_before_sparen = add # "if (" vs "if("
sp_after_sparen = force # "if () {" vs "if (){"
sp_after_cast = add # "(int) a" vs "(int)a"
sp_inside_braces = add # "{ 1 }" vs "{1}"
sp_inside_braces_struct = force # "{ 1 }" vs "{1}"
sp_inside_braces_enum = force # "{ 1 }" vs "{1}"
sp_inside_paren = add
sp_inside_fparen = add
sp_inside_sparen = add
#sp_type_func = ignore
sp_assign = force
sp_arith = force
sp_bool = force
sp_compare = force
sp_assign = force
sp_after_comma = force
sp_func_def_paren = add # "int foo (){" vs "int foo(){"
sp_func_call_paren = add # "foo (" vs "foo("
sp_func_proto_paren = add # "int foo ();" vs "int foo();"
align_with_tabs = FALSE # use tabs to align
align_on_tabstop = FALSE # align on tabstops
align_enum_equ_span = 4
align_nl_cont = TRUE
align_var_def_span = 2
align_var_def_inline = TRUE
align_var_def_star_style = 1
align_var_def_colon = TRUE
align_assign_span = 1
align_struct_init_span = 3
align_var_struct_span = 3
align_right_cmt_span = 3
align_pp_define_span = 3
align_pp_define_gap = 4
align_number_left = TRUE
align_typedef_span = 5
align_typedef_gap = 3
align_with_tabs = FALSE # use tabs to align
align_on_tabstop = FALSE # align on tabstops
align_enum_equ_span = 4
align_nl_cont = TRUE
align_var_def_span = 2
align_var_def_inline = TRUE
align_var_def_star_style = 1
align_var_def_colon = TRUE
align_assign_span = 1
align_struct_init_span = 3
align_var_struct_span = 3
align_right_cmt_span = 3
align_pp_define_span = 3
align_pp_define_gap = 4
align_number_left = TRUE
align_typedef_span = 5
align_typedef_gap = 3
# cmt_star_cont = TRUE
eat_blanks_before_close_brace = TRUE
eat_blanks_after_open_brace = TRUE
# cmt_star_cont = TRUE
eat_blanks_before_close_brace = TRUE
eat_blanks_after_open_brace = TRUE

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
function shout()
shout()
{
echo -en "Normal Row\nAlternateRow\nNormal Row active\nAlternateRow Active\nNormal Row urgent\nAlternateRow urgent"
echo -en "\nSelected Row"
@ -14,4 +14,4 @@ sleep 5
scrot
sleep 1
killall rofi
wait $P
wait "$P"

View File

@ -13,5 +13,4 @@ configuration {
sorting-method: "name";
directories-first: true;
}
}

View File

@ -35,7 +35,7 @@ element {
padding: 1px ;
spacing: 5px ;
border: 0;
cursor: pointer;
cursor: pointer;
}
element normal.normal {
background-color: var(normal-background);
@ -124,7 +124,7 @@ sidebar {
button {
spacing: 0;
text-color: var(normal-foreground);
cursor: pointer;
cursor: pointer;
}
button selected {
background-color: var(selected-normal-background);
@ -133,12 +133,12 @@ button selected {
num-filtered-rows, num-rows {
text-color: grey;
expand: false;
expand: false;
}
textbox-num-sep {
text-color: grey;
expand: false;
str: "/";
expand: false;
str: "/";
}
inputbar {
padding: 1px ;
@ -151,11 +151,11 @@ case-indicator {
text-color: var(normal-foreground);
}
entry {
spacing: 0;
text-color: var(normal-foreground);
spacing: 0;
text-color: var(normal-foreground);
placeholder-color: grey;
placeholder: "Type to filter";
cursor: text;
placeholder: "Type to filter";
cursor: text;
}
prompt {
spacing: 0;

View File

@ -73,7 +73,7 @@ An integer number with the current state:
.IP \(bu 2
\fB2\fP: Selected a custom entry.
.IP \(bu 2
\fB10\-28\fP: Custom keybinding 1\-19 ( need to be explicitely enabled by script ).
\fB10\-28\fP: Custom keybinding 1\-19 ( need to be explicitly enabled by script ).
.RE

View File

@ -57,7 +57,7 @@ An integer number with the current state:
* **0**: Initial call of script.
* **1**: Selected an entry.
* **2**: Selected a custom entry.
* **10-28**: Custom keybinding 1-19 ( need to be explicitely enabled by script ).
* **10-28**: Custom keybinding 1-19 ( need to be explicitly enabled by script ).
### `ROFI_INFO`

View File

@ -2,7 +2,7 @@
## NAME
**rofi-sensible-terminal** - launches $TERMINAL with fallbacks
**rofi-sensible-terminal** - launches $TERMINAL with fallbacks
## SYNOPSIS
@ -21,7 +21,7 @@ It tries to start one of the following (in that order):
* x-terminal-emulator
* urxvt
* rxvt
* st
* st
* terminology
* qterminal
* Eterm
@ -47,4 +47,3 @@ Dave Davenport and contributors
Copied script from i3:
Michael Stapelberg and contributors

View File

@ -1424,7 +1424,7 @@ icon\-paste {
.PP
This is a textbox widget that can have a 'clickable' action.
The \fB\fCaction\fR can be set to:
\fB\fCkeybinding\fR: accepts a keybinging name and completes that action. (see rofi \-show keys for a list).
\fB\fCkeybinding\fR: accepts a keybinding name and completes that action. (see rofi \-show keys for a list).
.PP
.RS

View File

@ -859,7 +859,7 @@ Example:
```css
textbox-custom {
expand: false;
content: "My Message";
content: "My Message";
}
```
@ -888,7 +888,7 @@ icon-paste {
This is a textbox widget that can have a 'clickable' action.
The `action` can be set to:
`keybinding`: accepts a keybinging name and completes that action. (see rofi -show keys for a list).
`keybinding`: accepts a keybinding name and completes that action. (see rofi -show keys for a list).
```css
button-paste {

View File

@ -166,7 +166,7 @@ Dump the current active theme, in rasi format, to stdout and exit.
\fB\fC\-rasi\-validate\fR \fIfilename\fP
.PP
Try to parse the file and return 0 when succesful, non\-zero when failed.
Try to parse the file and return 0 when successful, non\-zero when failed.
.PP
\fB\fC\-threads\fR \fInum\fP
@ -1225,7 +1225,7 @@ Make \fBrofi\fP create a pid file and check this on startup. The pid file preven
Set the name to use for mode. This is used as prompt and in combi\-browser.
.PP
It is now prefered to use the configuration file:
It is now preferred to use the configuration file:
.PP
.RS

View File

@ -106,7 +106,7 @@ Dump the current active theme, in rasi format, to stdout and exit.
`-rasi-validate` *filename*
Try to parse the file and return 0 when succesful, non-zero when failed.
Try to parse the file and return 0 when successful, non-zero when failed.
`-threads` *num*
@ -741,7 +741,7 @@ Make **rofi** create a pid file and check this on startup. The pid file prevents
Set the name to use for mode. This is used as prompt and in combi-browser.
It is now prefered to use the configuration file:
It is now preferred to use the configuration file:
```css
configuration {

View File

@ -179,7 +179,7 @@ typedef enum
ROFI_IMAGE_LINEAR_GRADIENT
} RofiImageType;
typedef enum
typedef enum
{
ROFI_DIRECTION_LEFT,
ROFI_DIRECTION_RIGHT,
@ -188,7 +188,7 @@ typedef enum
ROFI_DIRECTION_ANGLE,
} RofiDirection;
typedef enum
typedef enum
{
ROFI_SCALE_NONE,
ROFI_SCALE_BOTH,
@ -196,7 +196,6 @@ typedef enum
ROFI_SCALE_WIDTH,
} RofiScaleType;
typedef struct
{
RofiImageType type;

View File

@ -102,7 +102,7 @@ Mode * rofi_collect_modi_search ( const char *name );
#define ERROR_MSG( a ) a "\n" \
"If you suspect this is caused by a bug in rofi,\n" \
"please report the following information to rofi's github page:\n" \
" * The generated commandline output when the error occored.\n" \
" * The generated commandline output when the error occurred.\n" \
" * Output of -dump-xresource\n" \
" * Steps to reproduce\n" \
" * The version of rofi you are running\n\n" \

View File

@ -92,7 +92,6 @@ extern ThemeWidget *rofi_theme;
*/
extern ThemeWidget *rofi_theme;
extern ThemeWidget *rofi_configuration;
/**
@ -192,7 +191,7 @@ RofiDistance rofi_theme_get_distance ( const widget *widget, const char *propert
*
* @returns The integer value of this property for this widget.
*/
int rofi_theme_get_integer ( const widget *widget, const char *property, int def );
int rofi_theme_get_integer ( const widget *widget, const char *property, int def );
/**
* @param widget The widget to query
@ -214,7 +213,7 @@ int rofi_theme_get_position ( const widget *widget, const char *property, int de
*
* @returns The boolean value of this property for this widget.
*/
int rofi_theme_get_boolean ( const widget *widget, const char *property, int def );
int rofi_theme_get_boolean ( const widget *widget, const char *property, int def );
/**
* @param widget The widget to query
@ -246,7 +245,7 @@ RofiCursorType rofi_theme_get_cursor_type ( const widget *widget, const char *pr
*
* @returns The string value of this property for this widget.
*/
const char *rofi_theme_get_string ( const widget *widget, const char *property, const char *def );
const char *rofi_theme_get_string ( const widget *widget, const char *property, const char *def );
/**
* @param widget The widget to query
@ -257,7 +256,7 @@ const char *rofi_theme_get_string ( const widget *widget, const char *property
*
* @returns The double value of this property for this widget.
*/
double rofi_theme_get_double ( const widget *widget, const char *property, double def );
double rofi_theme_get_double ( const widget *widget, const char *property, double def );
/**
* @param widget The widget to query
@ -269,7 +268,6 @@ double rofi_theme_get_double ( const widget *widget, const char *property, doub
*/
void rofi_theme_get_color ( const widget *widget, const char *property, cairo_t *d );
/**
* @param widget The widget to query
* @param property The property to query.
@ -419,7 +417,7 @@ ThemeMediaType rofi_theme_parse_media_type ( const char *type );
*
* @returns a copy of the distance.
*/
RofiDistance rofi_theme_property_copy_distance ( RofiDistance const distance );
RofiDistance rofi_theme_property_copy_distance ( RofiDistance const distance );
/**
* @param filename The file to validate.

View File

@ -69,7 +69,7 @@ struct RofiViewState
/** #textbox containing the message entry */
textbox *mesg_tb;
/** Array with the levenshtein distance for each eleemnt. */
/** Array with the levenshtein distance for each element. */
int *distance;
/** Array with the translation between the filtered and unfiltered list. */
unsigned int *line_map;
@ -132,7 +132,7 @@ struct RofiViewState
int x;
/** Y position */
int y;
/** Widget being targetted. */
/** Widget being targeted. */
widget *motion_target;
} mouse;

View File

@ -62,7 +62,7 @@ typedef enum
* @param sw the Mode to show.
* @param input A pointer to a string where the inputted data is placed.
* @param menu_flags Flags indicating state of the menu.
* @param finalize the finailze callback
* @param finalize the finalize callback
*
* Main menu callback.
*
@ -215,7 +215,7 @@ void rofi_view_remove_active ( RofiViewState *state );
*
* The error message to show.
*/
int rofi_view_error_dialog ( const char *msg, int markup );
int rofi_view_error_dialog ( const char *msg, int markup );
/**
* Queue a redraw.
@ -248,7 +248,7 @@ void rofi_view_hide ( void );
*
* The reloading happens 'lazy', multiple calls might be handled at once.
*/
void rofi_view_reload ( void );
void rofi_view_reload ( void );
/**
* @param state The handle to the view
@ -323,7 +323,7 @@ void rofi_capture_screenshot ( void );
/**
* Set the window title.
*/
void rofi_view_set_window_title ( const char * title );
void rofi_view_set_window_title ( const char * title );
/**
* set ellipsize mode to start.

View File

@ -250,7 +250,7 @@ double textbox_get_estimated_ch ( void );
*
* @returns the height of a character in pixels.
*/
double textbox_get_estimated_char_height ( void );
double textbox_get_estimated_char_height ( void );
/**
* @param tb Handle to the textbox

View File

@ -116,7 +116,7 @@ static double rofi_theme_parse_convert_hex ( char high, char low)
errno =0; \
while ( (result = (int) fread(buf, 1, max_size, current->filein))==0 && ferror(current->filein)) \
{ \
if( errno != EINTR) \
if ( errno != EINTR ) \
{ \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
break; \
@ -130,7 +130,7 @@ static double rofi_theme_parse_convert_hex ( char high, char low)
case PT_STRING:\
{\
yy_size_t len = MIN (max_size, current->str_len);\
if ( len > 0 ){\
if ( len > 0 ) {\
memcpy (buf, current->input_str, len);\
current->input_str+=len;\
current->str_len-=len;\
@ -295,7 +295,7 @@ CONFIGURATION (?i:configuration)
YY_LLOC_START
%}
%{
if ( queue == NULL ){
if ( queue == NULL ) {
queue = g_queue_new ( );
yylloc->filename = current->filename;
// unsure why todo this.
@ -311,8 +311,8 @@ if ( queue == NULL ){
<*>{CPP_COMMENT} {
int c = input();
while ( c != 0 && c != EOF){
if (c == '\n') {
while ( c != 0 && c != EOF) {
if ( c == '\n' ) {
yylloc->last_column = 1;
yylloc->last_line ++;
break;
@ -329,8 +329,8 @@ if ( queue == NULL ){
p = c;
c = input();
switch (c) {
case '*': yylloc->last_column++; if (p == '/') { c = 0; nesting_depth++; } break;
case '/': yylloc->last_column++; if (p == '*') { c = 0; nesting_depth--; } break;
case '*': yylloc->last_column++; if ( p == '/' ) { c = 0; nesting_depth++; } break;
case '/': yylloc->last_column++; if ( p == '*' ) { c = 0; nesting_depth--; } break;
case '\n': {
yylloc->last_column = 1;
yylloc->last_line ++;
@ -648,7 +648,7 @@ if ( queue == NULL ){
return T_COLOR_TRANSPARENT;
}
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{COLOR_NAME} {
for ( unsigned int iter = 0; iter < num_CSSColors; iter++){
for ( unsigned int iter = 0; iter < num_CSSColors; iter++) {
if ( strcasecmp(yytext, CSSColors[iter].name )== 0 ) {
yylval->colorval.alpha = 1.0;
yylval->colorval.red = CSSColors[iter].r/255.0;
@ -663,10 +663,10 @@ if ( queue == NULL ){
<INITIAL,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT><<EOF>> {
ParseObject *po = g_queue_pop_head ( file_queue );
if ( po ) {
if ( po->type == PT_FILE ){
if ( po->type == PT_FILE ) {
fclose ( po->filein );
}
g_free ( po );
g_free ( po );
}
po = g_queue_peek_head ( file_queue );
if ( po == NULL ) {
@ -811,7 +811,7 @@ gboolean rofi_theme_parse_file ( const char *file )
while ( (po = g_queue_pop_head ( file_queue ) )) {
if ( po ) {
if ( po->type == PT_FILE ){
if ( po->type == PT_FILE ) {
fclose ( po->filein );
}
g_free ( po );
@ -846,7 +846,7 @@ gboolean rofi_theme_parse_string ( const char *string )
while ( (po = g_queue_pop_head ( file_queue ) )) {
if ( po ) {
if ( po->type == PT_FILE ){
if ( po->type == PT_FILE ) {
fclose ( po->filein );
}
g_free ( po );

View File

@ -79,7 +79,7 @@ int yylex (YYSTYPE *, YYLTYPE *);
static int check_in_range ( double index, double low, double high, YYLTYPE *loc )
{
if ( index > high || index < low ){
if ( index > high || index < low ) {
gchar *str = g_strdup_printf("Value out of range: \n\t\tValue: X = %.2lf;\n\t\tRange: %.2lf <= X <= %.2lf.", index, low, high );
yyerror ( loc, loc->filename, str);
g_free(str);
@ -89,16 +89,17 @@ static int check_in_range ( double index, double low, double high, YYLTYPE *loc
return TRUE;
}
static double hue2rgb(double p, double q, double t){
static double hue2rgb ( double p, double q, double t )
{
t += (t<0)?1.0:0.0;
t -= (t>1)?1.0:0.0;
if( t < (1/6.0) ) {
if ( t < (1/6.0) ) {
return p + (q - p) * 6 * t;
}
if( t < (1/2.0) ) {
if ( t < (1/2.0) ) {
return q;
}
if( t < (2/3.0) ) {
if ( t < (2/3.0) ) {
return p + (q - p) * (2/3.0 - t) * 6;
}
return p;
@ -108,9 +109,9 @@ static ThemeColor hsl_to_rgb ( double h, double s, double l )
ThemeColor colour;
colour.alpha = 1.0;
if(s < 0.001 && s > -0.001){
if (s < 0.001 && s > -0.001) {
colour.red = colour.green = colour.blue = l; // achromatic
}else{
} else {
double q = l < 0.5 ? l * (1 + s) : l + s - l * s;
double p = 2 * l - q;
@ -121,7 +122,7 @@ static ThemeColor hsl_to_rgb ( double h, double s, double l )
return colour;
}
static ThemeColor hwb_to_rgb ( double h, double w, double b)
static ThemeColor hwb_to_rgb ( double h, double w, double b )
{
ThemeColor retv = hsl_to_rgb ( h, 1.0, 0.5);
retv.red *= ( 1. - w - b );
@ -135,8 +136,8 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
%}
%union {
int ival;
double fval;
int ival;
double fval;
char *sval;
char cval;
int bval;
@ -226,7 +227,7 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
%token T_PARENT_LEFT "Parent left ('(')"
%token T_PARENT_RIGHT "Parent right (')')"
%token T_COMMA "comma separator (',')"
%token T_OPTIONAL_COMMA "Optional comma separator (',')"
%token T_OPTIONAL_COMMA "Optional comma separator (',')"
%token T_FORWARD_SLASH "forward slash ('/')"
%token T_PERCENT "Percent sign ('%')"
%token T_LIST_OPEN "List open ('[')"
@ -308,13 +309,13 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
t_main
: t_configuration_list t_entry_list {
// Dummy at this point.
if (rofi_theme == NULL ){
if ( rofi_theme == NULL ) {
rofi_theme_reset();
}
rofi_theme_widget_add_properties ( rofi_theme, $2->properties );
for ( unsigned int i = 0; i < $2->num_widgets;i++) {
for ( unsigned int i = 0; i < $2->num_widgets; i++ ) {
ThemeWidget *d = $2->widgets[i];
rofi_theme_parse_merge_widgets(rofi_theme, d);
}
@ -378,7 +379,7 @@ t_entry_list:
widget->media = g_slice_new0(ThemeMedia);
widget->media->type = rofi_theme_parse_media_type ( $4 );
widget->media->value = (double)$6;
for ( unsigned int i = 0; i < $9->num_widgets;i++) {
for ( unsigned int i = 0; i < $9->num_widgets; i++ ) {
ThemeWidget *d = $9->widgets[i];
rofi_theme_parse_merge_widgets(widget, d);
}
@ -391,7 +392,7 @@ t_entry_list:
widget->media = g_slice_new0(ThemeMedia);
widget->media->type = rofi_theme_parse_media_type ( $4 );
widget->media->value = $6;
for ( unsigned int i = 0; i < $9->num_widgets;i++) {
for ( unsigned int i = 0; i < $9->num_widgets; i++ ) {
ThemeWidget *d = $9->widgets[i];
rofi_theme_parse_merge_widgets(widget, d);
}
@ -404,7 +405,7 @@ t_entry_list:
widget->media = g_slice_new0(ThemeMedia);
widget->media->type = rofi_theme_parse_media_type ( $4 );
widget->media->value = (double)$6;
for ( unsigned int i = 0; i < $10->num_widgets;i++) {
for ( unsigned int i = 0; i < $10->num_widgets; i++ ) {
ThemeWidget *d = $10->widgets[i];
rofi_theme_parse_merge_widgets(widget, d);
}
@ -563,7 +564,7 @@ t_property_element
| T_URL T_PARENT_LEFT T_STRING T_PARENT_RIGHT {
$$ = rofi_theme_property_create ( P_IMAGE );
$$->value.image.type = ROFI_IMAGE_URL;
$$->value.image.url = $3;
$$->value.image.url = $3;
}
| T_URL T_PARENT_LEFT T_STRING T_COMMA t_property_scale_type T_PARENT_RIGHT {
$$ = rofi_theme_property_create ( P_IMAGE );
@ -573,19 +574,19 @@ t_property_element
}
| T_LINEAR_GRADIENT T_PARENT_LEFT t_color_list T_PARENT_RIGHT {
$$ = rofi_theme_property_create ( P_IMAGE );
$$->value.image.type = ROFI_IMAGE_LINEAR_GRADIENT;
$$->value.image.dir = ROFI_DIRECTION_RIGHT;
$$->value.image.type = ROFI_IMAGE_LINEAR_GRADIENT;
$$->value.image.dir = ROFI_DIRECTION_RIGHT;
$$->value.image.colors = $3;
}
| T_LINEAR_GRADIENT T_PARENT_LEFT T_TO t_property_direction T_COMMA t_color_list T_PARENT_RIGHT {
$$ = rofi_theme_property_create ( P_IMAGE );
$$->value.image.type = ROFI_IMAGE_LINEAR_GRADIENT;
$$->value.image.type = ROFI_IMAGE_LINEAR_GRADIENT;
$$->value.image.dir = $4;
$$->value.image.colors = $6;
}
| T_LINEAR_GRADIENT T_PARENT_LEFT t_property_color_value_angle T_COMMA t_color_list T_PARENT_RIGHT {
$$ = rofi_theme_property_create ( P_IMAGE );
$$->value.image.type = ROFI_IMAGE_LINEAR_GRADIENT;
$$->value.image.type = ROFI_IMAGE_LINEAR_GRADIENT;
$$->value.image.dir = ROFI_DIRECTION_ANGLE;
$$->value.image.angle = $3;
$$->value.image.colors = $5;
@ -594,16 +595,16 @@ t_property_element
;
t_property_direction
: T_RIGHT { $$ = ROFI_DIRECTION_RIGHT; }
| T_LEFT { $$ = ROFI_DIRECTION_LEFT; }
| T_TOP { $$ = ROFI_DIRECTION_TOP; }
| T_BOTTOM { $$ = ROFI_DIRECTION_BOTTOM; }
: T_RIGHT { $$ = ROFI_DIRECTION_RIGHT; }
| T_LEFT { $$ = ROFI_DIRECTION_LEFT; }
| T_TOP { $$ = ROFI_DIRECTION_TOP; }
| T_BOTTOM { $$ = ROFI_DIRECTION_BOTTOM; }
;
t_property_scale_type
: T_BOTH { $$ = ROFI_SCALE_BOTH; }
| T_WIDTH { $$ = ROFI_SCALE_WIDTH; }
| T_HEIGHT { $$ = ROFI_SCALE_HEIGHT; }
| T_NONE { $$ = ROFI_SCALE_NONE; }
: T_BOTH { $$ = ROFI_SCALE_BOTH; }
| T_WIDTH { $$ = ROFI_SCALE_WIDTH; }
| T_HEIGHT { $$ = ROFI_SCALE_HEIGHT; }
| T_NONE { $$ = ROFI_SCALE_NONE; }
;
t_color_list
@ -617,7 +618,6 @@ t_color_list
;
/** List of elements */
t_property_element_list_optional
: %empty { $$ = NULL; }
@ -678,7 +678,7 @@ t_property_distance_zero
$$.base.left = NULL;
$$.base.right = NULL;
$$.base.modtype = ROFI_DISTANCE_MODIFIER_NONE;
$$.style = $2;
$$.style = $2;
}
| t_property_distance { $$ = $1;}
;
@ -691,7 +691,7 @@ t_property_distance_unit
$$->type = $2;
$$->left = NULL;
$$->right = NULL;
$$->modtype = ROFI_DISTANCE_MODIFIER_NONE;
$$->modtype = ROFI_DISTANCE_MODIFIER_NONE;
}
| T_INT {
$$ = g_slice_new0(RofiDistanceUnit);
@ -699,7 +699,7 @@ t_property_distance_unit
$$->type = ROFI_PU_PX;
$$->left = NULL;
$$->right = NULL;
$$->modtype = ROFI_DISTANCE_MODIFIER_NONE;
$$->modtype = ROFI_DISTANCE_MODIFIER_NONE;
}
| T_DOUBLE t_property_unit {
$$ = g_slice_new0(RofiDistanceUnit);
@ -707,7 +707,7 @@ t_property_distance_unit
$$->type = $2;
$$->left = NULL;
$$->right = NULL;
$$->modtype = ROFI_DISTANCE_MODIFIER_NONE;
$$->modtype = ROFI_DISTANCE_MODIFIER_NONE;
}
| T_PARENT_LEFT t_property_distance_unit_math3 T_PARENT_RIGHT {
$$ = g_slice_new0(RofiDistanceUnit);
@ -725,20 +725,20 @@ t_property_distance_unit
t_property_distance_unit_math
: t_property_distance_unit_math T_MODIFIER_MULTIPLY t_property_distance_unit {
$$ = g_slice_new0(RofiDistanceUnit);
$$->left = $1;
$$->right = $3;
$$->left = $1;
$$->right = $3;
$$->modtype = ROFI_DISTANCE_MODIFIER_MULTIPLY;
}
| t_property_distance_unit_math T_FORWARD_SLASH t_property_distance_unit {
$$ = g_slice_new0(RofiDistanceUnit);
$$->left = $1;
$$->right = $3;
$$->left = $1;
$$->right = $3;
$$->modtype = ROFI_DISTANCE_MODIFIER_DIVIDE;
}
| t_property_distance_unit_math T_PERCENT t_property_distance_unit {
$$ = g_slice_new0(RofiDistanceUnit);
$$->left = $1;
$$->right = $3;
$$->left = $1;
$$->right = $3;
$$->modtype = ROFI_DISTANCE_MODIFIER_MODULO;
}
| t_property_distance_unit {
@ -750,14 +750,14 @@ t_property_distance_unit_math
t_property_distance_unit_math2
: t_property_distance_unit_math2 T_MODIFIER_ADD t_property_distance_unit_math {
$$ = g_slice_new0(RofiDistanceUnit);
$$->left = $1;
$$->right = $3;
$$->left = $1;
$$->right = $3;
$$->modtype = ROFI_DISTANCE_MODIFIER_ADD;
}
| t_property_distance_unit_math2 T_MODIFIER_SUBTRACT t_property_distance_unit_math {
$$ = g_slice_new0(RofiDistanceUnit);
$$->left = $1;
$$->right = $3;
$$->left = $1;
$$->right = $3;
$$->modtype = ROFI_DISTANCE_MODIFIER_SUBTRACT;
}
| t_property_distance_unit_math {
@ -767,14 +767,14 @@ t_property_distance_unit_math2
t_property_distance_unit_math3
: t_property_distance_unit_math3 T_MODIFIER_MIN t_property_distance_unit_math2 {
$$ = g_slice_new0(RofiDistanceUnit);
$$->left = $1;
$$->right = $3;
$$->left = $1;
$$->right = $3;
$$->modtype = ROFI_DISTANCE_MODIFIER_MIN;
}
| t_property_distance_unit_math3 T_MODIFIER_MAX t_property_distance_unit_math2 {
$$ = g_slice_new0(RofiDistanceUnit);
$$->left = $1;
$$->right = $3;
$$->left = $1;
$$->right = $3;
$$->modtype = ROFI_DISTANCE_MODIFIER_MAX;
}
| t_property_distance_unit_math2 {
@ -787,27 +787,27 @@ t_property_distance
: T_INT t_property_unit t_property_line_style {
$$.base.distance = (double)$1;
$$.base.type = $2;
$$.base.left = NULL;
$$.base.right = NULL;
$$.base.modtype = ROFI_DISTANCE_MODIFIER_NONE;
$$.style = $3;
$$.base.left = NULL;
$$.base.right = NULL;
$$.base.modtype = ROFI_DISTANCE_MODIFIER_NONE;
$$.style = $3;
}
/** Double unit and line style */
| T_DOUBLE t_property_unit t_property_line_style {
$$.base.distance = (double)$1;
$$.base.type = $2;
$$.base.modtype = ROFI_DISTANCE_MODIFIER_NONE;
$$.base.left = NULL;
$$.base.right = NULL;
$$.style = $3;
$$.base.left = NULL;
$$.base.right = NULL;
$$.style = $3;
}
| T_CALC T_PARENT_LEFT t_property_distance_unit_math3 T_PARENT_RIGHT t_property_line_style {
$$.base.distance = 0;
$$.base.type = ROFI_PU_PX;
$$.base.left = $3;
$$.base.right = NULL;
$$.base.left = $3;
$$.base.right = NULL;
$$.base.modtype = ROFI_DISTANCE_MODIFIER_GROUP;
$$.style = $5;
$$.style = $5;
};
/** distance unit. px, em, % */
@ -857,14 +857,20 @@ t_property_color
if ( ! check_in_range($3,0,100, &(@$)) ) { YYABORT; }
if ( ! check_in_range($6,0,100, &(@$)) ) { YYABORT; }
if ( ! check_in_range($9,0,100, &(@$)) ) { YYABORT; }
$$.alpha = $11; $$.red = $3/100.0; $$.green = $6/100.0; $$.blue = $9/100.0;
$$.alpha = $11;
$$.red = $3/100.0;
$$.green = $6/100.0;
$$.blue = $9/100.0;
}
/** rgba ( 0-100% 0-100% 0-100% / 0-1.0 ) */
| T_COL_RGBA T_PARENT_LEFT t_property_color_value T_PERCENT t_property_color_value T_PERCENT t_property_color_value T_PERCENT t_property_color_opt_alpha_ws T_PARENT_RIGHT {
if ( ! check_in_range($3,0,100, &(@$)) ) { YYABORT; }
if ( ! check_in_range($5,0,100, &(@$)) ) { YYABORT; }
if ( ! check_in_range($7,0,100, &(@$)) ) { YYABORT; }
$$.alpha = $9; $$.red = $3/100.0; $$.green = $5/100.0; $$.blue = $7/100.0;
$$.alpha = $9;
$$.red = $3/100.0;
$$.green = $5/100.0;
$$.blue = $7/100.0;
}
/** hwb with comma */
| T_COL_HWB T_PARENT_LEFT t_property_color_value_angle T_COMMA t_property_color_value_unit T_COMMA t_property_color_value_unit t_property_color_opt_alpha_c T_PARENT_RIGHT {
@ -881,7 +887,7 @@ t_property_color
/** cmyk with comma */
| T_COL_CMYK T_PARENT_LEFT t_property_color_value_unit T_COMMA t_property_color_value_unit T_COMMA t_property_color_value_unit T_COMMA t_property_color_value_unit t_property_color_opt_alpha_c T_PARENT_RIGHT {
$$.alpha = $10;
double c= $3, m= $5, y= $7, k= $9;
double c = $3, m = $5, y = $7, k = $9;
$$.red = (1.0-c)*(1.0-k);
$$.green = (1.0-m)*(1.0-k);
$$.blue = (1.0-y)*(1.0-k);
@ -889,7 +895,7 @@ t_property_color
/** cmyk whitespace edition. */
| T_COL_CMYK T_PARENT_LEFT t_property_color_value_unit t_property_color_value_unit t_property_color_value_unit t_property_color_value_unit t_property_color_opt_alpha_ws T_PARENT_RIGHT {
$$.alpha = $7;
double c= $3, m= $4, y= $5, k= $6;
double c = $3, m = $4, y = $5, k = $6;
$$.red = (1.0-c)*(1.0-k);
$$.green = (1.0-m)*(1.0-k);
$$.blue = (1.0-y)*(1.0-k);
@ -946,14 +952,14 @@ t_property_color_value
;
t_property_orientation
: ORIENTATION_HORI { $$ = ROFI_ORIENTATION_HORIZONTAL; }
| ORIENTATION_VERT { $$ = ROFI_ORIENTATION_VERTICAL; }
: ORIENTATION_HORI { $$ = ROFI_ORIENTATION_HORIZONTAL; }
| ORIENTATION_VERT { $$ = ROFI_ORIENTATION_VERTICAL; }
;
t_property_cursor
: CURSOR_DEF { $$ = ROFI_CURSOR_DEFAULT; }
| CURSOR_PTR { $$ = ROFI_CURSOR_POINTER; }
| CURSOR_TXT { $$ = ROFI_CURSOR_TEXT; }
: CURSOR_DEF { $$ = ROFI_CURSOR_DEFAULT; }
| CURSOR_PTR { $$ = ROFI_CURSOR_POINTER; }
| CURSOR_TXT { $$ = ROFI_CURSOR_TEXT; }
;
/** Property name */

View File

@ -9,7 +9,6 @@ libgwater_xcb_a_CFLAGS = \
$(AM_CFLAGS) \
$(GW_XCB_INTERNAL_CFLAGS)
GW_XCB_CFLAGS = \
-I$(srcdir)/subprojects/libgwater/xcb \
$(GW_XCB_INTERNAL_CFLAGS)
@ -17,4 +16,3 @@ GW_XCB_CFLAGS = \
GW_XCB_LIBS = \
libgwater-xcb.a \
$(GW_XCB_INTERNAL_LIBS)

View File

@ -11,7 +11,7 @@ This means, that next rofi version will either be
* 0.15.13 (bugfix release)
* 0.16.0 (minor release) or (if no major bugs are discovered)
* 1.0.0 (major release)
* 1.0.0 (major release)
## Keyboard Layouts
@ -30,7 +30,7 @@ they are available they can be used for keybindings, if not, the user gets a war
### DMenu reading from stdin
**Rofi** used to have a custom `fgets` implementation that supported custom separators. The has been repaced by the
**Rofi** used to have a custom `fgets` implementation that supported custom separators. The has been replaced by the
`getdelim` feature of POSIX '08, this gave a speedup of 6x (from 648 ms for 202000 lines down to 108ms).
### Multi-Core power
@ -52,7 +52,7 @@ themes (with live preview) and a themes repository.
To make things even easier, you can now take screenshots of **rofi** from within **rofi** with a simple keybinding.
![Rofi Internal Screenshot](rofi-screenshot.png)
### Theme repository
This has been requested several times and rofi's website actually has a theming page. This however got outdated quickly
@ -71,7 +71,7 @@ The repository can be found [here](https://github.com/DaveDavenport/rofi-themes/
The second tool is a website allowing you to easily create themes and preview all changes life, the
[themenator](https://davedavenport.github.io/rofi/generator.html) Big thanks to
[SardemFF7](https://github.com/sardemff7) who got tired of me complaining, took the very rough prototype and turned it
into something beautiful.
into something beautiful.
Hopefully people will make beautiful themes and submit them to the [theme repository](https://github.com/DaveDavenport/rofi-themes/).

View File

@ -79,7 +79,7 @@ Below is a more complete changelog between the 0.15.12 and the 1.0.0 release.
## Bug fixes
* Fix subpixel rendering. (#303)
* Fix basic tests on OpenBSD (#272)
* Fix basic tests on OpenBSD (#272)
* Fix wrong use of memcpy (thx to Jasperia).
* Work around for sigwaitinfo on OpenBSD.
* Ignore invalid entries (non-utf8) in dmenu mode.
@ -94,4 +94,3 @@ Below is a more complete changelog between the 0.15.12 and the 1.0.0 release.
* Removal of old themeing method. Given it was incomplete.
* Removal of daemon mode, given this duplicates Window Manager functionality.

View File

@ -1,22 +1,21 @@
# V1.1.0 - A trump card
## New Features
## New Features
- Keys mode, showing keybindings.
- Stop cycling option (#407) (Thx to Yaroslav)
- Kill window on delete entry (#316)
- Keys mode, showing keybindings.
- Stop cycling option (#407) (Thx to Yaroslav)
- Kill window on delete entry (#316)
## Improvements
## 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.
- 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).
- Use display name for prompt (#409)
- Use display name for prompt (#409)
- Parse subdirectories in drun parser (#416)
- Switch to stop cycling (#407)
##Bug fixes
- Grab mouse pointer with keyboard
## Bug fixes
- Grab mouse pointer with keyboard

View File

@ -1,14 +1,14 @@
# V1.2.0 - 8397
# V1.2.0 - 8397
## New Features
Despite me saying after every release that it is mostly feature complete; new **Rofi**, new features.
Despite me saying after every release that it is mostly feature complete; new **Rofi**, new features.
However these new features are mostly to improve current functionality and debugging.
Below the 4 most important ones.
### Underline Match
A new, hopefully welcome, addition is that **Rofi** now highlights the match in each row:
A new, hopefully welcome, addition is that **Rofi** now highlights the match in each row:
![Rofi Underline](./rofi-underline-match.png)
@ -40,7 +40,7 @@ rofi.window-format: {t:-16} ({c:10})
## Track configuration option origin
**Rofi** now keeps track of how configuration options are set. It will now display if it is the default value, set in
Xresources, configuration file or commnadline.
Xresources, configuration file or commandline.
![Rofi configuration tracking](./rofi-options.png)

View File

@ -53,7 +53,7 @@ Async mode is not always possible, and will be disabled if not possible.
In this release rofi is more efficient in drawing its content to the X11 window. The basic redraw on expose has been
speedup by a factor 1000. This was obtained by using a server side copy of the internal surface, instead of painting it
with cairo each time. Especially for large (4k and higher) screens, in fullscreen mode, this reduces redrawing from +-
180ms to 0.1 ms. A second improvement was made by configuring X11 not repaint the window background when resized, this
180ms to 0.1 ms. A second improvement was made by configuring X11 not repaint the window background when resized, this
caused some flickering (it was painted black before being drawn). It now keeps the old content and tells rofi to
repaint. This causes trailing, but overall looks nicer.

View File

@ -13,7 +13,7 @@ possible.
Because of The great work done by [SardemFF7](https://github.com/SardemFF7/) the
code base is simplified and the key and mouse handling improved. The libraries
provided by SardemFF7 also made it possible to add a often requested feature of
provided by SardemFF7 also made it possible to add a often requested feature of
icons (correctly using the icon-theme). A feature I never expected to be added.
To top this off, SardemFF7 added support to build rofi using
[meson](http://mesonbuild.com/).
@ -77,7 +77,7 @@ widgets.
> Note that opening a fonts is one of the slowest operations during rofi
> startup; having multiple fonts could have a significant impact on startup
> times.
> times.
### Flexible layout
@ -104,7 +104,7 @@ The new theme parser also support importing and overriding. This allow you to
make make modifications to an existing theme, without having to completely copy
it. For example, I want to use the `arthur` theme (shipped with rofi) but use
fake transparency, change the font off the result list and import a set of
overriding colors from `mycolors`.
overriding colors from `mycolors`.
```css
// Import the default arthur theme
@ -118,9 +118,9 @@ overriding colors from `mycolors`.
transparency: "screenshot";
}
/* Override the font on the listview elements */
#element {
#element {
font: "Ubuntu Mono 18";
}
}
```
## Icons
@ -182,7 +182,7 @@ See [here](https://gitcrate.org/qtools/rofi-top).
## Configuration File
> This feature is in alpha stage.
> This feature is in alpha stage.
The new theme format can now (as an alpha) feature be used to set rofi's
configuration. In the future, when we add wayland support, we want to get rid of
@ -236,4 +236,3 @@ would look using: `rofi -dump-config`.
* Allow rofi to be placed above window based on window id.
* Support different font per textbox.
* Keep cache of previous used fonts.

View File

@ -4,7 +4,7 @@ After the last release turned out to be fairly large we are hopefully back to mo
This release focuses on squashing some bugs and hopefully improving the user experience.
Nevertheless this release also includes some new features.
Big thanks to [SardemFF7](https://www.sardemff7.net/), without whose help and contributions this release would not have been possible.
Big thanks to [SardemFF7](https://www.sardemff7.net/), without whose help and contributions this release would not have been possible.
## New features
@ -21,7 +21,7 @@ The different fields are:
* **name**: the application's name
* **generic**: the application's generic name
* **exec**: the application's executable
* **exec**: the application's executable
* **categories**: the application's categories
* **comment**: the application comment
* **all**: all of the above

View File

@ -1,6 +1,6 @@
# 1.5.2: Procrastination in progress
Rofi 1.5.2 is another bug-fix release in the 1.5 series.
Rofi 1.5.2 is another bug-fix release in the 1.5 series.
## Fix border drawing
@ -74,14 +74,14 @@ An often requested feature is the ability to change the display string for the d
The `-drun-display-format` option is added that allows just this.
> -drun-display-format
>
>
> The format string for the drun dialog:
> * name: the application's name
> * generic: the application's generic name
> * exec: the application's executable
> * categories: the application's categories
> * comment: the application comment
>
>
> Default: {name} [({generic})]
Items between `[]` are only displayed when the field within is set. So in the above example, the `()` are omitted when

View File

@ -1,6 +1,6 @@
# 1.5.3: Time delayed progress
Rofi 1.5.3 is another bug-fix release in the 1.5 series.
Rofi 1.5.3 is another bug-fix release in the 1.5 series.
There is one breaking change in the theme naming and there are a few small new features (tweaks) in this release.
@ -32,7 +32,7 @@ separator character.
If you have very long entries in your view that get ellipsized (cut off at the end indicated by ...) you can now select,
at runtime, where they are cut off (start, middle or end).
You cycle through the options with the the `alt+.` keybinding.
You cycle through the options with the `alt+.` keybinding.
Start:
@ -53,7 +53,7 @@ End:
The full list of fixes and updates:
* Update manpage with missing entry. (#937)
* Update manpage with missing entry. (#937)
* Rename sidebar widget to mode-switcher and allow configuration from theme.
* Timing: Moving timing output to glib debug system.
* SSH: Fix unitialized variable issue.
@ -70,4 +70,3 @@ The full list of fixes and updates:
* Update libnkutils, libgwater.
* DMENU: Add format option to strip pango markup from return value.
* ListView: allow user to change ellipsizing displayed value at run-time.

View File

@ -115,7 +115,7 @@ This is a very initial implementation of CSS like `@media` support. This allows
based on screen size or ratio.
We currently support: minimum width, minimum height, maximum width, maximum
height, monitor id, minimum acpect ratio or maximum acpect ratio.
height, monitor id, minimum aspect ratio or maximum aspect ratio.
For example, go to fullscreen mode on screens smaller then full HD:

View File

@ -6,18 +6,18 @@ GIT=$(which git)
if [ -d "${DIR}/.git/" ] && [ -n "${GIT}" ]
then
echo -n "#define GIT_VERSION \"" > ${FILE}.tmp
echo -n "#define GIT_VERSION \"" > "${FILE}.tmp"
BRTG="$(${GIT} describe --tags --always --all | sed -e 's:heads/::')"
REV="$(${GIT} describe --tags --always --dirty| sed -e 's:-g\([a-f0-9]\{7\}\):-git-\1:g')"
echo -n "${REV} (${BRTG})" >> ${FILE}.tmp
echo "\"" >> ${FILE}.tmp
echo -n "${REV} (${BRTG})" >> "${FILE}.tmp"
echo "\"" >> "${FILE}.tmp"
else
echo "#undef GIT_VERSION" > ${FILE}.tmp
echo "#undef GIT_VERSION" > "${FILE}.tmp"
fi
if [ ! -f ${FILE} ] || ! diff ${FILE}.tmp ${FILE} > /dev/null
if [ ! -f "${FILE}" ] || ! diff "${FILE}.tmp" "${FILE}" >/dev/null
then
mv ${FILE}.tmp ${FILE}
mv "${FILE}.tmp" "${FILE}"
else
rm ${FILE}.tmp
rm "${FILE}.tmp"
fi

View File

@ -1,9 +1,9 @@
#!/usr/bin/env bash
#
# This code is released in public domain by Dave Davenport <qball@gmpclient.org>
# This code is released in public domain by Dave Davenport <qball@gmpclient.org>
# This converts from old style theme (< 1.4) to new style theme (>= 1.4)
#
function update_color ()
update_color()
{
var=${1}
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
@ -12,11 +12,11 @@ function update_color ()
then
echo "#${var:5}"
else
echo ${var}
echo "${var}"
fi
}
function parse_window_color ()
parse_window_color()
{
OLDIFS=${IFS}
IFS=","
@ -37,7 +37,7 @@ function parse_window_color ()
IFS=${OLDIFS}
}
function parse_color ()
parse_color()
{
state=$1
OLDIFS=${IFS}
@ -62,13 +62,13 @@ while read LINE
do
if [[ ${LINE} =~ ^rofi\.color-normal: ]]
then
parse_color "normal" "${LINE:18}"
parse_color "normal" "${LINE:18}"
elif [[ ${LINE} =~ ^rofi\.color-urgent: ]]
then
parse_color "urgent" "${LINE:18}"
parse_color "urgent" "${LINE:18}"
elif [[ ${LINE} =~ ^rofi\.color-active: ]]
then
parse_color "active" "${LINE:18}"
parse_color "active" "${LINE:18}"
elif [[ ${LINE} =~ ^rofi\.color-window: ]]
then
parse_window_color "${LINE:18}"

View File

@ -13,14 +13,14 @@ shift
OUTPUT_PNG=$1
shift
XVFB=$(which Xvfb 2> /dev/null)
XDOTOOL=$(which xdotool 2> /dev/null)
ROFI=$(which rofi 2> /dev/null)
SCROT=$(which scrot 2> /dev/null)
FEH=$(which feh 2> /dev/null)
COMPTON=$(which compton 2> /dev/null)
XVFB=$(which Xvfb 2>/dev/null)
XDOTOOL=$(which xdotool 2>/dev/null)
ROFI=$(which rofi 2>/dev/null)
SCROT=$(which scrot 2>/dev/null)
FEH=$(which feh 2>/dev/null)
COMPTON=$(which compton 2>/dev/null)
function check_tool()
check_tool()
{
if [ -z "${1}" ]
then
@ -30,26 +30,26 @@ function check_tool()
}
XPID=
function create_fake_x ( )
create_fake_x()
{
export DISPLAY=":$1"
echo "Starting fake X: ${DISPLAY}"
${XVFB} ${DISPLAY} -screen 0 1024x600x24&
${XVFB} "${DISPLAY}" -screen 0 1024x600x24 &
XPID=$!
sleep 1
}
function destroy_fake_x ( )
destroy_fake_x()
{
if [ -n "${XPID}" ]
then
echo "Stopping fake X: ${XPID}"
kill ${XPID}
wait ${XPID}
kill "${XPID}"
wait "${XPID}"
fi
}
function generate()
generate()
{
echo "Normal"
echo "Alternative"
@ -81,16 +81,16 @@ ROFI_OPTIONS="-selected-row 6 -u 2,3 -a 4,5 -location 0 -width 100 -lines 7 -col
export DISPLAY=${VDISPLAY}
# Create fake X11
create_fake_x ${VDISPLAY}
create_fake_x "${VDISPLAY}"
sleep 1
fluxbox &
sleep 1;
compton -b
sleep 1
compton -b
feh --bg-center background.jpg
(generate | ${ROFI} -no-config -theme "${THEME_FILE}" -dmenu ${ROFI_OPTIONS} > /dev/null )&
(generate | ${ROFI} -no-config -theme "${THEME_FILE}" -dmenu ${ROFI_OPTIONS} >/dev/null )&
sleep 1
#${XDOTOOL} key Alt+S
scrot ${OUTPUT_PNG}
scrot "${OUTPUT_PNG}"
${XDOTOOL} key Return
sleep 2
destroy_fake_x

View File

@ -14,12 +14,12 @@ shift
OUTPUT_PNG=$1
shift
XVFB=$(which Xvfb 2> /dev/null)
XDOTOOL=$(which xdotool 2> /dev/null)
XRDB=$(which xrdb 2> /dev/null)
ROFI=$(which rofi 2> /dev/null)
XVFB=$(which Xvfb 2>/dev/null)
XDOTOOL=$(which xdotool 2>/dev/null)
XRDB=$(which xrdb 2>/dev/null)
ROFI=$(which rofi 2>/dev/null)
function check_tool()
check_tool()
{
if [ -z "${1}" ]
then
@ -29,26 +29,26 @@ function check_tool()
}
XPID=
function create_fake_x ( )
create_fake_x()
{
export DISPLAY=":$1"
echo "Starting fake X: ${DISPLAY}"
${XVFB} ${DISPLAY} -screen 0 800x600x24 &
${XVFB} "${DISPLAY}" -screen 0 800x600x24 &
XPID=$!
sleep 1
}
function destroy_fake_x ( )
destroy_fake_x()
{
if [ -n "${XPID}" ]
then
echo "Stopping fake X: ${XPID}"
kill ${XPID}
wait ${XPID}
kill "${XPID}"
wait "${XPID}"
fi
}
function generate()
generate()
{
echo "Normal"
echo "Alternative"
@ -84,13 +84,13 @@ then
fi
# Create fake X11
create_fake_x ${VDISPLAY}
create_fake_x "${VDISPLAY}"
# Load Xresources if specified.
if [ -n "${XRDB_FILE}" ]
then
echo -e "${COLOR_YELLOW}Loading Xresources:${RESET} ${XRDB_FILE}"
${XRDB} -retain -load ${XRDB_FILE}
${XRDB} -retain -load "${XRDB_FILE}"
fi
(generate | ${ROFI} -config "${XRDB_FILE}" -dmenu ${ROFI_OPTIONS} > /dev/null )&

View File

@ -10,7 +10,7 @@
# preferred terminal emulator. On Debian, there is the x-terminal-emulator
# symlink for example.
for terminal in $TERMINAL x-terminal-emulator urxvt rxvt st terminology qterminal Eterm aterm uxterm xterm roxterm xfce4-terminal.wrapper mate-terminal lxterminal konsole alacritty kitty; do
if command -v $terminal > /dev/null 2>&1; then
if command -v $terminal >/dev/null 2>&1; then
exec $terminal "$@"
fi
done

View File

@ -1,9 +1,8 @@
#!/usr/bin/env bash
#
# This code is released in public domain by Dave Davenport <qball@gmpclient.org>
# This code is released in public domain by Dave Davenport <qball@gmpclient.org>
#
ROFI=$(which rofi)
SED=$(which sed)
MKTEMP=$(which mktemp)
@ -37,7 +36,7 @@ declare -a theme_names
# Function that tries to find all installed rofi themes.
# This fills in #themes array and formats a displayable string #theme_names
##
function find_themes()
find_themes()
{
DIRS=${XDG_DATA_DIRS}
OLDIFS=${IFS}
@ -70,8 +69,8 @@ function find_themes()
# Add user dir.
DIRS+=":${XDG_DATA_HOME:-${HOME}/.local/share}"
DIRS+=":${XDG_CONFIG_HOME:-${HOME}/.config}"
for p in ${DIRS}; do
p=${p%/}
for p in ${DIRS}; do
p=${p%/}
TD=${p}/rofi/themes
if [ -n "${p}" ] && [ -d "${TD}" ]
then
@ -80,10 +79,10 @@ function find_themes()
do
if [ -f "${file}" ]
then
themes+=(${file})
FN=$(basename ${file})
themes+=("${file}")
FN=$(basename "${file}")
NAME=${FN%.*}
USER=$(${SED} -n 's/^.*User: \(.*\)/\1/p' ${file} | head -n 1 )
USER=$(${SED} -n 's/^.*User: \(.*\)/\1/p' "${file}" | head -n 1 )
if [ -z "${USER}" ]
then
theme_names+=(${NAME})
@ -95,29 +94,28 @@ function find_themes()
fi
done
IFS=${OLDIFS}
}
##
# Create a copy of rofi
##
function create_config_copy()
create_config_copy()
{
${ROFI} -dump-config > ${TMP_CONFIG_FILE}
${ROFI} -dump-config > "${TMP_CONFIG_FILE}"
# remove theme entry.
sed -i 's/^\s*theme:\s\+".*"\s*;//g' ${TMP_CONFIG_FILE}
sed -i 's/^\s*theme:\s\+".*"\s*;//g' "${TMP_CONFIG_FILE}"
}
###
# Print the list out so it can be displayed by rofi.
##
function create_theme_list()
create_theme_list()
{
OLDIFS=${IFS}
IFS='|'
for themen in ${theme_names[@]}
for themen in ${theme_names[@]}
do
echo ${themen}
echo "${themen}"
done
IFS=${OLDIFS}
}
@ -127,9 +125,9 @@ function create_theme_list()
##
declare -i SELECTED
function select_theme ()
select_theme()
{
local MORE_FLAGS=(-dmenu -format i -no-custom -p "Theme" -markup -config ${TMP_CONFIG_FILE} -i)
local MORE_FLAGS=(-dmenu -format i -no-custom -p "Theme" -markup -config "${TMP_CONFIG_FILE}" -i)
MORE_FLAGS+=(-kb-custom-1 "Alt-a")
MORE_FLAGS+=(-u 2,3 -a 4,5 )
local CUR="default"
@ -143,23 +141,23 @@ function select_theme ()
Current theme: <b>${CUR}</b>"""
THEME_FLAG=
if [ -n "${SELECTED}" ]
then
THEME_FLAG="-theme ${themes[${SELECTED}]}"
then
THEME_FLAG="-theme ${themes[${SELECTED}]}"
fi
RES=$( create_theme_list | ${ROFI} ${THEME_FLAG} ${MORE_FLAGS[@]} -cycle -selected-row "${SELECTED}" -mesg "${MESG}")
RES=$( create_theme_list | ${ROFI} ${THEME_FLAG} ${MORE_FLAGS[@]} -cycle -selected-row "${SELECTED}" -mesg "${MESG}")
RTR=$?
if [ ${RTR} = 10 ]
if [ "${RTR}" = 10 ]
then
return 0;
elif [ ${RTR} = 1 ]
elif [ "${RTR}" = 1 ]
then
return 1;
elif [ ${RTR} = 65 ]
elif [ "${RTR}" = 65 ]
then
return 1;
fi
CUR=${theme_names[${RES}]}
SELECTED=${RES}
SELECTED=${RES}
done
}
@ -167,12 +165,12 @@ Current theme: <b>${CUR}</b>"""
# Create if not exists, then removes #include of .theme file (if present) and add the selected theme to the end.
# Repeated calls should leave the config clean-ish
###
function set_theme()
set_theme()
{
CDIR="${XDG_CONFIG_HOME:-${HOME}/.config}/rofi"
if [ ! -d "${CDIR}" ]
then
mkdir -p ${CDIR}
mkdir -p "${CDIR}"
fi
get_link=$(readlink -f "${CDIR}/config.rasi")
${SED} -i "/@import.*/d" "${get_link}"
@ -213,4 +211,4 @@ fi
##
# Remove temp. config.
##
rm ${TMP_CONFIG_FILE}
rm -- "${TMP_CONFIG_FILE}"

View File

@ -76,7 +76,7 @@ static void combi_mode_parse_switchers ( Mode *sw )
sizeof ( CombiMode ) * ( pd->num_switchers + 1 ) );
Mode *mode = rofi_collect_modi_search ( token );
if ( mode != NULL ) {
if ( mode != NULL ) {
pd->switchers[pd->num_switchers].disable = FALSE;
pd->switchers[pd->num_switchers++].mode = mode;
continue;
@ -182,7 +182,7 @@ static ModeMode combi_mode_result ( Mode *sw, int mretv, char **input, unsigned
return mode_result ( pd->switchers[i].mode, mretv, input, selected_line - pd->starts[i] );
}
}
if ( ( mretv & MENU_CUSTOM_INPUT ) ) {
if ( ( mretv & MENU_CUSTOM_INPUT ) ) {
return mode_result ( pd->switchers[0].mode, mretv, input, selected_line );
}
return MODE_EXIT;

View File

@ -159,7 +159,7 @@ static void async_read_callback ( GObject *source_object, GAsyncResult *res, gpo
// Absorb separator, already in buffer so should not block.
// If error == NULL end of stream..
g_data_input_stream_read_byte ( stream, NULL, &error );
if ( error == NULL ) {
if ( error == NULL ) {
// Add empty line.
read_add ( pd, "", 0 );
rofi_view_reload ();
@ -204,7 +204,7 @@ static int get_dmenu_async ( DmenuModePrivateData *pd, int sync_pre_read )
}
static void get_dmenu_sync ( DmenuModePrivateData *pd )
{
while ( TRUE ) {
while ( TRUE ) {
gsize len = 0;
char *data = g_data_input_stream_read_upto ( pd->data_input_stream, &( pd->separator ), 1, &len, NULL, NULL );
if ( data == NULL ) {
@ -298,7 +298,7 @@ static void dmenu_mode_free ( Mode *sw )
}
DmenuModePrivateData *pd = (DmenuModePrivateData *) mode_get_private_data ( sw );
if ( pd != NULL ) {
if ( pd->cancel ) {
if ( pd->cancel ) {
// If open, cancel reads.
if ( pd->input_stream && !g_input_stream_is_closed ( pd->input_stream ) ) {
g_cancellable_cancel ( pd->cancel );
@ -368,7 +368,7 @@ static int dmenu_mode_init ( Mode *sw )
// Input data separator.
find_arg_char ( "-sep", &( pd->separator ) );
find_arg_uint ( "-selected-row", &( pd->selected_line ) );
find_arg_uint ( "-selected-row", &( pd->selected_line ) );
// By default we print the unescaped line back.
pd->format = "s";
@ -376,21 +376,21 @@ static int dmenu_mode_init ( Mode *sw )
find_arg_str ( "-format", &( pd->format ) );
// Urgent.
char *str = NULL;
find_arg_str ( "-u", &str );
find_arg_str ( "-u", &str );
if ( str != NULL ) {
parse_ranges ( str, &( pd->urgent_list ), &( pd->num_urgent_list ) );
}
// Active
str = NULL;
find_arg_str ( "-a", &str );
find_arg_str ( "-a", &str );
if ( str != NULL ) {
parse_ranges ( str, &( pd->active_list ), &( pd->num_active_list ) );
}
// DMENU COMPATIBILITY
unsigned int lines = DEFAULT_MENU_LINES;
find_arg_uint ( "-l", &( lines ) );
if ( lines != DEFAULT_MENU_LINES ) {
find_arg_uint ( "-l", &( lines ) );
if ( lines != DEFAULT_MENU_LINES ) {
Property *p = rofi_theme_property_create ( P_INTEGER );
p->name = g_strdup("lines");
p->value.i = lines;
@ -434,7 +434,7 @@ static int dmenu_mode_init ( Mode *sw )
}
g_free ( estr );
}
// If input is stdin, and a tty, do not read as rofi grabs input and therefor blocks.
// If input is stdin, and a tty, do not read as rofi grabs input and therefore blocks.
if ( !( fd == STDIN_FILENO && isatty ( fd ) == 1 ) ) {
pd->cancel = g_cancellable_new ();
pd->cancel_source = g_cancellable_connect ( pd->cancel, G_CALLBACK ( async_read_cancel ), pd, NULL );
@ -516,7 +516,7 @@ static void dmenu_finish ( RofiViewState *state, int retv )
else if ( retv >= 10 ) {
rofi_set_return_code ( retv );
}
else{
else {
rofi_set_return_code ( EXIT_SUCCESS );
}
rofi_view_set_active ( NULL );
@ -616,7 +616,7 @@ static void dmenu_finalize ( RofiViewState *state )
// We normally do not want to restart the loop.
restart = FALSE;
// Normal mode
if ( ( mretv & MENU_OK ) && pd->selected_line != UINT32_MAX && cmd_list[pd->selected_line].entry != NULL ) {
if ( ( mretv & MENU_OK ) && pd->selected_line != UINT32_MAX && cmd_list[pd->selected_line].entry != NULL ) {
// Check if entry is non-selectable.
if ( cmd_list[pd->selected_line].nonselectable == TRUE ) {
g_free ( input );
@ -748,7 +748,7 @@ int dmenu_switcher_dialog ( void )
g_free ( input );
return TRUE;
}
find_arg_str ( "-p", &( dmenu_mode.display_name ) );
find_arg_str ( "-p", &( dmenu_mode.display_name ) );
RofiViewState *state = rofi_view_create ( &dmenu_mode, input, menu_flags, dmenu_finalize );
if ( find_arg ( "-keep-right" ) >= 0 ) {

View File

@ -468,7 +468,7 @@ static void read_desktop_file ( DRunModePrivateData *pd, const char *root, const
if ( list ) {
for ( gsize lcd = 0; show && pd->current_desktop_list[lcd]; lcd++ ) {
for ( gsize lle = 0; show && lle < llength; lle++ ) {
show = !( g_strcmp0 ( pd->current_desktop_list[lcd], list[lle] ) == 0 );
show = !( g_strcmp0 ( pd->current_desktop_list[lcd], list[lle] ) == 0 );
}
}
g_strfreev ( list );
@ -534,7 +534,7 @@ static void read_desktop_file ( DRunModePrivateData *pd, const char *root, const
char **categories = NULL;
if ( pd->show_categories ) {
categories = g_key_file_get_locale_string_list ( kf, DRUN_GROUP_NAME, "Categories", NULL, NULL, NULL );
if ( !rofi_strv_contains ( (const char * const *) categories, (const char * const *) pd->show_categories ) ) {
if ( !rofi_strv_contains ( (const char * const *) categories, (const char * const *) pd->show_categories ) ) {
g_strfreev ( categories );
g_key_file_free ( kf );
return;
@ -961,7 +961,7 @@ static void get_apps ( DRunModePrivateData *pd )
}
/** Load application entires */
p = rofi_theme_find_property ( wid, P_BOOLEAN, "parse-system", TRUE );
p = rofi_theme_find_property ( wid, P_BOOLEAN, "parse-system", TRUE );
if ( p == NULL || ( p->type == P_BOOLEAN && p->value.b )) {
// Then read thee system data dirs.
const gchar * const * sys = g_get_system_data_dirs ();
@ -1033,7 +1033,7 @@ static void drun_mode_parse_entry_fields ()
}
static void drun_mode_parse_display_format() {
for (int i = 0; i < DRUN_MATCH_NUM_FIELDS; i++) {
for ( int i = 0; i < DRUN_MATCH_NUM_FIELDS; i++ ) {
if ( matching_entry_fields[i].enabled_display ) continue;
gchar* search_term = g_strdup_printf("{%s}",matching_entry_fields[i].entry_field_name);
@ -1052,7 +1052,7 @@ static int drun_mode_init ( Mode *sw )
DRunModePrivateData *pd = g_malloc0 ( sizeof ( *pd ) );
pd->disabled_entries = g_hash_table_new_full ( g_str_hash, g_str_equal, g_free, NULL );
mode_set_private_data ( sw, (void *) pd );
// current destkop
// current desktop
const char *current_desktop = g_getenv ( "XDG_CURRENT_DESKTOP" );
pd->current_desktop_list = current_desktop ? g_strsplit ( current_desktop, ":", 0 ) : NULL;
@ -1109,9 +1109,11 @@ static ModeMode drun_mode_result ( Mode *sw, int mretv, char **input, unsigned i
(*input) = g_strdup ( rmpd->old_input );
}
rmpd->file_complete = FALSE;
} else if ( (mretv&MENU_CANCEL) ) {
}
else if ( (mretv&MENU_CANCEL) ) {
retv = MODE_EXIT;
} else {
}
else {
char *path = NULL;
retv = file_browser_mode_completer ( rmpd->completer, mretv, input, selected_line, &path );
if ( retv == MODE_EXIT ) {
@ -1122,7 +1124,7 @@ static ModeMode drun_mode_result ( Mode *sw, int mretv, char **input, unsigned i
}
return retv;
}
if ( ( mretv & MENU_OK ) ) {
if ( ( mretv & MENU_OK ) ) {
switch ( rmpd->entry_list[selected_line].type )
{
case DRUN_DESKTOP_ENTRY_TYPE_SERVICE:
@ -1145,7 +1147,7 @@ static ModeMode drun_mode_result ( Mode *sw, int mretv, char **input, unsigned i
}
}
else if ( ( mretv & MENU_ENTRY_DELETE ) && selected_line < rmpd->cmd_list_length ) {
// Possitive sort index means it is in history.
// Positive sort index means it is in history.
if ( rmpd->entry_list[selected_line].sort_index >= 0 ) {
delete_entry_history ( &( rmpd->entry_list[selected_line] ) );
drun_entry_clear ( &( rmpd->entry_list[selected_line] ) );
@ -1157,9 +1159,10 @@ static ModeMode drun_mode_result ( Mode *sw, int mretv, char **input, unsigned i
}
else if ( mretv & MENU_CUSTOM_COMMAND ) {
retv = ( mretv & MENU_LOWER_MASK );
} else if ( ( mretv& MENU_COMPLETE) ) {
}
else if ( ( mretv& MENU_COMPLETE) ) {
retv = RELOAD_DIALOG;
if ( selected_line < rmpd->cmd_list_length ) {
if ( selected_line < rmpd->cmd_list_length ) {
switch ( rmpd->entry_list[selected_line].type )
{
case DRUN_DESKTOP_ENTRY_TYPE_SERVICE:
@ -1213,7 +1216,7 @@ static char *_get_display_value ( const Mode *sw, unsigned int selected_line, in
{
DRunModePrivateData *pd = (DRunModePrivateData *) mode_get_private_data ( sw );
if ( pd->file_complete ){
if ( pd->file_complete ) {
return pd->completer->_get_display_value (pd->completer, selected_line, state, list, get_entry );
}
*state |= MARKUP;
@ -1323,10 +1326,10 @@ static char *drun_get_completion ( const Mode *sw, unsigned int index )
static int drun_token_match ( const Mode *data, rofi_int_matcher **tokens, unsigned int index )
{
DRunModePrivateData *rmpd = (DRunModePrivateData *) mode_get_private_data ( data );
if ( rmpd->file_complete ){
if ( rmpd->file_complete ) {
return rmpd->completer->_token_match (rmpd->completer, tokens, index );
}
int match = 1;
int match = 1;
if ( tokens ) {
for ( int j = 0; match && tokens != NULL && tokens[j] != NULL; j++ ) {
int test = 0;
@ -1386,7 +1389,7 @@ static int drun_token_match ( const Mode *data, rofi_int_matcher **tokens, unsig
static unsigned int drun_mode_get_num_entries ( const Mode *sw )
{
const DRunModePrivateData *pd = (const DRunModePrivateData *) mode_get_private_data ( sw );
if ( pd->file_complete ){
if ( pd->file_complete ) {
return pd->completer->_get_num_entries( pd->completer );
}
return pd->cmd_list_length;
@ -1397,12 +1400,12 @@ static char *drun_get_message ( const Mode *sw )
if ( pd->file_complete ) {
if ( pd->selected_line < pd->cmd_list_length ) {
char *msg = mode_get_message ( pd->completer);
if (msg ){
if ( msg ) {
char *retv = g_strdup_printf("File complete for: %s\n%s", pd->entry_list[pd->selected_line].name, msg);
g_free (msg);
return retv;
}
return g_strdup_printf("File complete for: %s", pd->entry_list[pd->selected_line].name);
return g_strdup_printf("File complete for: %s", pd->entry_list[pd->selected_line].name);
}
}
return NULL;

View File

@ -79,7 +79,7 @@ enum FBSortingTime
FB_CTIME,
};
/** Icons to use for the file type */
/** Icons to use for the file type */
const char *icon_name[NUM_FILE_TYPES] =
{
"go-up",
@ -275,7 +275,7 @@ static void get_file_browser ( Mode *sw )
pd->array[pd->array_length].type = RFILE;
{
// If we have link, use a stat to fine out what it is, if we fail, we mark it as file.
// TODO have a 'broken link' mode?
// TODO have a 'broken link' mode?
// Convert full path to right encoding.
char *file = g_filename_from_utf8 ( pd->array[pd->array_length].path, -1, NULL, NULL, NULL );
if ( file ) {
@ -466,7 +466,7 @@ static ModeMode file_browser_mode_result ( Mode *sw, int mretv, char **input, un
char *p = rofi_expand_path ( *input );
char *dir = g_filename_from_utf8 ( p, -1, NULL, NULL, NULL );
g_free ( p );
if ( g_file_test ( dir, G_FILE_TEST_EXISTS ) ) {
if ( g_file_test ( dir, G_FILE_TEST_EXISTS ) ) {
if ( g_file_test ( dir, G_FILE_TEST_IS_DIR ) ) {
g_object_unref ( pd->current_dir );
pd->current_dir = g_file_new_for_path ( dir );
@ -627,7 +627,7 @@ ModeMode file_browser_mode_completer ( Mode *sw, int mretv, char **input, unsign
char *p = rofi_expand_path ( *input );
char *dir = g_filename_from_utf8 ( p, -1, NULL, NULL, NULL );
g_free ( p );
if ( g_file_test ( dir, G_FILE_TEST_EXISTS ) ) {
if ( g_file_test ( dir, G_FILE_TEST_EXISTS ) ) {
if ( g_file_test ( dir, G_FILE_TEST_IS_DIR ) ) {
g_object_unref ( pd->current_dir );
pd->current_dir = g_file_new_for_path ( dir );

View File

@ -115,7 +115,7 @@ static gboolean exec_cmd ( const char *cmd, int run_in_term )
char *path = g_build_filename ( cache_dir, RUN_CACHE_FILE, NULL );
RofiHelperExecuteContext context = { .name = NULL };
// FIXME: assume startup notification support for terminals
if ( helper_execute_command ( NULL, lf_cmd, run_in_term, run_in_term ? &context : NULL ) ) {
if ( helper_execute_command ( NULL, lf_cmd, run_in_term, run_in_term ? &context : NULL ) ) {
/**
* This happens in non-critical time (After launching app)
* It is allowed to be a bit slower.
@ -171,7 +171,7 @@ static int sort_func ( const void *a, const void *b, G_GNUC_UNUSED void *data )
else if ( bstr->entry == NULL ) {
return -1;
}
return g_strcmp0 ( astr->entry , bstr->entry );
return g_strcmp0 ( astr->entry , bstr->entry );
}
/**
@ -245,7 +245,7 @@ static RunEntry * get_apps ( unsigned int *length )
path = g_build_filename ( cache_dir, RUN_CACHE_FILE, NULL );
char **hretv = history_get_list ( path, length );
retv = (RunEntry*)g_malloc0((*length+1)*sizeof(RunEntry));
for(unsigned int i =0; i < *length; i++ ){
for ( unsigned int i = 0; i < *length; i++ ) {
retv[i].entry = hretv[i];
}
g_free(hretv);
@ -256,11 +256,11 @@ static RunEntry * get_apps ( unsigned int *length )
path = g_strdup ( g_getenv ( "PATH" ) );
gsize l = 0;
gchar *homedir = g_locale_to_utf8 ( g_get_home_dir (), -1, NULL, &l, &error );
gchar *homedir = g_locale_to_utf8 ( g_get_home_dir (), -1, NULL, &l, &error );
if ( error != NULL ) {
g_debug ( "Failed to convert homedir to UTF-8: %s", error->message );
for ( unsigned int i = 0; retv[i].entry != NULL ; i++ ) {
g_free ( retv[i].entry );
g_free ( retv[i].entry );
}
g_free(retv);
g_clear_error ( &error );
@ -394,7 +394,7 @@ static void run_mode_destroy ( Mode *sw )
{
RunModePrivateData *rmpd = (RunModePrivateData *) sw->private_data;
if ( rmpd != NULL ) {
for ( unsigned int i = 0; i < rmpd->cmd_list_length; i++ ){
for ( unsigned int i = 0; i < rmpd->cmd_list_length; i++ ) {
g_free ( rmpd->cmd_list[i].entry );
if ( rmpd->cmd_list[i].icon != NULL ) {
cairo_surface_destroy ( rmpd->cmd_list[i].icon );
@ -412,7 +412,7 @@ static void run_mode_destroy ( Mode *sw )
static unsigned int run_mode_get_num_entries ( const Mode *sw )
{
const RunModePrivateData *rmpd = (const RunModePrivateData *) sw->private_data;
if ( rmpd->file_complete ){
if ( rmpd->file_complete ) {
return rmpd->completer->_get_num_entries( rmpd->completer );
}
return rmpd->cmd_list_length;
@ -436,17 +436,19 @@ static ModeMode run_mode_result ( Mode *sw, int mretv, char **input, unsigned in
(*input) = g_strdup ( rmpd->old_input );
}
rmpd->file_complete = FALSE;
} else if ( (mretv&MENU_CANCEL) ) {
}
else if ( (mretv&MENU_CANCEL) ) {
retv = MODE_EXIT;
} else {
}
else {
char *path = NULL;
retv = file_browser_mode_completer ( rmpd->completer, mretv, input, selected_line, &path );
if ( retv == MODE_EXIT ) {
if ( path == NULL )
{
if ( path == NULL ) {
exec_cmd ( rmpd->cmd_list[rmpd->selected_line].entry, run_in_term );
} else {
char *arg= g_strdup_printf ( "%s '%s'", rmpd->cmd_list[rmpd->selected_line].entry, path);
}
else {
char *arg= g_strdup_printf ( "%s '%s'", rmpd->cmd_list[rmpd->selected_line].entry, path);
exec_cmd ( arg, run_in_term );
g_free(arg);
}
@ -477,9 +479,10 @@ static ModeMode run_mode_result ( Mode *sw, int mretv, char **input, unsigned in
}
else if ( mretv & MENU_CUSTOM_COMMAND ) {
retv = ( mretv & MENU_LOWER_MASK );
} else if ( ( mretv& MENU_COMPLETE) ) {
}
else if ( ( mretv& MENU_COMPLETE) ) {
retv = RELOAD_DIALOG;
if ( selected_line < rmpd->cmd_list_length ) {
if ( selected_line < rmpd->cmd_list_length ) {
rmpd->selected_line = selected_line;
g_free ( rmpd->old_input );
@ -488,7 +491,7 @@ static ModeMode run_mode_result ( Mode *sw, int mretv, char **input, unsigned in
if ( *input ) g_free (*input);
*input = g_strdup ( rmpd->old_completer_input );
rmpd->file_complete = TRUE;
rmpd->file_complete = TRUE;
}
}
return retv;
@ -497,7 +500,7 @@ static ModeMode run_mode_result ( Mode *sw, int mretv, char **input, unsigned in
static char *_get_display_value ( const Mode *sw, unsigned int selected_line, G_GNUC_UNUSED int *state, G_GNUC_UNUSED GList **list, int get_entry )
{
const RunModePrivateData *rmpd = (const RunModePrivateData *) sw->private_data;
if ( rmpd->file_complete ){
if ( rmpd->file_complete ) {
return rmpd->completer->_get_display_value (rmpd->completer, selected_line, state, list, get_entry );
}
return get_entry ? g_strdup ( rmpd->cmd_list[selected_line].entry ) : NULL;
@ -506,7 +509,7 @@ static char *_get_display_value ( const Mode *sw, unsigned int selected_line, G_
static int run_token_match ( const Mode *sw, rofi_int_matcher **tokens, unsigned int index )
{
const RunModePrivateData *rmpd = (const RunModePrivateData *) sw->private_data;
if ( rmpd->file_complete ){
if ( rmpd->file_complete ) {
return rmpd->completer->_token_match (rmpd->completer, tokens, index );
}
return helper_token_match ( tokens, rmpd->cmd_list[index].entry );
@ -516,13 +519,13 @@ static char *run_get_message ( const Mode *sw )
RunModePrivateData *pd = sw->private_data;
if ( pd->file_complete ) {
if ( pd->selected_line < pd->cmd_list_length ) {
char *msg = mode_get_message ( pd->completer);
if (msg ){
char *msg = mode_get_message ( pd->completer);
if ( msg ) {
char *retv = g_strdup_printf("File complete for: %s\n%s", pd->cmd_list[pd->selected_line].entry, msg);
g_free (msg);
return retv;
}
return g_strdup_printf("File complete for: %s", pd->cmd_list[pd->selected_line].entry);
return g_strdup_printf("File complete for: %s", pd->cmd_list[pd->selected_line].entry);
}
}
return NULL;

View File

@ -218,7 +218,7 @@ static DmenuScriptEntry *execute_executor ( Mode *sw, char *arg, unsigned int *l
retv[( *length )].info = NULL;
retv[( *length )].icon_fetch_uid = 0;
retv[( *length )].nonselectable = FALSE;
if ( buf_length > 0 && ( read_length > (ssize_t) buf_length ) ) {
if ( buf_length > 0 && ( read_length > (ssize_t) buf_length ) ) {
dmenuscript_parse_entry_extras ( sw, &( retv[( *length )] ), buffer + buf_length, read_length - buf_length );
}
retv[( *length ) + 1].entry = NULL;

View File

@ -173,7 +173,7 @@ static void delete_ssh ( const char *host )
* @param retv list of hosts
* @param length pointer to length of list [in][out]
*
* Read 'known_hosts' file when entries are not hashsed.
* Read 'known_hosts' file when entries are not hashed.
*
* @returns updated list of hosts.
*/
@ -198,14 +198,14 @@ static SshEntry *read_known_hosts_file ( const char *path, SshEntry * retv, unsi
}
// Find end of hostname set.
char *end = strstr ( start, " " );
if ( end == NULL ) {
if ( end == NULL ) {
// Something is wrong.
continue;
}
*end = '\0';
char *sep = start;
start = strsep ( &sep, ", " );
while ( start ) {
while ( start ) {
int port = 0;
if ( start[0] == '[' ) {
start++;
@ -215,7 +215,7 @@ static SshEntry *read_known_hosts_file ( const char *path, SshEntry * retv, unsi
errno = 0;
gchar *endptr = NULL;
gint64 number = g_ascii_strtoll ( &( end[2] ), &endptr, 10 );
if ( errno != 0 ) {
if ( errno != 0 ) {
g_warning ( "Failed to parse port number: %s.", &( end[2] ) );
}
else if ( endptr == &( end[2] ) ) {
@ -466,7 +466,7 @@ static void parse_ssh_config_file ( SSHModePrivateData *pd, const char *filename
*
* @returns an array of strings containing all the hosts.
*/
static SshEntry * get_ssh ( SSHModePrivateData *pd, unsigned int *length )
static SshEntry * get_ssh ( SSHModePrivateData *pd, unsigned int *length )
{
SshEntry *retv = NULL;
unsigned int num_favorites = 0;
@ -488,7 +488,7 @@ static SshEntry * get_ssh ( SSHModePrivateData *pd, unsigned int *length )
errno = 0;
gchar *endptr = NULL;
gint64 number = g_ascii_strtoll ( &( portstr[1] ), &endptr, 10 );
if ( errno != 0 ) {
if ( errno != 0 ) {
g_warning ( "Failed to parse port number: %s.", &( portstr[1] ) );
}
else if ( endptr == &( portstr[1] ) ) {

View File

@ -459,7 +459,7 @@ static unsigned int window_mode_get_num_entries ( const Mode *sw )
* Is there a call for this?
*/
const char *invalid_desktop_name = "n/a";
static const char * _window_name_list_entry ( const char *str, uint32_t length, int entry )
static const char * _window_name_list_entry ( const char *str, uint32_t length, int entry )
{
uint32_t offset = 0;
int index = 0;
@ -504,7 +504,7 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd )
}
else {
c = xcb_ewmh_get_client_list ( &xcb->ewmh, xcb->screen_nbr );
if ( xcb_ewmh_get_client_list_reply ( &xcb->ewmh, c, &clients, NULL ) ) {
if ( xcb_ewmh_get_client_list_reply ( &xcb->ewmh, c, &clients, NULL ) ) {
found = 1;
}
}
@ -512,7 +512,7 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd )
return;
}
if ( clients.windows_len > 0 ) {
if ( clients.windows_len > 0 ) {
int i;
// windows we actually display. May be slightly different to _NET_CLIENT_LIST_STACKING
// if we happen to have a window destroyed while we're working...
@ -566,7 +566,7 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd )
char *output = NULL;
if ( pango_parse_markup ( _window_name_list_entry ( names.strings, names.strings_len,
c->wmdesktop ), -1, 0, NULL, &output, NULL, NULL ) ) {
c->wmdesktopstr = g_strdup ( _window_name_list_entry ( names.strings, names.strings_len, c->wmdesktop ) );
c->wmdesktopstr = g_strdup ( _window_name_list_entry ( names.strings, names.strings_len, c->wmdesktop ) );
c->wmdesktopstr_len = g_utf8_strlen ( output, -1 );
pd->wmdn_len = MAX ( pd->wmdn_len, c->wmdesktopstr_len );
g_free ( output );
@ -645,7 +645,7 @@ static inline int act_on_window ( xcb_window_t window )
g_spawn_async ( NULL, args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error );
if ( error != NULL ) {
char *msg = g_strdup_printf ( "Failed to execute action for window: '%s'\nError: '%s'", window_regex, error->message );
rofi_view_error_dialog ( msg, FALSE );
rofi_view_error_dialog ( msg, FALSE );
g_free ( msg );
// print error.
g_error_free ( error );
@ -723,7 +723,7 @@ static ModeMode window_mode_result ( Mode *sw, int mretv, G_GNUC_UNUSED char **i
}
RofiHelperExecuteContext context = { .name = NULL };
if ( !helper_execute_command ( NULL, lf_cmd, run_in_term, run_in_term ? &context : NULL ) ) {
if ( !helper_execute_command ( NULL, lf_cmd, run_in_term, run_in_term ? &context : NULL ) ) {
retv = RELOAD_DIALOG;
}
g_free ( lf_cmd );

View File

@ -212,7 +212,7 @@ static char *utf8_helper_simplify_string ( const char *s )
}
// Macro for quickly generating regex for matching.
static inline GRegex * R ( const char *s, int case_sensitive )
static inline GRegex * R ( const char *s, int case_sensitive )
{
if ( config.normalize_match ) {
char *str = utf8_helper_simplify_string ( s );
@ -335,7 +335,7 @@ const char ** find_arg_strv ( const char *const key )
const char **retv = NULL;
int length = 0;
for ( int i = 0; i < stored_argc; i++ ) {
if ( i < ( stored_argc - 1 ) && strcasecmp ( stored_argv[i], key ) == 0 ) {
if ( i < ( stored_argc - 1 ) && strcasecmp ( stored_argv[i], key ) == 0 ) {
length++;
}
}
@ -656,7 +656,7 @@ int config_sanity_check ( void )
}
if ( config.element_height < 1 ) {
g_string_append_printf ( msg, "\t<b>config.element_height</b>=%d is invalid. An element needs to be atleast 1 line high.\n",
g_string_append_printf ( msg, "\t<b>config.element_height</b>=%d is invalid. An element needs to be at least 1 line high.\n",
config.element_height );
config.element_height = 1;
found_error = TRUE;
@ -1004,7 +1004,7 @@ gboolean helper_execute ( const char *wd, char **args, const char *error_precmd,
g_spawn_async ( wd, args, NULL, G_SPAWN_SEARCH_PATH, child_setup, user_data, NULL, &error );
if ( error != NULL ) {
char *msg = g_strdup_printf ( "Failed to execute: '%s%s'\nError: '%s'", error_precmd, error_cmd, error->message );
rofi_view_error_dialog ( msg, FALSE );
rofi_view_error_dialog ( msg, FALSE );
g_free ( msg );
// print error.
g_error_free ( error );
@ -1130,7 +1130,7 @@ static gboolean parse_pair ( char *input, rofi_range_pair *item )
int pythonic = ( strchr ( input, ':' ) || input[0] == '-' ) ? 1 : 0;
int index = 0;
for ( char *token = strsep ( &input, sep[pythonic] ); token != NULL; token = strsep ( &input, sep[pythonic] ) ) {
for ( char *token = strsep ( &input, sep[pythonic] ); token != NULL; token = strsep ( &input, sep[pythonic] ) ) {
if ( index == 0 ) {
item->start = item->stop = (int) strtol ( token, NULL, 10 );
index++;

View File

@ -168,7 +168,7 @@ static _element ** __history_get_element_list ( FILE *fd, unsigned int *length )
( *length )++;
}
if ( buffer != NULL ) {
if ( buffer != NULL ) {
free ( buffer );
buffer = NULL;
}

View File

@ -151,7 +151,7 @@ guint key_binding_get_action_from_name ( const char *name )
{
for ( gsize i = 0; i < G_N_ELEMENTS ( rofi_bindings ); ++i ) {
ActionBindingEntry *b = &rofi_bindings[i];
if ( g_strcmp0(b->name, name) == 0 ){
if ( g_strcmp0(b->name, name) == 0 ) {
return b->id;
}
}

View File

@ -271,7 +271,7 @@ gboolean rofi_icon_fetcher_file_is_image ( const char * const path )
return FALSE;
}
const char *suf = strrchr ( path, '.' );
if ( suf == NULL ) {
if ( suf == NULL ) {
return FALSE;
}
suf++;
@ -304,17 +304,17 @@ static void rofi_icon_fetcher_worker ( thread_state *sdata, G_GNUC_UNUSED gpoint
else {
icon_path = icon_path_ = nk_xdg_theme_get_icon ( rofi_icon_fetcher_data->xdg_context, themes, NULL, sentry->entry->name, MIN(sentry->wsize,sentry->hsize), 1, TRUE );
if ( icon_path_ == NULL ) {
g_debug ( "failed to get icon %s(%dx%d): n/a", sentry->entry->name, sentry->wsize, sentry->hsize );
g_debug ( "failed to get icon %s(%dx%d): n/a", sentry->entry->name, sentry->wsize, sentry->hsize );
return;
}
else{
g_debug ( "found icon %s(%dx%d): %s", sentry->entry->name, sentry->wsize, sentry->hsize, icon_path );
g_debug ( "found icon %s(%dx%d): %s", sentry->entry->name, sentry->wsize, sentry->hsize, icon_path );
}
}
cairo_surface_t *icon_surf = NULL;
const char *suf = strrchr ( icon_path, '.' );
if ( suf == NULL ) {
if ( suf == NULL ) {
return;
}

View File

@ -17,7 +17,7 @@ const char * const PropertyTypeName[P_NUM_TYPES] = {
/** Color */
"Color",
/** Image */
"Iamge",
"Image",
/** Padding */
"Padding",
/** Link to global setting */

View File

@ -203,14 +203,14 @@ static void run_switcher ( ModeMode mode )
// User can pre-select a row.
if ( find_arg ( "-selected-row" ) >= 0 ) {
unsigned int sr = 0;
find_arg_uint ( "-selected-row", &( sr ) );
find_arg_uint ( "-selected-row", &( sr ) );
rofi_view_set_selected_line ( state, sr );
}
if ( state ) {
rofi_view_set_active ( state );
}
if ( rofi_view_get_active () == NULL ) {
g_main_loop_quit ( main_loop );
g_main_loop_quit ( main_loop );
}
}
void process_result ( RofiViewState *state )
@ -223,7 +223,7 @@ void process_result ( RofiViewState *state )
char *input = g_strdup ( rofi_view_get_user_input ( state ) );
ModeMode retv = mode_result ( sw, mretv, &input, selected_line );
{
if ( state->text ){
if ( state->text ) {
if ( input == NULL ) {
textbox_text ( state->text, "" );
} else if ( strcmp ( rofi_view_get_user_input ( state ), input ) != 0 ) {
@ -303,7 +303,7 @@ static void print_list_of_modi ( int is_term )
static void print_main_application_options ( int is_term )
{
print_help_msg ( "-no-config", "", "Do not load configuration, use default values.", NULL, is_term );
print_help_msg ( "-v,-version", "", "Print the version number and exit.", NULL, is_term );
print_help_msg ( "-v,-version", "", "Print the version number and exit.", NULL, is_term );
print_help_msg ( "-dmenu", "", "Start in dmenu mode.", NULL, is_term );
print_help_msg ( "-display", "[string]", "X server to contact.", "${DISPLAY}", is_term );
print_help_msg ( "-h,-help", "", "This help message.", NULL, is_term );
@ -453,7 +453,7 @@ static void cleanup ()
mode_destroy ( modi[i] );
}
rofi_view_workers_finalize ();
if ( main_loop != NULL ) {
if ( main_loop != NULL ) {
g_main_loop_unref ( main_loop );
main_loop = NULL;
}
@ -733,12 +733,12 @@ static gboolean startup ( G_GNUC_UNUSED gpointer data )
g_main_loop_quit ( main_loop );
}
}
else if ( find_arg_str ( "-e", &( msg ) ) ) {
else if ( find_arg_str ( "-e", &( msg ) ) ) {
int markup = FALSE;
if ( find_arg ( "-markup" ) >= 0 ) {
markup = TRUE;
}
if ( !rofi_view_error_dialog ( msg, markup ) ) {
if ( !rofi_view_error_dialog ( msg, markup ) ) {
g_main_loop_quit ( main_loop );
}
}
@ -794,7 +794,7 @@ int main ( int argc, char *argv[] )
cmd_set_arguments ( argc, argv );
// Version
if ( find_arg ( "-v" ) >= 0 || find_arg ( "-version" ) >= 0 ) {
if ( find_arg ( "-v" ) >= 0 || find_arg ( "-version" ) >= 0 ) {
#ifdef GIT_VERSION
g_print ( "Version: "GIT_VERSION "\n" );
#else
@ -829,7 +829,7 @@ int main ( int argc, char *argv[] )
// Detect if we are in dmenu mode.
// This has two possible causes.
// 1 the user specifies it on the command-line.
if ( find_arg ( "-dmenu" ) >= 0 ) {
if ( find_arg ( "-dmenu" ) >= 0 ) {
dmenu_mode = TRUE;
}
// 2 the binary that executed is called dmenu (e.g. symlink to rofi)
@ -943,7 +943,7 @@ int main ( int argc, char *argv[] )
g_free ( etc );
}
}
if ( !found_system ) {
if ( !found_system ) {
/** New format. */
gchar *etc = g_build_filename ( SYSCONFDIR, "rofi.rasi", NULL );
g_debug ( "Look for default config file: %s", etc );
@ -1057,7 +1057,7 @@ int main ( int argc, char *argv[] )
}
// Dump.
// catch help request
if ( find_arg ( "-h" ) >= 0 || find_arg ( "-help" ) >= 0 || find_arg ( "--help" ) >= 0 ) {
if ( find_arg ( "-h" ) >= 0 || find_arg ( "-help" ) >= 0 || find_arg ( "--help" ) >= 0 ) {
help ( argc, argv );
cleanup ();
return EXIT_SUCCESS;

View File

@ -143,7 +143,7 @@ Property* rofi_theme_property_copy ( const Property *p )
retv->value.image.url = g_strdup ( p->value.image.url );
retv->value.image.colors = NULL;
for ( GList *l = g_list_first ( p->value.image.colors );
l ; l = g_list_next(l)){
l ; l = g_list_next(l)) {
retv->value.image.colors = g_list_append ( retv->value.image.colors,
g_memdup ( l->data, sizeof(ThemeColor)));
}
@ -1006,7 +1006,7 @@ gboolean rofi_theme_get_image ( const widget *widget, const char *property, cair
}
};
guint length = g_list_length ( p->value.image.colors );
if ( length > 1 ){
if ( length > 1 ) {
length--;
guint color_index = 0;
for ( GList *l = g_list_first ( p->value.image.colors); l != NULL ; l = g_list_next ( l ) )
@ -1221,7 +1221,7 @@ char * rofi_theme_parse_prepare_file ( const char *file, const char *parent_file
{
char *filename = rofi_expand_path ( file );
// If no absolute path specified, expand it.
if ( parent_file != NULL && !g_path_is_absolute ( filename ) ) {
if ( parent_file != NULL && !g_path_is_absolute ( filename ) ) {
char *basedir = g_path_get_dirname ( parent_file );
char *path = g_build_filename ( basedir, filename, NULL );
g_free ( filename );

View File

@ -277,9 +277,9 @@ static gboolean bench_update ( void )
return TRUE;
}
static gboolean rofi_view_repaint ( G_GNUC_UNUSED void * data )
static gboolean rofi_view_repaint ( G_GNUC_UNUSED void * data )
{
if ( current_active_menu ) {
if ( current_active_menu ) {
// Repaint the view (if needed).
// After a resize the edit_pixmap surface might not contain anything anymore.
// If we already re-painted, this does nothing.
@ -490,7 +490,7 @@ static gboolean rofi_view_user_timeout ( G_GNUC_UNUSED gpointer data )
guint id = key_binding_get_action_from_name(action);
if ( id != UINT32_MAX )
{
rofi_view_trigger_action ( rofi_view_get_active (), SCOPE_GLOBAL, id);
rofi_view_trigger_action ( rofi_view_get_active (), SCOPE_GLOBAL, id);
} else {
g_warning("Failed to parse keybinding: %s\r\n", action);
}
@ -521,19 +521,19 @@ static void rofi_view_set_user_timeout ( G_GNUC_UNUSED gpointer data )
}
void rofi_view_reload ( void )
void rofi_view_reload ( void )
{
// @TODO add check if current view is equal to the callee
if ( CacheState.idle_timeout == 0 ) {
CacheState.idle_timeout = g_timeout_add ( 1000 / 10, rofi_view_reload_idle, NULL );
}
}
void rofi_view_queue_redraw ( void )
void rofi_view_queue_redraw ( void )
{
if ( current_active_menu && CacheState.repaint_source == 0 ) {
CacheState.count++;
g_debug ( "redraw %llu", CacheState.count );
CacheState.repaint_source = g_idle_add_full ( G_PRIORITY_HIGH_IDLE, rofi_view_repaint, NULL, NULL );
CacheState.repaint_source = g_idle_add_full ( G_PRIORITY_HIGH_IDLE, rofi_view_repaint, NULL, NULL );
}
}
@ -726,7 +726,7 @@ static void filter_elements ( thread_state *ts, G_GNUC_UNUSED gpointer user_data
t->count++;
}
}
if ( t->acount != NULL ) {
if ( t->acount != NULL ) {
g_mutex_lock ( t->mutex );
( *( t->acount ) )--;
g_cond_signal ( t->cond );
@ -907,7 +907,7 @@ void __create_window ( MenuFlags menu_flags )
xcb->ewmh._NET_WM_STATE_FULLSCREEN,
xcb->ewmh._NET_WM_STATE_ABOVE
};
window_set_atom_prop ( box_window, xcb->ewmh._NET_WM_STATE, atoms, sizeof ( atoms ) / sizeof ( xcb_atom_t ) );
window_set_atom_prop ( box_window, xcb->ewmh._NET_WM_STATE, atoms, sizeof ( atoms ) / sizeof ( xcb_atom_t ) );
}
xcb_atom_t protocols[] = {
@ -924,7 +924,7 @@ void __create_window ( MenuFlags menu_flags )
TICK_N ( "setup window name and class" );
const char *transparency = rofi_theme_get_string ( WIDGET ( win ), "transparency", NULL );
if ( transparency ) {
rofi_view_setup_fake_transparency ( WIDGET ( win ), transparency );
rofi_view_setup_fake_transparency ( WIDGET ( win ), transparency );
}
if ( xcb->sncontext != NULL ) {
sn_launchee_context_setup_window ( xcb->sncontext, CacheState.main_window );
@ -1238,7 +1238,7 @@ static void rofi_view_refilter ( RofiViewState *state )
TICK_N ( "Update filter lines" );
if ( config.auto_select == TRUE && state->filtered_lines == 1 && state->num_lines > 1 ) {
( state->selected_line ) = state->line_map[listview_get_selected ( state->list_view )];
( state->selected_line ) = state->line_map[listview_get_selected ( state->list_view )];
state->retv = MENU_OK;
state->quit = TRUE;
}
@ -1694,7 +1694,7 @@ void rofi_view_temp_click_to_exit ( RofiViewState *state, xcb_window_t target )
void rofi_view_frame_callback ( void )
{
if ( CacheState.repaint_source == 0 ) {
CacheState.repaint_source = g_idle_add_full ( G_PRIORITY_HIGH_IDLE, rofi_view_repaint, NULL, NULL );
CacheState.repaint_source = g_idle_add_full ( G_PRIORITY_HIGH_IDLE, rofi_view_repaint, NULL, NULL );
}
}
@ -1907,7 +1907,7 @@ static void rofi_view_add_widget ( RofiViewState *state, widget *parent_widget,
for ( unsigned int j = 0; j < state->num_modi; j++ ) {
const Mode * mode = rofi_get_mode ( j );
state->modi[j] = textbox_create ( WIDGET ( state->sidebar_bar ), WIDGET_TYPE_MODE_SWITCHER, "button", TB_AUTOHEIGHT, ( mode == state->sw ) ? HIGHLIGHT : NORMAL,
mode_get_display_name ( mode ), 0.5, 0.5 );
mode_get_display_name ( mode ), 0.5, 0.5 );
box_add ( state->sidebar_bar, WIDGET ( state->modi[j] ), TRUE );
widget_set_trigger_action_handler ( WIDGET ( state->modi[j] ), textbox_sidebar_modi_trigger_action, state );
}
@ -1917,16 +1917,16 @@ static void rofi_view_add_widget ( RofiViewState *state, widget *parent_widget,
box_add ( (box *) parent_widget, WIDGET ( state->overlay ), FALSE );
widget_disable ( WIDGET ( state->overlay ) );
}
else if ( g_ascii_strncasecmp ( name, "textbox", 7 ) == 0 ) {
else if ( g_ascii_strncasecmp ( name, "textbox", 7 ) == 0 ) {
textbox *t = textbox_create ( parent_widget, WIDGET_TYPE_TEXTBOX_TEXT, name, TB_AUTOHEIGHT | TB_WRAP, NORMAL, "", 0, 0 );
box_add ( (box *) parent_widget, WIDGET ( t ), TRUE );
}
else if ( g_ascii_strncasecmp ( name, "button", 6 ) == 0 ) {
else if ( g_ascii_strncasecmp ( name, "button", 6 ) == 0 ) {
textbox *t = textbox_create ( parent_widget, WIDGET_TYPE_EDITBOX, name, TB_AUTOHEIGHT | TB_WRAP, NORMAL, "", 0, 0 );
box_add ( (box *) parent_widget, WIDGET ( t ), TRUE );
widget_set_trigger_action_handler ( WIDGET ( t ), textbox_button_trigger_action, state );
}
else if ( g_ascii_strncasecmp ( name, "icon", 4 ) == 0 ) {
else if ( g_ascii_strncasecmp ( name, "icon", 4 ) == 0 ) {
icon *t = icon_create ( parent_widget, name );
/* small hack to make it clickable */
const char * type = rofi_theme_get_string ( WIDGET(t), "action", NULL );
@ -2074,7 +2074,7 @@ int rofi_view_error_dialog ( const char *msg, int markup )
// resize window vertically to suit
state->height = widget_get_desired_height ( WIDGET ( state->main_window ) );
// Calculte window position.
// Calculate window position.
rofi_view_calculate_window_position ( state );
// Move the window to the correct x,y position.

View File

@ -49,7 +49,7 @@ struct _box
GList *children;
};
static void box_update ( widget *wid );
static void box_update ( widget *wid );
static int box_get_desired_width ( widget *wid )
{
@ -183,7 +183,7 @@ static void vert_calculate_size ( box *b )
}
else {
widget_move ( child, widget_padding_get_left ( WIDGET ( b ) ), top );
top += widget_get_height ( child );
top += widget_get_height ( child );
top += spacing;
}
}
@ -236,7 +236,7 @@ static void hori_calculate_size ( box *b )
}
for ( GList *iter = g_list_first ( b->children ); iter != NULL; iter = g_list_next ( iter ) ) {
widget * child = (widget *) iter->data;
if ( child->enabled == FALSE ) {
if ( child->enabled == FALSE ) {
continue;
}
if ( child->expand == TRUE ) {
@ -251,7 +251,7 @@ static void hori_calculate_size ( box *b )
}
else {
widget_move ( child, left, widget_padding_get_top ( WIDGET ( b ) ) );
left += widget_get_width ( child );
left += widget_get_width ( child );
left += spacing;
}
}
@ -361,7 +361,7 @@ box * box_create ( widget *parent, const char *name, RofiOrientation type )
return b;
}
static void box_update ( widget *wid )
static void box_update ( widget *wid )
{
box *b = (box *) wid;
switch ( b->type )

View File

@ -41,7 +41,7 @@ struct _container
widget *child;
};
static void container_update ( widget *wid );
static void container_update ( widget *wid );
static int container_get_desired_height ( widget *widget )
{
@ -75,7 +75,7 @@ void container_add ( container *container, widget *child )
return;
}
container->child = child;
g_assert ( child->parent == WIDGET ( container ) );
g_assert ( child->parent == WIDGET ( container ) );
widget_update ( WIDGET ( container ) );
}
@ -122,7 +122,7 @@ container * container_create ( widget *parent, const char *name )
return b;
}
static void container_update ( widget *wid )
static void container_update ( widget *wid )
{
container *b = (container *) wid;
if ( b->child && b->child->enabled ) {

View File

@ -58,8 +58,8 @@ static int icon_get_desired_height ( widget *widget )
{
icon *b = (icon *) widget;
int height = b->size;
if ( b->squared == FALSE ){
if( b->icon ) {
if ( b->squared == FALSE ) {
if ( b->icon ) {
int iconh = cairo_image_surface_get_height ( b->icon );
int iconw = cairo_image_surface_get_width ( b->icon );
int icons = MAX ( iconh, iconw );
@ -74,8 +74,8 @@ static int icon_get_desired_width ( widget *widget )
{
icon *b = (icon *) widget;
int width = b->size;
if ( b->squared == FALSE ){
if( b->icon ) {
if ( b->squared == FALSE ) {
if ( b->icon ) {
int iconh = cairo_image_surface_get_height ( b->icon );
int iconw = cairo_image_surface_get_width ( b->icon );
int icons = MAX ( iconh, iconw );
@ -97,7 +97,7 @@ static void icon_draw ( widget *wid, cairo_t *draw )
cairo_surface_reference ( b->icon );
}
}
if ( b->icon == NULL ) {
if ( b->icon == NULL ) {
return;
}
int iconh = cairo_image_surface_get_height ( b->icon );

View File

@ -405,7 +405,7 @@ static void listview_draw ( widget *wid, cairo_t *draw )
scrollbar_set_handle ( lv->scrollbar, lv->req_elements - lv->selected - 1 );
}
else {
scrollbar_set_handle ( lv->scrollbar, lv->selected );
scrollbar_set_handle ( lv->scrollbar, lv->selected );
}
lv->last_offset = offset;
int spacing_vert = distance_get_pixel ( lv->spacing, ROFI_ORIENTATION_VERTICAL );
@ -503,7 +503,7 @@ static void listview_recompute_elements ( listview *lv )
widget_free ( WIDGET ( lv->boxes[i].box ) );
}
lv->boxes = g_realloc ( lv->boxes, newne * sizeof ( _listview_row ) );
if ( newne > 0 ) {
if ( newne > 0 ) {
for ( unsigned int i = lv->cur_elements; i < newne; i++ ) {
listview_create_row ( lv, &( lv->boxes[i] ) );
widget *wid = WIDGET ( lv->boxes[i].box );
@ -565,7 +565,7 @@ static void listview_resize ( widget *wid, short w, short h )
lv->widget.w - widget_padding_get_right ( WIDGET ( lv ) ) - widget_get_width ( WIDGET ( lv->scrollbar ) ),
widget_padding_get_top ( WIDGET ( lv ) ) );
widget_resize ( WIDGET ( lv->scrollbar ), widget_get_width ( WIDGET ( lv->scrollbar ) ), height );
widget_resize ( WIDGET ( lv->scrollbar ), widget_get_width ( WIDGET ( lv->scrollbar ) ), height );
if ( lv->type == BARVIEW ) {
lv->max_elements = lv->menu_lines;
@ -985,7 +985,7 @@ gboolean listview_get_fixed_num_lines ( listview *lv )
}
void listview_set_fixed_num_lines ( listview *lv )
{
if ( lv ) {
if ( lv ) {
lv->fixed_num_lines = TRUE;
}
}

View File

@ -101,7 +101,7 @@ void widget_resize ( widget *widget, short w, short h )
widget->w = w;
widget->h = h;
}
// On a resize we always want to udpate.
// On a resize we always want to update.
widget_queue_redraw ( widget );
}
void widget_move ( widget *widget, short x, short y )
@ -184,7 +184,7 @@ void widget_draw ( widget *widget, cairo_t *d )
radius_tl = MIN ( radius_tl, j );
}
if ( ( radius_br + radius_tr ) > ( vspace ) ) {
int j = ( ( vspace ) / 2.0 );
int j = ( ( vspace ) / 2.0 );
radius_br = MIN ( radius_br, j );
radius_tr = MIN ( radius_tr, j );
}

View File

@ -466,7 +466,7 @@ static workarea * x11_get_monitor_from_output ( xcb_randr_output_t out )
}
#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_MAJOR_VERSION > RANDR_PREF_MAJOR_VERSION )
/**
* @param mon The randr monitor to parse.
*
@ -579,7 +579,7 @@ static void x11_build_monitor_layout ()
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_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 );
@ -1075,7 +1075,7 @@ static void main_loop_x11_event_handler_view ( xcb_generic_event_t *event )
{
xcb_motion_notify_event_t *xme = (xcb_motion_notify_event_t *) event;
gboolean button_mask = xme->state & XCB_EVENT_MASK_BUTTON_1_MOTION;
if ( button_mask && config.click_to_exit == TRUE ) {
if ( button_mask && config.click_to_exit == TRUE ) {
xcb->mouse_seen = TRUE;
}
rofi_view_handle_mouse_motion ( state, xme->event_x, xme->event_y, !button_mask && config.hover_select );
@ -1352,7 +1352,7 @@ static void x11_helper_discover_window_manager ( void )
if ( xcb_ewmh_get_supporting_wm_check_reply ( &xcb->ewmh, cc, &wm_win, NULL ) ) {
xcb_ewmh_get_utf8_strings_reply_t wtitle;
xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_name_unchecked ( &( xcb->ewmh ), wm_win );
if ( xcb_ewmh_get_wm_name_reply ( &( xcb->ewmh ), cookie, &wtitle, (void *) 0 ) ) {
if ( xcb_ewmh_get_wm_name_reply ( &( xcb->ewmh ), cookie, &wtitle, (void *) 0 ) ) {
if ( wtitle.strings_len > 0 ) {
g_debug ( "Found window manager: |%s|", wtitle.strings );
if ( g_strcmp0 ( wtitle.strings, "i3" ) == 0 ) {
@ -1372,7 +1372,7 @@ gboolean display_setup ( GMainLoop *main_loop, NkBindings *bindings )
// Get DISPLAY, first env, then argument.
// We never modify display_str content.
char *display_str = ( char *) g_getenv ( "DISPLAY" );
find_arg_str ( "-display", &display_str );
find_arg_str ( "-display", &display_str );
xcb->main_loop = main_loop;
xcb->source = g_water_xcb_source_new ( g_main_loop_get_context ( xcb->main_loop ), display_str, &xcb->screen_nbr, main_loop_x11_event_handler, NULL, NULL );

View File

@ -213,7 +213,7 @@ unsigned int num_extra_options = 0;
GList *extra_parsed_options = NULL;
static gboolean __config_parser_set_property ( XrmOption *option, const Property *p, char **error );
static gboolean __config_parser_set_property ( XrmOption *option, const Property *p, char **error );
void config_parser_add_option ( XrmOptionType type, const char *key, void **value, const char *comment )
{
@ -236,10 +236,10 @@ void config_parser_add_option ( XrmOptionType type, const char *key, void **valu
for ( GList *iter = g_list_first ( extra_parsed_options) ; iter != NULL; iter = g_list_next ( iter ) ) {
if ( g_strcmp0(((Property *)(iter->data))->name, key ) == 0 ){
if ( g_strcmp0(((Property *)(iter->data))->name, key ) == 0 ) {
char *error = NULL;
g_debug("Setting property from backup list: %s", key);
if ( __config_parser_set_property ( &(extra_options[num_extra_options]), (Property *)(iter->data), &error ) ){
if ( __config_parser_set_property ( &(extra_options[num_extra_options]), (Property *)(iter->data), &error ) ) {
g_debug("Failed to set property on custom entry: %s", key);
g_free( error );
}
@ -266,12 +266,12 @@ static void config_parse_cmd_option ( XrmOption *option )
}
break;
case xrm_SNumber:
if ( find_arg_int ( key, option->value.snum ) == TRUE ) {
if ( find_arg_int ( key, option->value.snum ) == TRUE ) {
option->source = CONFIG_CMDLINE;
}
break;
case xrm_String:
if ( find_arg_str ( key, option->value.str ) == TRUE ) {
if ( find_arg_str ( key, option->value.str ) == TRUE ) {
if ( option->mem != NULL ) {
g_free ( option->mem );
option->mem = NULL;
@ -280,21 +280,21 @@ static void config_parse_cmd_option ( XrmOption *option )
}
break;
case xrm_Boolean:
if ( find_arg ( key ) >= 0 ) {
if ( find_arg ( key ) >= 0 ) {
*( option->value.num ) = TRUE;
option->source = CONFIG_CMDLINE;
}
else {
g_free ( key );
key = g_strdup_printf ( "-no-%s", option->name );
if ( find_arg ( key ) >= 0 ) {
if ( find_arg ( key ) >= 0 ) {
*( option->value.num ) = FALSE;
option->source = CONFIG_CMDLINE;
}
}
break;
case xrm_Char:
if ( find_arg_char ( key, option->value.charc ) == TRUE ) {
if ( find_arg_char ( key, option->value.charc ) == TRUE ) {
option->source = CONFIG_CMDLINE;
}
break;
@ -314,7 +314,7 @@ void config_parse_cmd_options ( void )
}
for ( unsigned int i = 0; i < num_extra_options; ++i ) {
XrmOption *op = &( extra_options[i] );
config_parse_cmd_option ( op );
config_parse_cmd_option ( op );
}
@ -327,29 +327,29 @@ void config_parse_cmd_options ( void )
/** TODO: This is a hack, and should be fixed in a nicer way. */
char **tokens = g_strsplit(stored_argv[in], "-", 3);
int count = 1;
for ( int j = 1; tokens && tokens[j]; j++ ){
for ( int j = 1; tokens && tokens[j]; j++ ) {
count++;
}
if ( count > 2 && g_strcmp0(tokens[1], "no") != 0 ){
if ( count > 2 && g_strcmp0(tokens[1], "no") != 0 ) {
GString *str = g_string_new("configuration { ");
for ( int j = 1; j < (count-1); j++ ){
for ( int j = 1; j < (count-1); j++ ) {
g_string_append_printf(str, "%s { ", tokens[j]);
}
g_string_append_printf ( str, "%s: %s;", tokens[count-1], stored_argv[in+1]);
for ( int j = 0; j < (count-1); j++ ){
for ( int j = 0; j < (count-1); j++ ) {
g_string_append(str, " } ");
}
if ( rofi_theme_parse_string(str->str) == 1 ) {
/** Failed to parse, try again as string. */
rofi_clear_error_messages();
g_string_assign ( str, "configuration { ");
for ( int j = 1; j < (count-1); j++ ){
for ( int j = 1; j < (count-1); j++ ) {
g_string_append_printf(str, "%s { ", tokens[j]);
}
char *esc = g_strescape(stored_argv[in+1], NULL);
g_string_append_printf ( str, "%s: \"%s\";", tokens[count-1], esc);
g_free(esc);
for ( int j = 0; j < (count-1); j++ ){
for ( int j = 0; j < (count-1); j++ ) {
g_string_append(str, " } ");
}
if ( rofi_theme_parse_string(str->str) == 1 ) {
@ -364,7 +364,7 @@ void config_parse_cmd_options ( void )
}
}
static gboolean __config_parser_set_property ( XrmOption *option, const Property *p, char **error )
static gboolean __config_parser_set_property ( XrmOption *option, const Property *p, char **error )
{
if ( option->type == xrm_String ) {
if ( p->type != P_STRING && p->type != P_LIST ) {
@ -455,7 +455,7 @@ gboolean config_parse_set_property ( const Property *p, char **error )
*error = g_strdup_printf ( "Option: %s is not found.", p->name );
for ( GList *iter = g_list_first ( extra_parsed_options) ; iter != NULL; iter = g_list_next ( iter ) ) {
if ( g_strcmp0(((Property *)(iter->data))->name, p->name ) == 0 ){
if ( g_strcmp0(((Property *)(iter->data))->name, p->name ) == 0 ) {
rofi_theme_property_free ( (Property *)(iter->data));
iter->data = (void *)rofi_theme_property_copy ( p ) ;
return TRUE;

View File

@ -49,7 +49,7 @@ unsigned int test =0;
#define TASSERTE( a, b ) { \
if ( ( a ) == ( b ) ) { \
printf ( "Test %u passed (%s == %s) (%d == %d)\n", ++test, # a, # b, a, b ); \
}else { \
} else { \
printf ( "Test %u failed (%s == %s) (%d != %d)\n", ++test, # a, # b, a, b ); \
abort ( ); \
} \
@ -58,7 +58,7 @@ unsigned int test =0;
#define TASSERTW( a, b ) { \
if ( ( a ) == ( b ) ) { \
printf ( "Test %u passed (%s == %s) (%p == %p)\n", ++test, # a, # b, (void *)a, (void *)b ); \
}else { \
} else { \
printf ( "Test %u failed (%s == %s) (%p != %p)\n", ++test, # a, # b, (void *)a, (void *)b ); \
abort ( ); \
} \
@ -79,7 +79,6 @@ cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
return NULL;
}
int monitor_active ( G_GNUC_UNUSED workarea *mon )
{
return 0;
@ -116,7 +115,6 @@ void rofi_view_get_current_monitor ( G_GNUC_UNUSED int *width, G_GNUC_UNUSED int
}
int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
{
{

View File

@ -2,14 +2,14 @@
TOP_DIR=$1
xrdb -retain -load ${TOP_DIR}/doc/old-theme-convert-input.theme
rofi -config ${TOP_DIR}/doc/old-theme-convert-input.theme -dump-theme | grep -v "Rofi version" > temp.txt
xrdb -retain -load "${TOP_DIR}/doc/old-theme-convert-input.theme"
rofi -config "${TOP_DIR}/doc/old-theme-convert-input.theme" -dump-theme | grep -v "Rofi version" > temp.txt
if ! diff temp.txt ${TOP_DIR}/doc/old-theme-convert-output.rasi > /dev/null
if ! diff temp.txt "${TOP_DIR}/doc/old-theme-convert-output.rasi" >/dev/null
then
echo "Convert default theme failed"
diff temp.txt ${TOP_DIR}/doc/old-theme-convert-output.rasi
exit 1;
diff temp.txt "${TOP_DIR}/doc/old-theme-convert-output.rasi"
exit 1
fi
exit ${RETV}
exit "${RETV}"

View File

@ -2,13 +2,13 @@
TOP_DIR=$1
rofi -no-config -dump-theme | grep -v "Rofi version" > temp.txt
rofi -no-config -dump-theme | grep -v "Rofi version" > temp.txt
if ! diff temp.txt ${TOP_DIR}/doc/default_theme.rasi > /dev/null
if ! diff temp.txt "${TOP_DIR}/doc/default_theme.rasi" >/dev/null
then
echo "Dump default theme does not match."
diff temp.txt ${TOP_DIR}/doc/default_theme.rasi
exit 1;
diff temp.txt "${TOP_DIR}/doc/default_theme.rasi"
exit 1
fi
exit ${RETV}
exit "${RETV}"

View File

@ -2,13 +2,13 @@
TOP_DIR=$1
rofi -h -config ${TOP_DIR}/doc/test_xr.txt | awk 'BEGIN{ found=1} /^Global options:/{found=0} {if (found) print }' > help-output.txt
rofi -h -config "${TOP_DIR}/doc/test_xr.txt" | awk 'BEGIN{ found=1} /^Global options:/{found=0} {if (found) print }' > help-output.txt
if ! diff help-output.txt ${TOP_DIR}/doc/help-output.txt > /dev/null
if ! diff help-output.txt "${TOP_DIR}/doc/help-output.txt" >/dev/null
then
diff help-output.txt ${TOP_DIR}/doc/help-output.txt
diff help-output.txt "${TOP_DIR}/doc/help-output.txt"
echo "Help output does not match."
exit 1;
exit 1
fi
exit ${RETV}
exit "${RETV}"

View File

@ -49,7 +49,7 @@ static int test = 0;
#define TASSERTE( a, b ) { \
if ( ( a ) == ( b ) ) { \
printf ( "Test %i passed (%s == %s) (%u == %u)\n", ++test, # a, # b, a, b ); \
}else { \
} else { \
printf ( "Test %i failed (%s == %s) (%u != %u)\n", ++test, # a, # b, a, b ); \
abort ( ); \
} \
@ -73,13 +73,12 @@ void rofi_clear_error_messages (void )
{
}
gboolean rofi_theme_parse_string ( const char *string )
{
return FALSE;
}
double textbox_get_estimated_char_height ( void )
double textbox_get_estimated_char_height ( void )
{
return 12.0;
}
@ -110,7 +109,7 @@ void display_startup_notification ( G_GNUC_UNUSED RofiHelperExecuteContext *cont
{
}
int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv )
int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
{
if ( setlocale ( LC_ALL, "" ) == NULL ) {
@ -137,12 +136,12 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv )
TASSERT ( strcmp ( list[9], "4" ) == 0 );
cmd_set_arguments ( llength, list);
TASSERT( find_arg ( "-e") == 2 );
TASSERT( find_arg ( "-x") == -1 );
TASSERT ( find_arg ( "-e") == 2 );
TASSERT ( find_arg ( "-x") == -1 );
char *str;
TASSERT( find_arg_str ( "-e", &str) == TRUE );
TASSERT ( find_arg_str ( "-e", &str) == TRUE );
TASSERT ( str == list[3] );
TASSERT( find_arg_str ( "-x", &str) == FALSE );
TASSERT ( find_arg_str ( "-x", &str) == FALSE );
// Should be unmodified.
TASSERT ( str == list[3] );

View File

@ -50,7 +50,7 @@ static int test = 0;
#define TASSERTE( a, b ) { \
if ( ( a ) == ( b ) ) { \
printf ( "Test %i passed (%s == %s) (%u == %u)\n", ++test, # a, # b, a, b ); \
}else { \
} else { \
printf ( "Test %i failed (%s == %s) (%u != %u)\n", ++test, # a, # b, a, b ); \
abort ( ); \
} \
@ -71,7 +71,7 @@ cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
return NULL;
}
double textbox_get_estimated_char_height ( void )
double textbox_get_estimated_char_height ( void )
{
return 12.0;
}
@ -108,7 +108,7 @@ void display_startup_notification ( G_GNUC_UNUSED RofiHelperExecuteContext *cont
{
}
int main ( int argc, char ** argv )
int main ( int argc, char **argv )
{
cmd_set_arguments ( argc, argv );

View File

@ -71,7 +71,7 @@ gboolean rofi_theme_parse_string ( const char *string )
{
return FALSE;
}
double textbox_get_estimated_char_height ( void )
double textbox_get_estimated_char_height ( void )
{
return 12.0;
}
@ -101,7 +101,7 @@ void display_startup_notification ( G_GNUC_UNUSED RofiHelperExecuteContext *cont
{
}
int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv )
int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
{
if ( setlocale ( LC_ALL, "" ) == NULL ) {
fprintf ( stderr, "Failed to set locale.\n" );
@ -113,15 +113,15 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv )
{
const char *tmpd = g_get_tmp_dir ();
char *path = g_build_filename (tmpd, "rofi-pid.pid", NULL);
TASSERT( create_pid_file ( NULL ) == -1 );
TASSERT ( create_pid_file ( NULL ) == -1 );
int fd = create_pid_file ( path );
TASSERT( fd >= 0 );
TASSERT ( fd >= 0 );
int fd2 = create_pid_file ( path );
TASSERT ( fd2 < 0 );
remove_pid_file ( fd );
fd = create_pid_file ( path );
TASSERT( fd >= 0 );
TASSERT ( fd >= 0 );
remove_pid_file ( fd );
free ( path );
}

View File

@ -49,7 +49,7 @@ static int test = 0;
#define TASSERTE( a, b ) { \
if ( ( a ) == ( b ) ) { \
printf ( "Test %i passed (%s == %s) (%u == %u)\n", ++test, # a, # b, a, b ); \
}else { \
} else { \
printf ( "Test %i failed (%s == %s) (%u != %u)\n", ++test, # a, # b, a, b ); \
abort ( ); \
} \
@ -57,7 +57,7 @@ static int test = 0;
#define TASSERTL( a, b ) { \
if ( ( a ) == ( b ) ) { \
printf ( "Test %i passed (%s == %s) (%d == %d)\n", ++test, # a, # b, a, b ); \
}else { \
} else { \
printf ( "Test %i failed (%s == %s) (%d != %d)\n", ++test, # a, # b, a, b ); \
abort ( ); \
} \
@ -87,7 +87,7 @@ cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
return NULL;
}
double textbox_get_estimated_char_height ( void )
double textbox_get_estimated_char_height ( void )
{
return 12.0;
}
@ -120,7 +120,7 @@ void display_startup_notification ( G_GNUC_UNUSED RofiHelperExecuteContext *cont
{
}
int main ( int argc, char ** argv )
int main ( int argc, char **argv )
{
cmd_set_arguments ( argc, argv );

View File

@ -66,7 +66,7 @@ gboolean rofi_theme_parse_string ( G_GNUC_UNUSED const char *string )
return FALSE;
}
double textbox_get_estimated_char_height ( void )
double textbox_get_estimated_char_height ( void )
{
return 12.0;
}
@ -485,7 +485,7 @@ static Suite * helper_tokenizer_suite (void)
return s;
}
int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv )
int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
{
if ( setlocale ( LC_ALL, "" ) == NULL ) {
fprintf ( stderr, "Failed to set locale.\n" );

View File

@ -117,7 +117,7 @@ static void history_test ( void )
unlink ( file );
}
int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
{
history_test ();

View File

@ -69,7 +69,7 @@ gboolean rofi_theme_parse_string ( const char *string )
return FALSE;
}
double textbox_get_estimated_char_height ( void )
double textbox_get_estimated_char_height ( void )
{
return 16.0;
}
@ -125,7 +125,7 @@ static void test_mode_setup ( void )
{
ck_assert_int_eq ( mode_init ( &help_keys_mode ), TRUE);
}
static void test_mode_teardown (void )
static void test_mode_teardown ( void )
{
mode_destroy ( &help_keys_mode );
}
@ -147,7 +147,7 @@ START_TEST(test_mode_num_items)
{
unsigned int rows = mode_get_num_entries ( &help_keys_mode);
ck_assert_int_eq ( rows, 74);
for ( unsigned int i =0; i < rows; i++ ){
for ( unsigned int i =0; i < rows; i++ ) {
int state = 0;
GList *list = NULL;
char *v = mode_get_display_value ( &help_keys_mode, i, &state, &list, TRUE );
@ -221,7 +221,6 @@ static Suite * mode_suite (void)
return s;
}
int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
{
setup_abe ();

View File

@ -23,7 +23,7 @@ tests=(
run_window_test
)
cd ${MESON_BUILD_ROOT}
cd -- "${MESON_BUILD_ROOT}"
mkdir -p test-x-logs
rm -f core
display=200
@ -36,11 +36,11 @@ for test in "${tests[@]}"; do
echo "COREDUMP"
echo "bt" | gdb ./rofi core
more ${log_prefix}*.log | cat
exit ${ret}
exit "${ret}"
elif [[ ${ret} != 0 ]]; then
echo "FAIL"
more ${log_prefix}*.log | cat
exit ${ret}
exit "${ret}"
fi
echo "PASS"
display=$(( display + 1 ))

View File

@ -4,8 +4,8 @@ rofi -show combi -modi combi -combi-modi run,drun &
RPID=$!
# send enter.
sleep 5;
xdotool key 't'
sleep 5
xdotool key 't'
sleep 0.4
xdotool key 'r'
sleep 0.4
@ -15,8 +15,8 @@ xdotool key 'e'
sleep 0.4
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
exit ${RETV}
exit "${RETV}"

View File

@ -1,14 +1,14 @@
#!/usr/bin/env bash
rofi -dmenu & < /dev/null
rofi -dmenu & </dev/null
RPID=$!
sleep 4
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
if [ ${RETV} -eq 0 ]
if [ "${RETV}" -eq 0 ]
then
exit 0
else

View File

@ -1,13 +1,13 @@
#!/usr/bin/env bash
# wait till it is up, run rofi with error message
sleep 1;
echo {0..100} | tr " " "\n" | rofi -dmenu -multi-select > output.txt &
sleep 1
echo {0..100} | tr " " "\n" | rofi -dmenu -multi-select > output.txt &
RPID=$!
# send enter.
sleep 5;
xdotool key '2'
sleep 5
xdotool key '2'
sleep 0.4
xdotool key Shift+Return
#2
@ -35,8 +35,8 @@ xdotool key Shift+Return
#32
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
OUTPUT=$(tr '\n' ' ' < output.txt)
if [ "${OUTPUT}" != '2 12 20 21 22 23 24 25 26 27 28 29 ' ]
@ -44,5 +44,5 @@ then
echo "Got: '${OUTPUT}' expected '2 12 20 21 22 23 24 25 26 27 28 29 '"
exit 1
fi
echo ${RETV}
exit ${RETV}
echo "${RETV}"
exit "${RETV}"

View File

@ -1,23 +1,23 @@
#!/usr/bin/env bash
# wait till it is up, run rofi with error message
sleep 1;
sleep 1
ulimit -c unlimited
echo -e -n "aap\nnoot\nmies" | rofi -dmenu -normal-window -multi-select > output.txt &
echo -e -n "aap\nnoot\nmies" | rofi -dmenu -normal-window -multi-select > output.txt &
RPID=$!
sleep 4
xdotool getactivewindow windowsize 100% 100%
echo "Window resized"
# send enter.
sleep 1
xdotool key 'Down'
xdotool key 'Down'
sleep 0.4
xdotool key Shift+Return
xdotool key Shift+Return
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
if [ "${RETV}" == "139" ]
then
@ -30,5 +30,5 @@ then
echo "Got: '${OUTPUT}' expected 'noot mies '"
exit 1
fi
echo ${RETV}
exit ${RETV}
echo "${RETV}"
exit "${RETV}"

View File

@ -1,20 +1,20 @@
#!/usr/bin/env bash
# wait till it is up, run rofi with error message
sleep 1;
echo -e -n "aap\nnoot\nmies" | rofi -dmenu -multi-select > output.txt &
sleep 1
echo -e -n "aap\nnoot\nmies" | rofi -dmenu -multi-select > output.txt &
RPID=$!
# send enter.
sleep 5;
xdotool key 'Down'
sleep 5
xdotool key 'Down'
sleep 0.4
xdotool key Shift+Return
xdotool key Shift+Return
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
OUTPUT=$( tr '\n' ' ' < output.txt )
if [ "${OUTPUT}" != 'noot mies ' ]
@ -22,5 +22,5 @@ then
echo "Got: '${OUTPUT}' expected 'noot mies '"
exit 1
fi
echo ${RETV}
exit ${RETV}
echo "${RETV}"
exit "${RETV}"

View File

@ -1,11 +1,11 @@
#!/usr/bin/env bash
rofi -show drun -modi drun &
rofi -show drun -modi drun &
RPID=$!
# send enter.
sleep 5;
xdotool key 't'
sleep 5
xdotool key 't'
sleep 0.4
xdotool key 'r'
sleep 0.4
@ -15,8 +15,8 @@ xdotool key 'e'
sleep 0.4
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
exit ${RETV}
exit "${RETV}"

View File

@ -1,13 +1,13 @@
#!/usr/bin/env bash
# wait till it is up, run rofi with error message
sleep 1 && rofi -e "Printing error message" &
sleep 1 && rofi -e "Printing error message" &
RPID=$!
# send enter.
sleep 5 && xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
exit ${RETV}
exit "${RETV}"

View File

@ -1,10 +1,10 @@
#!/usr/bin/env bash
echo -en "nooty\naap\nnoot\nmies" | rofi -matching glob -dmenu > output.txt &
echo -en "nooty\naap\nnoot\nmies" | rofi -matching glob -dmenu > output.txt &
RPID=$!
# send enter.
sleep 5;
sleep 5
xdotool key 'n'
sleep 0.4
xdotool key Shift+'8'
@ -13,8 +13,8 @@ xdotool key 't'
sleep 0.4
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
OUTPUT=$(cat output.txt)
if [ "${OUTPUT}" != 'nooty' ]
@ -23,4 +23,4 @@ then
exit 1
fi
exit ${RETV}
exit "${RETV}"

View File

@ -2,13 +2,13 @@
# wait till it is up, run rofi with error message
rm -f output.txt
sleep 1;
sleep 1
echo -e -n "aap\nnoot\nmies" | rofi -dmenu -no-custom -kb-custom-1 F5 -kb-move-front "" -kb-custom-2 "Control+a" > output.txt &
RPID=$!
# send enter.
sleep 5;
xdotool key 'q'
sleep 5
xdotool key 'q'
sleep 0.4
xdotool key Return
sleep 0.4
@ -18,8 +18,8 @@ xdotool key "Control+a"
sleep 0.4
xdotool key Escape
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
OUTPUT=$(tr '\n' ' ' < output.txt)
if [ "${OUTPUT}" != '' ]
@ -27,7 +27,7 @@ then
echo "Got: '${OUTPUT}' expected nothing"
exit 1
fi
if [ ${RETV} != 1 ]
if [ "${RETV}" != 1 ]
then
exit 1
exit 1
fi

View File

@ -4,8 +4,8 @@ rofi -show window -modi window &
RPID=$!
# send enter.
sleep 5;
xdotool key 't'
sleep 5
xdotool key 't'
sleep 0.4
xdotool key 'r'
sleep 0.4
@ -15,8 +15,8 @@ xdotool key 'e'
sleep 0.4
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
exit ${RETV}
exit "${RETV}"

View File

@ -4,8 +4,8 @@ echo -e "aap\nnoot\nmies" | rofi -dmenu &
RPID=$!
# send enter.
sleep 5;
xdotool key 't'
sleep 5
xdotool key 't'
sleep 0.4
xdotool key 'r'
sleep 0.4
@ -13,12 +13,12 @@ xdotool key 'u'
sleep 0.4
xdotool key 'e'
sleep 0.4
xdotool key End
xdotool key End
sleep 0.4
xdotool key Return
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
exit ${RETV}
exit "${RETV}"

View File

@ -1,11 +1,11 @@
#!/usr/bin/env bash
echo -en "nooty\naap\nnoot\nmies" | rofi -matching regex -dmenu > output.txt &
echo -en "nooty\naap\nnoot\nmies" | rofi -matching regex -dmenu > output.txt &
RPID=$!
# send enter.
sleep 5;
xdotool key Shift+'6'
sleep 5
xdotool key Shift+'6'
sleep 0.4
xdotool key 'n'
sleep 0.4
@ -19,8 +19,8 @@ xdotool key Shift+'4'
sleep 0.4
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
OUTPUT=$(cat output.txt)
if [ "${OUTPUT}" != 'noot' ]
@ -29,4 +29,4 @@ then
exit 1
fi
exit ${RETV}
exit "${RETV}"

View File

@ -1,11 +1,11 @@
#!/usr/bin/env bash
rofi -show run &
rofi -show run &
RPID=$!
# send enter.
sleep 5;
xdotool key 't'
sleep 5
xdotool key 't'
sleep 0.4
xdotool key 'r'
sleep 0.4
@ -15,8 +15,8 @@ xdotool key 'e'
sleep 0.4
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
exit ${RETV}
exit "${RETV}"

View File

@ -1,12 +1,12 @@
#!/usr/bin/env bash
export ROFI_PNG_OUTPUT=out.png
rofi -show run &
rofi -show run &
RPID=$!
# send enter.
sleep 5;
xdotool key 't'
sleep 5
xdotool key 't'
sleep 0.4
xdotool key 'r'
sleep 0.4
@ -16,8 +16,8 @@ xdotool key Alt+Shift+s
sleep 0.4
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
if [ ! -f out.png ]
@ -25,4 +25,4 @@ then
echo "Failed to create screenshot"
exit 1
fi
exit ${RETV}
exit "${RETV}"

View File

@ -4,23 +4,23 @@ SP=$(readlink -f "$0")
DIR=$(dirname "$SP")
echo "$DIR/test_script.sh"
# wait till it is up, run rofi with error message
sleep 1;
sleep 1
rofi -modi "custom:$DIR/test_script.sh" -show custom &
RPID=$!
# send enter.
sleep 5;
sleep 5
xdotool key 'z'
sleep 0.4
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
OUTPUT=$( tr '\n' ' ' < output.txt )
echo ${OUTPUT}
echo "${OUTPUT}"
if [ "${OUTPUT}" != 'mies ' ]
then
exit 1
fi
exit ${RETV}
exit "${RETV}"

View File

@ -4,23 +4,23 @@ SP=$(readlink -f "$0")
DIR=$(dirname "$SP")
echo "$DIR/test_script.sh"
# wait till it is up, run rofi with error message
sleep 1;
rofi -modi "custom:$DIR/test_script.sh" -show custom &
sleep 1
rofi -modi "custom:$DIR/test_script.sh" -show custom &
RPID=$!
# send enter.
sleep 5;
xdotool key 'Down'
sleep 5
xdotool key 'Down'
sleep 0.4
xdotool key Return
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
OUTPUT=$( tr '\n' ' ' < output.txt )
echo ${OUTPUT}
echo "${OUTPUT}"
if [ "${OUTPUT}" != 'noot ' ]
then
exit 1
fi
exit ${RETV}
exit "${RETV}"

View File

@ -1,12 +1,12 @@
#!/usr/bin/env bash
# wait till it is up, run rofi with error message
sleep 1 && rofi -show run -modi run &
sleep 1 && rofi -show run -modi run &
RPID=$!
# send enter.
sleep 5;
xdotool key 'shift+slash'
sleep 5
xdotool key 'shift+slash'
sleep 0.4
xdotool key 'shift+slash'
sleep 0.4
@ -14,10 +14,10 @@ xdotool key 'shift+slash'
sleep 0.4
xdotool key Escape
# Get result, kill xvfb
wait ${RPID}
# Get result, kill xvfb
wait "${RPID}"
RETV=$?
sleep 1
exit ${RETV}
exit "${RETV}"

Some files were not shown because too many files have changed in this diff Show More