mirror of https://github.com/davatorium/rofi.git
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:
parent
1000b5c3cd
commit
f1418084aa
|
@ -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.
|
||||
|
|
7
AUTHORS
7
AUTHORS
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
echo -e "${WORKSPACES}" ) | sort -n | uniq -u | head -n 1)
|
||||
|
||||
i3-msg workspace ${EMPTY_WORKSPACE}
|
||||
i3-msg workspace "${EMPTY_WORKSPACE}"
|
||||
|
|
|
@ -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}" ]
|
||||
|
|
|
@ -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
|
||||
|
@ -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}"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [ x"$@" = x"quit" ]
|
||||
if [ "$@" = "quit" ]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
|
13
Makefile.am
13
Makefile.am
|
@ -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\
|
||||
|
@ -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,7 +526,6 @@ 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)
|
||||
|
@ -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/
|
||||
|
||||
|
|
|
@ -82,4 +82,3 @@ align_typedef_gap = 3
|
|||
|
||||
eat_blanks_before_close_brace = TRUE
|
||||
eat_blanks_after_open_brace = TRUE
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -13,5 +13,4 @@ configuration {
|
|||
sorting-method: "name";
|
||||
directories-first: true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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`
|
||||
|
||||
|
|
|
@ -47,4 +47,3 @@ Dave Davenport and contributors
|
|||
|
||||
Copied script from i3:
|
||||
Michael Stapelberg and contributors
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -196,7 +196,6 @@ typedef enum
|
|||
ROFI_SCALE_WIDTH,
|
||||
} RofiScaleType;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
RofiImageType type;
|
||||
|
|
|
@ -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" \
|
||||
|
|
|
@ -92,7 +92,6 @@ extern ThemeWidget *rofi_theme;
|
|||
*/
|
||||
extern ThemeWidget *rofi_theme;
|
||||
|
||||
|
||||
extern ThemeWidget *rofi_configuration;
|
||||
|
||||
/**
|
||||
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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,7 +663,7 @@ 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 );
|
||||
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -617,7 +618,6 @@ t_color_list
|
|||
;
|
||||
|
||||
|
||||
|
||||
/** List of elements */
|
||||
t_property_element_list_optional
|
||||
: %empty { $$ = NULL; }
|
||||
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
- Parse subdirectories in drun parser (#416)
|
||||
- Switch to stop cycling (#407)
|
||||
|
||||
##Bug fixes
|
||||
## Bug fixes
|
||||
|
||||
- Grab mouse pointer with keyboard
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
@ -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.
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# 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}
|
||||
|
|
|
@ -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;
|
||||
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
|
||||
|
|
|
@ -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 )&
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
# 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}
|
||||
|
@ -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[@]}
|
||||
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"
|
||||
|
@ -148,13 +146,13 @@ Current theme: <b>${CUR}</b>"""
|
|||
fi
|
||||
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
|
||||
|
@ -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}"
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 ) {
|
||||
|
@ -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,7 +1159,8 @@ 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 ) {
|
||||
switch ( rmpd->entry_list[selected_line].type )
|
||||
|
@ -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,7 +1326,7 @@ 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;
|
||||
|
@ -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,7 +1400,7 @@ 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;
|
||||
|
|
|
@ -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);
|
||||
|
@ -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,16 +436,18 @@ 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 {
|
||||
}
|
||||
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,7 +479,8 @@ 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 ) {
|
||||
rmpd->selected_line = selected_line;
|
||||
|
@ -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 );
|
||||
|
@ -517,7 +520,7 @@ static char *run_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->cmd_list[pd->selected_line].entry, msg);
|
||||
g_free (msg);
|
||||
return retv;
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ const char * const PropertyTypeName[P_NUM_TYPES] = {
|
|||
/** Color */
|
||||
"Color",
|
||||
/** Image */
|
||||
"Iamge",
|
||||
"Image",
|
||||
/** Padding */
|
||||
"Padding",
|
||||
/** Link to global setting */
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
|
@ -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 ) )
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
@ -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 ) {
|
||||
|
@ -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;
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
{
|
||||
|
|
|
@ -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}"
|
||||
|
|
|
@ -4,11 +4,11 @@ TOP_DIR=$1
|
|||
|
||||
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}"
|
||||
|
|
|
@ -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}"
|
||||
|
|
|
@ -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,7 +73,6 @@ void rofi_clear_error_messages (void )
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
gboolean rofi_theme_parse_string ( const char *string )
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -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] );
|
||||
|
||||
|
|
|
@ -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 ( ); \
|
||||
} \
|
||||
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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 ( ); \
|
||||
} \
|
||||
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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" );
|
||||
|
|
|
@ -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 ();
|
||||
|
|
|
@ -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 ))
|
||||
|
|
|
@ -4,7 +4,7 @@ rofi -show combi -modi combi -combi-modi run,drun &
|
|||
RPID=$!
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
sleep 5
|
||||
xdotool key 't'
|
||||
sleep 0.4
|
||||
xdotool key 'r'
|
||||
|
@ -16,7 +16,7 @@ sleep 0.4
|
|||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -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}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
|
||||
if [ ${RETV} -eq 0 ]
|
||||
if [ "${RETV}" -eq 0 ]
|
||||
then
|
||||
exit 0
|
||||
else
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# wait till it is up, run rofi with error message
|
||||
sleep 1;
|
||||
sleep 1
|
||||
echo {0..100} | tr " " "\n" | rofi -dmenu -multi-select > output.txt &
|
||||
RPID=$!
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
sleep 5
|
||||
xdotool key '2'
|
||||
sleep 0.4
|
||||
xdotool key Shift+Return
|
||||
|
@ -36,7 +36,7 @@ xdotool key Shift+Return
|
|||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
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}"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/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 &
|
||||
RPID=$!
|
||||
|
@ -17,7 +17,7 @@ xdotool key Shift+Return
|
|||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
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}"
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# wait till it is up, run rofi with error message
|
||||
sleep 1;
|
||||
sleep 1
|
||||
echo -e -n "aap\nnoot\nmies" | rofi -dmenu -multi-select > output.txt &
|
||||
RPID=$!
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
sleep 5
|
||||
xdotool key 'Down'
|
||||
sleep 0.4
|
||||
xdotool key Shift+Return
|
||||
|
@ -14,7 +14,7 @@ xdotool key Shift+Return
|
|||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
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}"
|
||||
|
|
|
@ -4,7 +4,7 @@ rofi -show drun -modi drun &
|
|||
RPID=$!
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
sleep 5
|
||||
xdotool key 't'
|
||||
sleep 0.4
|
||||
xdotool key 'r'
|
||||
|
@ -16,7 +16,7 @@ sleep 0.4
|
|||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -8,6 +8,6 @@ RPID=$!
|
|||
sleep 5 && xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -4,7 +4,7 @@ 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'
|
||||
|
@ -14,7 +14,7 @@ sleep 0.4
|
|||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
OUTPUT=$(cat output.txt)
|
||||
if [ "${OUTPUT}" != 'nooty' ]
|
||||
|
@ -23,4 +23,4 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
# 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;
|
||||
sleep 5
|
||||
xdotool key 'q'
|
||||
sleep 0.4
|
||||
xdotool key Return
|
||||
|
@ -19,7 +19,7 @@ sleep 0.4
|
|||
xdotool key Escape
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
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
|
||||
fi
|
||||
|
|
|
@ -4,7 +4,7 @@ rofi -show window -modi window &
|
|||
RPID=$!
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
sleep 5
|
||||
xdotool key 't'
|
||||
sleep 0.4
|
||||
xdotool key 'r'
|
||||
|
@ -16,7 +16,7 @@ sleep 0.4
|
|||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -4,7 +4,7 @@ echo -e "aap\nnoot\nmies" | rofi -dmenu &
|
|||
RPID=$!
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
sleep 5
|
||||
xdotool key 't'
|
||||
sleep 0.4
|
||||
xdotool key 'r'
|
||||
|
@ -18,7 +18,7 @@ sleep 0.4
|
|||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -4,7 +4,7 @@ echo -en "nooty\naap\nnoot\nmies" | rofi -matching regex -dmenu > output.txt
|
|||
RPID=$!
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
sleep 5
|
||||
xdotool key Shift+'6'
|
||||
sleep 0.4
|
||||
xdotool key 'n'
|
||||
|
@ -20,7 +20,7 @@ sleep 0.4
|
|||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
OUTPUT=$(cat output.txt)
|
||||
if [ "${OUTPUT}" != 'noot' ]
|
||||
|
@ -29,4 +29,4 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -4,7 +4,7 @@ rofi -show run &
|
|||
RPID=$!
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
sleep 5
|
||||
xdotool key 't'
|
||||
sleep 0.4
|
||||
xdotool key 'r'
|
||||
|
@ -16,7 +16,7 @@ sleep 0.4
|
|||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -5,7 +5,7 @@ rofi -show run &
|
|||
RPID=$!
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
sleep 5
|
||||
xdotool key 't'
|
||||
sleep 0.4
|
||||
xdotool key 'r'
|
||||
|
@ -17,7 +17,7 @@ sleep 0.4
|
|||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
|
||||
if [ ! -f out.png ]
|
||||
|
@ -25,4 +25,4 @@ then
|
|||
echo "Failed to create screenshot"
|
||||
exit 1
|
||||
fi
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -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}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
OUTPUT=$( tr '\n' ' ' < output.txt )
|
||||
echo ${OUTPUT}
|
||||
echo "${OUTPUT}"
|
||||
if [ "${OUTPUT}" != 'mies ' ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -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 'Down'
|
||||
sleep 0.4
|
||||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
OUTPUT=$( tr '\n' ' ' < output.txt )
|
||||
echo ${OUTPUT}
|
||||
echo "${OUTPUT}"
|
||||
if [ "${OUTPUT}" != 'noot ' ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -5,7 +5,7 @@ sleep 1 && rofi -show run -modi run &
|
|||
RPID=$!
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
sleep 5
|
||||
xdotool key 'shift+slash'
|
||||
sleep 0.4
|
||||
xdotool key 'shift+slash'
|
||||
|
@ -15,9 +15,9 @@ sleep 0.4
|
|||
xdotool key Escape
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
|
||||
sleep 1
|
||||
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
XPID=
|
||||
FPID=
|
||||
function create_fake_x ( )
|
||||
create_fake_x()
|
||||
{
|
||||
export DISPLAY=":$1"
|
||||
echo -n "Starting fake X for display ${DISPLAY}: "
|
||||
Xvfb -nolisten tcp +extension XINERAMA +xinerama -screen 0 1280x1024x24 ${DISPLAY} &>$2-server.log &
|
||||
Xvfb -nolisten tcp +extension XINERAMA +xinerama -screen 0 1280x1024x24 "${DISPLAY}" &>$2-server.log &
|
||||
XPID=$!
|
||||
echo "pid ${XPID}"
|
||||
sleep 1;
|
||||
sleep 1
|
||||
if [ -x "$(which fluxbox 2>/dev/null)" ]; then
|
||||
echo -n "Starting fluxbox for display ${DISPLAY}: "
|
||||
timeout -k 30s 30s fluxbox &>$2-fluxbox.log &
|
||||
|
@ -19,24 +19,24 @@ function create_fake_x ( )
|
|||
fi
|
||||
}
|
||||
|
||||
function destroy_fake_x ( )
|
||||
destroy_fake_x()
|
||||
{
|
||||
if [ -n "${XPID}" ]
|
||||
then
|
||||
if [ -n "${FPID}" ]; then
|
||||
echo -n "Stopping fluxbox for display ${DISPLAY} (pid ${FPID}): "
|
||||
if kill ${FPID} &>$1-kill-fluxbox.log; then
|
||||
if kill "${FPID}" &>$1-kill-fluxbox.log; then
|
||||
echo -n " killed... "
|
||||
wait ${FPID} &>$1-wait-fluxbox.log
|
||||
wait "${FPID}" &>$1-wait-fluxbox.log
|
||||
echo "stopped"
|
||||
else
|
||||
echo -n " failed to kill"
|
||||
fi
|
||||
fi
|
||||
echo -n "Stopping fake X for display ${DISPLAY} (pid ${XPID}): "
|
||||
if kill ${XPID} &>$1-kill-X.log; then
|
||||
if kill "${XPID}" &>$1-kill-X.log; then
|
||||
echo -n " killed... "
|
||||
wait ${XPID} &>$1-wait-X.log
|
||||
wait "${XPID}" &>$1-wait-X.log
|
||||
echo "stopped"
|
||||
else
|
||||
echo -n " failed to kill"
|
||||
|
@ -55,4 +55,4 @@ RES=$?
|
|||
|
||||
destroy_fake_x "$2"
|
||||
|
||||
exit ${RES}
|
||||
exit "${RES}"
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# wait till it is up, run rofi with error message
|
||||
sleep 1;
|
||||
sleep 1
|
||||
xterm -T MonkeySee sh &
|
||||
XPID=$!
|
||||
echo "Started MonkeySee xterm: pid ${XPID}"
|
||||
sleep 1;
|
||||
sleep 1
|
||||
xterm -T TermUnwanted sh &
|
||||
TPID=$!
|
||||
echo "Started TermUnwanted xterm: pid ${TPID}"
|
||||
sleep 1;
|
||||
sleep 1
|
||||
rofi -modi window -show window > output.txt &
|
||||
RPID=$!
|
||||
echo "Started rofi: pid ${RPID}"
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
sleep 5
|
||||
xdotool type 'MonkeySee'
|
||||
sleep 0.4
|
||||
xdotool key Return
|
||||
sleep 1;
|
||||
sleep 1
|
||||
xdotool key Ctrl+d
|
||||
sleep 1;
|
||||
sleep 1
|
||||
|
||||
echo -n "Killing TermUnwanted: "
|
||||
if kill ${TPID}; then
|
||||
if kill "${TPID}"; then
|
||||
echo "done"
|
||||
wait ${TPID}
|
||||
wait "${TPID}"
|
||||
fi
|
||||
|
||||
if ps -q ${XPID} # pgrep -u $USER xterm
|
||||
if ps -q "${XPID}" # pgrep -u $USER xterm
|
||||
then
|
||||
echo "Found remaining xterms: $(pgrep -u $USER xterm)"
|
||||
kill ${XPID}
|
||||
echo "Found remaining xterms: $(pgrep -u "$USER" xterm)"
|
||||
kill "${XPID}"
|
||||
fi
|
||||
if ps -q ${RPID}
|
||||
if ps -q "${RPID}"
|
||||
then
|
||||
echo "Rofi still running"
|
||||
kill ${RPID}
|
||||
kill "${RPID}"
|
||||
exit 1
|
||||
fi
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
wait "${RPID}"
|
||||
RETV=$?
|
||||
exit ${RETV}
|
||||
exit "${RETV}"
|
||||
|
|
|
@ -51,7 +51,7 @@ unsigned int test =0;
|
|||
#define TASSERTE( a, b ) { \
|
||||
if ( ( a ) == ( b ) ) { \
|
||||
printf ( "Test %u passed (%s == %s) (%u == %u)\n", ++test, # a, # b, a, b ); \
|
||||
}else { \
|
||||
} else { \
|
||||
printf ( "Test %u failed (%s == %s) (%u != %u)\n", ++test, # a, # b, a, b ); \
|
||||
abort ( ); \
|
||||
} \
|
||||
|
|
|
@ -6,5 +6,5 @@ then
|
|||
echo "noot"
|
||||
echo -ne "mies\0meta\x1fzoom\n"
|
||||
else
|
||||
echo $1 > output.txt
|
||||
echo "$1" > output.txt
|
||||
fi
|
||||
|
|
|
@ -53,14 +53,13 @@ unsigned int normal_window_mode = 0;
|
|||
|
||||
#include "view.h"
|
||||
|
||||
|
||||
ThemeWidget *rofi_configuration = NULL;
|
||||
|
||||
uint32_t rofi_icon_fetcher_query ( const char *name, const int size )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
uint32_t rofi_icon_fetcher_query_advanced ( const char *name, const int wsize, const int hsize)
|
||||
uint32_t rofi_icon_fetcher_query_advanced ( const char *name, const int wsize, const int hsize )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -75,7 +74,7 @@ gboolean config_parse_set_property ( G_GNUC_UNUSED const Property *p, G_GNUC_UNU
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void rofi_add_error_message ( G_GNUC_UNUSED GString *msg)
|
||||
void rofi_add_error_message ( G_GNUC_UNUSED GString *msg )
|
||||
{
|
||||
}
|
||||
void rofi_view_queue_redraw ()
|
||||
|
|
|
@ -64,7 +64,6 @@ cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid )
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int rofi_view_error_dialog ( const char *msg, G_GNUC_UNUSED int markup )
|
||||
{
|
||||
fputs ( msg, stderr );
|
||||
|
@ -127,7 +126,6 @@ void rofi_add_error_message ( GString *msg )
|
|||
static void theme_parser_setup ( void )
|
||||
{
|
||||
error = 0;
|
||||
|
||||
}
|
||||
static void theme_parser_teardown ( void )
|
||||
{
|
||||
|
@ -135,7 +133,6 @@ static void theme_parser_teardown ( void )
|
|||
ck_assert_int_eq ( error, 0);
|
||||
rofi_theme_free ( rofi_theme );
|
||||
rofi_theme = NULL;
|
||||
|
||||
}
|
||||
|
||||
START_TEST (test_core_empty_string )
|
||||
|
@ -1097,7 +1094,6 @@ START_TEST ( test_properties_integer)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
|
||||
START_TEST ( test_properties_orientation )
|
||||
{
|
||||
widget wid;
|
||||
|
@ -1238,13 +1234,11 @@ START_TEST ( test_core_properties_error )
|
|||
g_string_free ( error_msg, TRUE);
|
||||
error_msg = NULL;
|
||||
error = 0;
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST ( test_import_error )
|
||||
{
|
||||
|
||||
rofi_theme_parse_string("@import \"/non-existing-file.rasi\"");
|
||||
|
||||
const char *errstr =
|
||||
|
@ -1283,7 +1277,6 @@ START_TEST ( test_prepare_path )
|
|||
}
|
||||
END_TEST
|
||||
|
||||
|
||||
START_TEST(test_properties_types_names)
|
||||
{
|
||||
ck_assert_str_eq ( PropertyTypeName[P_INTEGER], "Integer");
|
||||
|
@ -1297,7 +1290,6 @@ START_TEST(test_properties_types_names)
|
|||
ck_assert_str_eq ( PropertyTypeName[P_HIGHLIGHT], "Highlight");
|
||||
ck_assert_str_eq ( PropertyTypeName[P_LIST], "List");
|
||||
ck_assert_str_eq ( PropertyTypeName[P_ORIENTATION], "Orientation");
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
@ -1455,7 +1447,7 @@ static Suite * theme_parser_suite (void)
|
|||
return s;
|
||||
}
|
||||
|
||||
int main ( int argc, char ** argv )
|
||||
int main ( int argc, char **argv )
|
||||
{
|
||||
cmd_set_arguments ( argc, argv );
|
||||
|
||||
|
@ -1464,7 +1456,6 @@ int main ( int argc, char ** argv )
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
Suite *s;
|
||||
SRunner *sr;
|
||||
|
||||
|
|
|
@ -98,8 +98,8 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
|
|||
widget_move ( wid, 10, 10);
|
||||
// Getter, setter x pos
|
||||
//
|
||||
TASSERT( widget_get_x_pos ( wid ) == 10 );
|
||||
TASSERT( widget_get_y_pos ( wid ) == 10 );
|
||||
TASSERT ( widget_get_x_pos ( wid ) == 10 );
|
||||
TASSERT ( widget_get_y_pos ( wid ) == 10 );
|
||||
|
||||
// Left of box
|
||||
TASSERT ( widget_intersect ( wid, 0, 0) == 0 );
|
||||
|
@ -190,7 +190,6 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
|
|||
TASSERT ( widget_intersect ( wid, 20+30, 20+40) == 0 );
|
||||
TASSERT ( widget_intersect ( wid, 20+30, 20+50) == 0 );
|
||||
|
||||
|
||||
TASSERT ( widget_intersect ( wid, -100, -100) == 0);
|
||||
TASSERT ( widget_intersect ( wid, INT_MIN, INT_MIN) == 0);
|
||||
TASSERT ( widget_intersect ( wid, INT_MAX, INT_MAX) == 0);
|
||||
|
@ -221,6 +220,5 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv )
|
|||
widget_trigger_action ( NULL, 0, 0, 0 );
|
||||
widget_set_trigger_action_handler ( NULL, NULL, NULL );
|
||||
|
||||
|
||||
g_free(wid);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
* User: Qball
|
||||
* Copyright: Dave Davenport
|
||||
*/
|
||||
|
||||
* {
|
||||
selected-normal-foreground: rgba ( 245, 245, 245, 100 % );
|
||||
foreground: rgba ( 0, 43, 54, 100 % );
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
* Copyright: Dave Davenport
|
||||
*/
|
||||
|
||||
/**
|
||||
* User: Qball
|
||||
* Copyright: Dave Davenport
|
||||
*/
|
||||
* {
|
||||
foreground: #ffeedd;
|
||||
backlight: #ccffeedd;
|
||||
|
@ -66,12 +62,10 @@ window {
|
|||
children: [mainbox];
|
||||
orientation: horizontal;
|
||||
}
|
||||
|
||||
mainbox {
|
||||
spacing: 0;
|
||||
children: [ inputbar, message, listview ];
|
||||
}
|
||||
|
||||
message {
|
||||
border-color: @foreground;
|
||||
border: 0px 2px 2px 2px;
|
||||
|
@ -83,7 +77,6 @@ message {
|
|||
font: "Source Code Pro 8";
|
||||
color: @black;
|
||||
}
|
||||
|
||||
inputbar {
|
||||
color: @lightgreen;
|
||||
padding: 11px;
|
||||
|
@ -146,7 +139,6 @@ element selected urgent {
|
|||
element normal normal {
|
||||
|
||||
}
|
||||
|
||||
vertb {
|
||||
expand: false;
|
||||
children: [ dummy0, mode-switcher, dummy1 ];
|
||||
|
@ -154,7 +146,6 @@ vertb {
|
|||
dummy0, dummy1 {
|
||||
expand: true;
|
||||
}
|
||||
|
||||
mode-switcher {
|
||||
expand: false;
|
||||
orientation: vertical;
|
||||
|
@ -177,7 +168,6 @@ button selected normal {
|
|||
background-color: @backlight;
|
||||
border-color: @foreground;
|
||||
}
|
||||
|
||||
error-message {
|
||||
expand: true;
|
||||
background-color: red;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/******************************************************************************
|
||||
/**
|
||||
* ROFI Color theme
|
||||
* User: qball
|
||||
* User: Qball
|
||||
* Copyright: Dave Davenport
|
||||
******************************************************************************/
|
||||
*/
|
||||
|
||||
* {
|
||||
selected-normal-foreground: rgba ( 0, 96, 160, 100 % );
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
* User: Qball
|
||||
* Copyright: Dave Davenport
|
||||
*/
|
||||
|
||||
* {
|
||||
background-color: Black;
|
||||
border-color: White;
|
||||
text-color: White;
|
||||
font: "Times New Roman 12";
|
||||
}
|
||||
|
||||
window {
|
||||
anchor: north;
|
||||
location: north;
|
||||
|
@ -17,23 +17,19 @@ window {
|
|||
padding: 4px;
|
||||
children: [ horibox ];
|
||||
}
|
||||
|
||||
horibox {
|
||||
orientation: horizontal;
|
||||
children: [ prompt, entry, listview ];
|
||||
}
|
||||
|
||||
listview {
|
||||
layout: horizontal;
|
||||
spacing: 5px;
|
||||
lines: 100;
|
||||
}
|
||||
|
||||
entry {
|
||||
expand: false;
|
||||
width: 10em;
|
||||
}
|
||||
|
||||
element {
|
||||
padding: 0px 2px;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* User: Qball
|
||||
* Copyright: Dave Davenport
|
||||
*/
|
||||
|
||||
* {
|
||||
blue: #0000FF;
|
||||
white: #FFFFFF;
|
||||
|
@ -105,7 +106,6 @@ inputbar normal {
|
|||
foreground-color: #002B36FF;
|
||||
background-color: #F5F5F500;
|
||||
}
|
||||
|
||||
mode-switcher {
|
||||
border: 2px;
|
||||
padding: 0.5em 1em;
|
||||
|
@ -124,7 +124,6 @@ textbox-prompt-colon {
|
|||
margin: 0px 0.3em 0em 0em ;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
error-message {
|
||||
border: 2px;
|
||||
padding: 1em;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
/**
|
||||
* User: qball
|
||||
* ROFI Color theme
|
||||
* User: Qball
|
||||
* Copyright: Dave Davenport
|
||||
*/
|
||||
|
||||
* {
|
||||
text-color: #ffeedd;
|
||||
background-color: rgba(0,0,0,0);
|
||||
|
@ -49,7 +51,6 @@ window {
|
|||
border: 0px 2px 0px 0px;
|
||||
text-color: @lightwhite;
|
||||
}
|
||||
|
||||
mode-switcher {
|
||||
border: 2px 0px 0px 0px;
|
||||
background-color: @lightblack;
|
||||
|
@ -100,7 +101,6 @@ element selected urgent {
|
|||
background-color: @lightred;
|
||||
text-color: @dark;
|
||||
}
|
||||
|
||||
error-message {
|
||||
expand: true;
|
||||
background-color: red;
|
||||
|
|
Loading…
Reference in New Issue