summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2015-09-20 11:45:28 +0200
committerQC <qball@gmpclient.org>2015-09-20 11:45:28 +0200
commitfc2d65df0c455c1aa3c3d54a79ea8b5e1727cdf4 (patch)
treede608d9935d7d7cfd6519b3e75acdf032c8458df
parent108c16e0d4a8d576a2655daebc022832f4e647db (diff)
Playing with atom
-rw-r--r--.atom-build.json5
-rw-r--r--.gitignore5
-rw-r--r--Changelog11
-rw-r--r--README.md4
-rw-r--r--config/config.def.c1
-rw-r--r--configure.ac14
-rw-r--r--doc/example.xresources89
-rw-r--r--doc/rofi-manpage.markdown6
-rw-r--r--doc/rofi.18
-rw-r--r--source/keyb.c2
-rw-r--r--source/rofi.c27
-rw-r--r--source/scrollbar.c3
12 files changed, 45 insertions, 130 deletions
diff --git a/.atom-build.json b/.atom-build.json
new file mode 100644
index 00000000..464e43a3
--- /dev/null
+++ b/.atom-build.json
@@ -0,0 +1,5 @@
+{
+ "cmd" : "make -C build/",
+ "name" : "all",
+ "sh" : true
+}
diff --git a/.gitignore b/.gitignore
index aea6d82b..b58eed8d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,8 @@ core
# ignore patches too, the code is either checked in or branch.
*.patch*
+
+doc/*.html
+doc/*.1
+*.unc-backup~
+*.unc-backup.md5~
diff --git a/Changelog b/Changelog
index 9579c399..a20809e7 100644
--- a/Changelog
+++ b/Changelog
@@ -1,8 +1,9 @@
0.15.9: (unreleased)
New feature:
- Support for Startup Notification
+ - Standalone mode in dmenu
Improvements:
- - Keep same line selected.
+ - Keep same line selected
- Cleanup menu code by re-using Switcher
Bug fixes:
@@ -20,7 +21,7 @@
- Fix issue with mouse interaction needing keyboard press to complete.
- Fix -no-custom still allows escape to quit.
- Fix compiler warnings.
- - Fix dmenu mode. (#200)
+ - Fix dmenu mode. (#200)
- Break CMD AI to have dmenu compatibility.
- Fix processing of signals.
@@ -44,7 +45,7 @@
- Also grab Key Release on exit. (#167)
- Fix failing font size estimation code.
New feature:
- - [DMENU] Allow to select line matching pattern from cmdline.(#165)
+ - [DMENU] Allow to select line matching pattern from cmdline.(#165)
- [DMENU] Allow to set filter from cmdline. (#164)
- [DMENU] Allow output to be formatted (string, filter, index, index 1 based)
- [DMENU] Only match input lines mode.
@@ -89,7 +90,7 @@
Cleanup:
- Do not lug argc,argv around everywhere.
-0.15.2:
+0.15.2:
Removed features:
- Remove (broken) hmode
- Old style key binding and mode launcher.
@@ -98,7 +99,7 @@
- Word movement in entry box. (#126)
- PID file to avoid duplicate Rofi.
- Generic keybinding and launching for modi. (#128)
- - Auto select mode (previously called zeltak mode)
+ - Auto select mode (previously called zeltak mode)
Bug fixes:
- Shift left/right movement between modi (#125)
- Document updates (#123,#116,#124,etc.)
diff --git a/README.md b/README.md
index 799bd908..26842d6b 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,7 @@
# A window switcher, run dialog and dmenu replacement
A popup window switcher roughly based on [superswitcher](http://code.google.com/p/superswitcher/),
-requiring only xlib and pango.
-This version started off as a clone of simpleswitcher, the version from [Sean
+requiring only xlib and pango. This version started off as a clone of simpleswitcher, the version from [Sean
Pringle](http://github.com/seanpringle/simpleswitcher). All credit for this great tool should go to him.
Rofi developed extra features, like a run-dialog, ssh-launcher and can act as a drop-in dmenu
replacement, making it a very versatile tool.
@@ -195,4 +194,3 @@ to disable it:
# Installation
Please see the [installation guide](https://davedavenport.github.io/rofi/p08-INSTALL.html) for instruction on how to install *rofi*.
-
diff --git a/config/config.def.c b/config/config.def.c
index 86d0354a..cf402031 100644
--- a/config/config.def.c
+++ b/config/config.def.c
@@ -141,4 +141,3 @@ Settings config = {
/** Hide scrollbar */
.hide_scrollbar = FALSE,
};
-
diff --git a/configure.ac b/configure.ac
index 9c997a37..a94eb514 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,21 +33,15 @@ dnl ---------------------------------------------------------------------
dnl Disable window mode
dnl ---------------------------------------------------------------------
-AC_ARG_ENABLE([windowmode],
- AC_HELP_STRING([--disable-windowmode],[Disable window mode]))
+AC_ARG_ENABLE([windowmode], AC_HELP_STRING([--disable-windowmode],[Disable window mode]))
-AS_IF([ test "x$enable_windowmode" != "xno"], [
-AC_DEFINE([WINDOW_MODE],[1],[Enable the window mode])
-])
+AS_IF([ test "x$enable_windowmode" != "xno"], [AC_DEFINE([WINDOW_MODE],[1],[Enable the window mode])])
##
# I3 check
##
-AC_ARG_ENABLE(i3support,
- [AS_HELP_STRING([--disable-i3support], [Disable check for i3 support])])
-AS_IF([test "x$enable_i3support" != xno && test "x$enable_windowmode" != "xno"],[
- AC_CHECK_HEADERS([i3/ipc.h], [i3_header=yes; break;])
-])
+AC_ARG_ENABLE(i3support, [AS_HELP_STRING([--disable-i3support], [Disable check for i3 support])])
+AS_IF([test "x$enable_i3support" != xno && test "x$enable_windowmode" != "xno"],[AC_CHECK_HEADERS([i3/ipc.h], [i3_header=yes; break;])])
##
# Check dependencies
diff --git a/doc/example.xresources b/doc/example.xresources
deleted file mode 100644
index c839b13d..00000000
--- a/doc/example.xresources
+++ /dev/null
@@ -1,89 +0,0 @@
-rofi.modi: combi
-rofi.opacity: 100
-rofi.width: -135
-rofi.lines: 10
-rofi.columns: 2
-rofi.font: UbuntuMono 12
-rofi.fg: #657b83
-rofi.bg: #fdf6e3
-rofi.color-enabled: true
-rofi.color-normal: argb:33fdf6e3,#002b36,#eee8d5,#586e75,#eee8d5
-rofi.color-urgent: #fdf6e3,#dc322f,#eee8d5,#dc322f,#fdf6e3
-rofi.color-active: #fdf6e3,#268bd2,#eee8d5,#268bd2,#fdf6e3
-rofi.color-window: argb:33fdf6e3,#002b36
-rofi.fg-active: #268BD2
-rofi.fg-urgent: #DC322F
-rofi.hlfg-active: #FDF6E3
-rofi.hlfg-urgent: #FDF6E3
-rofi.bg-active: #FDF6E3
-rofi.bg-urgent: #FDF6E3
-rofi.hlbg-active: #268BD2
-rofi.hlbg-urgent: #DC322F
-rofi.bgalt: #fdf6e3
-rofi.hlfg: #EEE8D5
-rofi.hlbg: #586E75
-rofi.bc: #002B36
-rofi.bw: 2
-rofi.location: 2
-rofi.padding: 2
-rofi.yoffset: -2
-rofi.xoffset: 0
-rofi.fixed-num-lines: true
-rofi.terminal: terminator
-rofi.ssh-client: ssh
-rofi.ssh-command: {terminal} -e '{ssh-client} {host}'
-rofi.run-command: {cmd}
-rofi.run-list-command:
-rofi.run-shell-command: {terminal} -e '{cmd}'
-rofi.disable-history: false
-rofi.levenshtein-sort: false
-rofi.case-sensitive: false
-rofi.sidebar-mode: true
-rofi.lazy-filter-limit: 5000000
-rofi.eh: 1
-rofi.auto-select: false
-rofi.parse-hosts: false
-rofi.combi-modi: window,run,ssh
-rofi.fuzzy: true
-rofi.pid: /run/user/1000/rofi.pid
-rofi.kb-primary-paste: Control+Shift+v,Shift+Insert
-rofi.kb-secondary-paste: Control+v,Insert
-rofi.kb-clear-line: Control+u
-rofi.kb-move-front: Control+a
-rofi.kb-move-end: Control+e
-rofi.kb-move-word-back: Alt+b
-rofi.kb-move-word-forward: Alt+f
-rofi.kb-move-char-back: Left,Control+b
-rofi.kb-move-char-forward: Right,Control+f
-rofi.kb-remove-word-back: Control+Alt+h
-rofi.kb-remove-word-forward: Control+Alt+d
-rofi.kb-remove-char-forward: Delete,Control+d
-rofi.kb-remove-char-back: BackSpace,Control+h
-rofi.kb-accept-entry: Control+j,Control+m,Return,KP_Enter
-rofi.kb-accept-custom: Control+Return
-rofi.kb-accept-entry-continue: Shift+Return
-rofi.kb-mode-next: Shift+Right,Control+Tab
-rofi.kb-mode-previous: Shift+Left,Control+Shift+Tab
-rofi.kb-toggle-case-sensitivity: grave,dead_grave
-rofi.kb-delete-entry: Shift+Delete
-rofi.kb-custom-1: Alt+1
-rofi.kb-custom-2: Alt+2
-rofi.kb-custom-3: Alt+3
-rofi.kb-custom-4: Alt+4
-rofi.kb-custom-5: Alt+5
-rofi.kb-custom-6: Alt+6
-rofi.kb-custom-7: Alt+7
-rofi.kb-custom-8: Alt+8
-rofi.kb-custom-9: Alt+9
-rofi.kb-row-left: Control+Page_Up
-rofi.kb-row-right: Control+Page_Down
-rofi.kb-row-up: Up,Control+p,Shift+Tab
-rofi.kb-row-down: Down,Control+n
-rofi.kb-row-tab: Tab
-rofi.kb-page-prev: Page_Up
-rofi.kb-page-next: Page_Down
-rofi.kb-row-first: Home,KP_Home
-rofi.kb-row-last: End,KP_End
-rofi.kb-row-select: Control+space
-rofi.kb-cancel: Escape
-rofi.key-combi:
diff --git a/doc/rofi-manpage.markdown b/doc/rofi-manpage.markdown
index f5cf1d12..cb5db84c 100644
--- a/doc/rofi-manpage.markdown
+++ b/doc/rofi-manpage.markdown
@@ -53,6 +53,7 @@
[ -auto-select ]
[ -parse-hosts ]
[ -combi-modi *mode1,mode2* ]
+[ -normal-window ]
[ -quiet ]
## DESCRIPTION
@@ -572,7 +573,9 @@ Select first line that matches the given string
Add a message line below the filter entry box. Supports pango markup.
For more information on supported markup see [here](https://developer.gnome.org/pango/stable/PangoMarkupFormat.html)
+`-normal-window`
+Make **rofi** reacts like a normal application window. Useful for scripts like Clerk that are basically an application.
### Message dialog
@@ -641,7 +644,7 @@ Currently 3 states exists:
* **normal** Normal row.
* **urgent** Highlighted row (urgent)
* **active** Highlighted row (active)
-
+
For each state the following 5 colors must be set:
* **bg** Background color row
@@ -764,4 +767,3 @@ Rasmus Steinke <rasi@xssn.at>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file.
-
diff --git a/doc/rofi.1 b/doc/rofi.1
index bef44898..7f6de8cd 100644
--- a/doc/rofi.1
+++ b/doc/rofi.1
@@ -7,7 +7,7 @@
\fBrofi\fR \- A window switcher, run launcher, ssh dialog and dmenu replacement
.
.SH "SYNOPSIS"
-\fBrofi\fR [ \-width \fIpct_scr\fR ] [ \-lines \fIlines\fR ] [ \-columns \fIcolumns\fR ] [ \-font \fIpangofont\fR ] [ \-fg \fIcolor\fR ] [ \-fg\-urgent \fIcolor\fR ] [ \-fg\-active \fIcolor\fR ] [ \-bg\-urgent \fIcolor\fR ] [ \-bg\-active \fIcolor\fR ] [ \-bg \fIcolor\fR ] [ \-bgalt \fIcolor\fR ] [ \-hlfg \fIcolor\fR ] [ \-hlbg \fIcolor\fR ] [ \-key\-\fBmode\fR \fIcombo\fR ] [ \-terminal \fIterminal\fR ] [ \-location \fIposition\fR ] [ \-fixed\-num\-lines ] [ \-padding \fIpadding\fR ] [ \-opacity \fIopacity%\fR ] [ \-display \fIdisplay\fR ] [ \-bc \fIcolor\fR ] [ \-bw \fIwidth\fR ] [ \-dmenu [ \-p \fIprompt\fR ] [ \-sep \fIseparator\fR ] [ \-l \fIselected line\fR ] [ \-mesg ] [ \-select ] ] [ \-filter \fIfilter\fR ] [ \-ssh\-client \fIclient\fR ] [ \-ssh\-command \fIcommand\fR ] [ \-disable\-history ] [ \-levenshtein\-sort ] [ \-case\-sensitive ] [ \-show \fImode\fR ] [ \-modi \fImode1,mode2\fR ] [ \-eh \fIelement height\fR ] [ \-lazy\-filter\-limit \fIlimit\fR ] [ \-e \fImessage\fR] [ \-a \fIrow\fR ] [ \-u \fIrow\fR ] [ \-pid \fIpath\fR ] [ \-now ] [ \-rnow ] [ \-snow ] [ \-version ] [ \-help] [ \-dump\-xresources ] [ \-auto\-select ] [ \-parse\-hosts ] [ \-combi\-modi \fImode1,mode2\fR ] [ \-quiet ]
+\fBrofi\fR [ \-width \fIpct_scr\fR ] [ \-lines \fIlines\fR ] [ \-columns \fIcolumns\fR ] [ \-font \fIpangofont\fR ] [ \-fg \fIcolor\fR ] [ \-fg\-urgent \fIcolor\fR ] [ \-fg\-active \fIcolor\fR ] [ \-bg\-urgent \fIcolor\fR ] [ \-bg\-active \fIcolor\fR ] [ \-bg \fIcolor\fR ] [ \-bgalt \fIcolor\fR ] [ \-hlfg \fIcolor\fR ] [ \-hlbg \fIcolor\fR ] [ \-key\-\fBmode\fR \fIcombo\fR ] [ \-terminal \fIterminal\fR ] [ \-location \fIposition\fR ] [ \-fixed\-num\-lines ] [ \-padding \fIpadding\fR ] [ \-opacity \fIopacity%\fR ] [ \-display \fIdisplay\fR ] [ \-bc \fIcolor\fR ] [ \-bw \fIwidth\fR ] [ \-dmenu [ \-p \fIprompt\fR ] [ \-sep \fIseparator\fR ] [ \-l \fIselected line\fR ] [ \-mesg ] [ \-select ] ] [ \-filter \fIfilter\fR ] [ \-ssh\-client \fIclient\fR ] [ \-ssh\-command \fIcommand\fR ] [ \-disable\-history ] [ \-levenshtein\-sort ] [ \-case\-sensitive ] [ \-show \fImode\fR ] [ \-modi \fImode1,mode2\fR ] [ \-eh \fIelement height\fR ] [ \-lazy\-filter\-limit \fIlimit\fR ] [ \-e \fImessage\fR] [ \-a \fIrow\fR ] [ \-u \fIrow\fR ] [ \-pid \fIpath\fR ] [ \-now ] [ \-rnow ] [ \-snow ] [ \-version ] [ \-help] [ \-dump\-xresources ] [ \-auto\-select ] [ \-parse\-hosts ] [ \-combi\-modi \fImode1,mode2\fR ] [ \-normal\-window ] [ \-quiet ]
.
.SH "DESCRIPTION"
\fBrofi\fR is an X11 popup window switcher, run dialog, dmenu replacement and more\. It focuses on being fast to use and have minimal distraction\. It supports keyboard and mouse navigation, type to filter, tokenized search and more\.
@@ -963,6 +963,12 @@ Select first line that matches the given string
.P
Add a message line below the filter entry box\. Supports pango markup\. For more information on supported markup see here \fIhttps://developer\.gnome\.org/pango/stable/PangoMarkupFormat\.html\fR
.
+.P
+\fB\-normal\-window\fR
+.
+.P
+Make \fBRofi\fR reacts like a normal application window\. Useful for scripts like Clerk that are basically an application\.
+.
.SS "Message dialog"
\fB\-e\fR \fImessage\fR
.
diff --git a/source/keyb.c b/source/keyb.c
index 4d9c2cd5..0e6b5dee 100644
--- a/source/keyb.c
+++ b/source/keyb.c
@@ -81,8 +81,8 @@ DefaultBinding bindings[NUM_ABE] =
{ .id = CUSTOM_14, .name = "kb-custom-14", .keybinding = "Alt+Shift+4" },
{ .id = CUSTOM_15, .name = "kb-custom-15", .keybinding = "Alt+Shift+5" },
{ .id = CUSTOM_16, .name = "kb-custom-16", .keybinding = "Alt+Shift+6" },
- { .id = CUSTOM_17, .name = "kb-custom-17", .keybinding = "Alt+Shift+7" },
{ .id = CUSTOM_18, .name = "kb-custom-18", .keybinding = "Alt+Shift+8" },
+ { .id = CUSTOM_17, .name = "kb-custom-17", .keybinding = "Alt+Shift+7" },
{ .id = CUSTOM_19, .name = "kb-custom-19", .keybinding = "Alt+Shift+9" },
};
diff --git a/source/rofi.c b/source/rofi.c
index e3d8b166..3007e2bd 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -195,8 +195,7 @@ static Window create_window ( Display *display )
attr.border_pixel = color_border ( display );
attr.background_pixel = color_background ( display );
- Window box = XCreateWindow ( display, DefaultRootWindow ( display ),
- 0, 0, 200, 100, config.menu_bw, vinfo.depth, InputOutput,
+ Window box = XCreateWindow ( display, DefaultRootWindow ( display ), 0, 0, 200, 100, config.menu_bw, vinfo.depth, InputOutput,
vinfo.visual, CWColormap | CWBorderPixel | CWBackPixel, &attr );
XSelectInput ( display, box, KeyReleaseMask | KeyPressMask | ExposureMask | ButtonPressMask | StructureNotifyMask | FocusChangeMask );
@@ -319,25 +318,21 @@ static void calculate_window_position ( MenuState *state, const workarea *mon )
case WL_NORTH:
state->y = mon->y;
break;
-
case WL_NORTH_EAST:
state->y = mon->y;
case WL_EAST:
state->x = mon->x + mon->w - state->w - config.menu_bw * 2;
break;
-
case WL_EAST_SOUTH:
state->x = mon->x + mon->w - state->w - config.menu_bw * 2;
case WL_SOUTH:
state->y = mon->y + mon->h - state->h - config.menu_bw * 2;
break;
-
case WL_SOUTH_WEST:
state->y = mon->y + mon->h - state->h - config.menu_bw * 2;
case WL_WEST:
state->x = mon->x;
break;
-
case WL_CENTER:
default:
break;
@@ -1874,6 +1869,16 @@ static int main_loop_signal_handler ( char command, int quiet )
return FALSE;
}
+SwitcherMode switcher_run ( char **input, Switcher *sw )
+{
+ char *prompt = g_strdup_printf ( "%s:", sw->name );
+ unsigned int selected_line = UINT32_MAX;
+ int mretv = menu ( sw, input, prompt, &selected_line, NULL, NULL );
+
+ g_free ( prompt );
+ return sw->result ( mretv, input, selected_line, sw );
+}
+
/**
* Setup signal handling.
* Block all the signals, start a signal processor thread to handle these events.
@@ -2126,13 +2131,3 @@ int main ( int argc, char *argv[] )
return EXIT_SUCCESS;
}
-
-SwitcherMode switcher_run ( char **input, Switcher *sw )
-{
- char *prompt = g_strdup_printf ( "%s:", sw->name );
- unsigned int selected_line = UINT32_MAX;
- int mretv = menu ( sw, input, prompt, &selected_line, NULL, NULL );
-
- g_free ( prompt );
- return sw->result ( mretv, input, selected_line, sw );
-}
diff --git a/source/scrollbar.c b/source/scrollbar.c
index be6e18bc..c95aaf59 100644
--- a/source/scrollbar.c
+++ b/source/scrollbar.c
@@ -37,8 +37,7 @@
extern Display *display;
-scrollbar *scrollbar_create ( Window parent, XVisualInfo *vinfo, Colormap map,
- short x, short y, short w, short h )
+scrollbar *scrollbar_create ( Window parent, XVisualInfo *vinfo, Colormap map, short x, short y, short w, short h )
{
scrollbar *sb = g_malloc0 ( sizeof ( scrollbar ) );