1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00

Playing with atom

This commit is contained in:
QC 2015-09-20 11:45:28 +02:00
parent 108c16e0d4
commit fc2d65df0c
12 changed files with 45 additions and 130 deletions

5
.atom-build.json Normal file
View file

@ -0,0 +1,5 @@
{
"cmd" : "make -C build/",
"name" : "all",
"sh" : true
}

5
.gitignore vendored
View file

@ -23,3 +23,8 @@ core
# ignore patches too, the code is either checked in or branch. # ignore patches too, the code is either checked in or branch.
*.patch* *.patch*
doc/*.html
doc/*.1
*.unc-backup~
*.unc-backup.md5~

View file

@ -1,8 +1,9 @@
0.15.9: (unreleased) 0.15.9: (unreleased)
New feature: New feature:
- Support for Startup Notification - Support for Startup Notification
- Standalone mode in dmenu
Improvements: Improvements:
- Keep same line selected. - Keep same line selected
- Cleanup menu code by re-using Switcher - Cleanup menu code by re-using Switcher
Bug fixes: Bug fixes:

View file

@ -1,8 +1,7 @@
# A window switcher, run dialog and dmenu replacement # A window switcher, run dialog and dmenu replacement
A popup window switcher roughly based on [superswitcher](http://code.google.com/p/superswitcher/), A popup window switcher roughly based on [superswitcher](http://code.google.com/p/superswitcher/),
requiring only xlib and pango. requiring only xlib and pango. This version started off as a clone of simpleswitcher, the version from [Sean
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. 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 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. replacement, making it a very versatile tool.
@ -195,4 +194,3 @@ to disable it:
# Installation # Installation
Please see the [installation guide](https://davedavenport.github.io/rofi/p08-INSTALL.html) for instruction on how to install *rofi*. Please see the [installation guide](https://davedavenport.github.io/rofi/p08-INSTALL.html) for instruction on how to install *rofi*.

View file

@ -141,4 +141,3 @@ Settings config = {
/** Hide scrollbar */ /** Hide scrollbar */
.hide_scrollbar = FALSE, .hide_scrollbar = FALSE,
}; };

View file

@ -33,21 +33,15 @@ dnl ---------------------------------------------------------------------
dnl Disable window mode dnl Disable window mode
dnl --------------------------------------------------------------------- dnl ---------------------------------------------------------------------
AC_ARG_ENABLE([windowmode], AC_ARG_ENABLE([windowmode], AC_HELP_STRING([--disable-windowmode],[Disable window mode]))
AC_HELP_STRING([--disable-windowmode],[Disable window mode]))
AS_IF([ test "x$enable_windowmode" != "xno"], [ AS_IF([ test "x$enable_windowmode" != "xno"], [AC_DEFINE([WINDOW_MODE],[1],[Enable the window mode])])
AC_DEFINE([WINDOW_MODE],[1],[Enable the window mode])
])
## ##
# I3 check # I3 check
## ##
AC_ARG_ENABLE(i3support, AC_ARG_ENABLE(i3support, [AS_HELP_STRING([--disable-i3support], [Disable check for i3 support])])
[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;])])
AS_IF([test "x$enable_i3support" != xno && test "x$enable_windowmode" != "xno"],[
AC_CHECK_HEADERS([i3/ipc.h], [i3_header=yes; break;])
])
## ##
# Check dependencies # Check dependencies

View file

@ -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:

View file

@ -53,6 +53,7 @@
[ -auto-select ] [ -auto-select ]
[ -parse-hosts ] [ -parse-hosts ]
[ -combi-modi *mode1,mode2* ] [ -combi-modi *mode1,mode2* ]
[ -normal-window ]
[ -quiet ] [ -quiet ]
## DESCRIPTION ## 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. 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) 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 ### Message dialog
@ -764,4 +767,3 @@ Rasmus Steinke <rasi@xssn.at>
Original code based on work by: Sean Pringle <sean.pringle@gmail.com> Original code based on work by: Sean Pringle <sean.pringle@gmail.com>
For a full list of authors, check the AUTHORS file. For a full list of authors, check the AUTHORS file.

View file

@ -7,7 +7,7 @@
\fBrofi\fR \- A window switcher, run launcher, ssh dialog and dmenu replacement \fBrofi\fR \- A window switcher, run launcher, ssh dialog and dmenu replacement
. .
.SH "SYNOPSIS" .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" .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\. \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 .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 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" .SS "Message dialog"
\fB\-e\fR \fImessage\fR \fB\-e\fR \fImessage\fR
. .

View file

@ -81,8 +81,8 @@ DefaultBinding bindings[NUM_ABE] =
{ .id = CUSTOM_14, .name = "kb-custom-14", .keybinding = "Alt+Shift+4" }, { .id = CUSTOM_14, .name = "kb-custom-14", .keybinding = "Alt+Shift+4" },
{ .id = CUSTOM_15, .name = "kb-custom-15", .keybinding = "Alt+Shift+5" }, { .id = CUSTOM_15, .name = "kb-custom-15", .keybinding = "Alt+Shift+5" },
{ .id = CUSTOM_16, .name = "kb-custom-16", .keybinding = "Alt+Shift+6" }, { .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_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" }, { .id = CUSTOM_19, .name = "kb-custom-19", .keybinding = "Alt+Shift+9" },
}; };

View file

@ -195,8 +195,7 @@ static Window create_window ( Display *display )
attr.border_pixel = color_border ( display ); attr.border_pixel = color_border ( display );
attr.background_pixel = color_background ( display ); attr.background_pixel = color_background ( display );
Window box = XCreateWindow ( display, DefaultRootWindow ( display ), Window box = XCreateWindow ( display, DefaultRootWindow ( display ), 0, 0, 200, 100, config.menu_bw, vinfo.depth, InputOutput,
0, 0, 200, 100, config.menu_bw, vinfo.depth, InputOutput,
vinfo.visual, CWColormap | CWBorderPixel | CWBackPixel, &attr ); vinfo.visual, CWColormap | CWBorderPixel | CWBackPixel, &attr );
XSelectInput ( display, box, KeyReleaseMask | KeyPressMask | ExposureMask | ButtonPressMask | StructureNotifyMask | FocusChangeMask ); 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: case WL_NORTH:
state->y = mon->y; state->y = mon->y;
break; break;
case WL_NORTH_EAST: case WL_NORTH_EAST:
state->y = mon->y; state->y = mon->y;
case WL_EAST: case WL_EAST:
state->x = mon->x + mon->w - state->w - config.menu_bw * 2; state->x = mon->x + mon->w - state->w - config.menu_bw * 2;
break; break;
case WL_EAST_SOUTH: case WL_EAST_SOUTH:
state->x = mon->x + mon->w - state->w - config.menu_bw * 2; state->x = mon->x + mon->w - state->w - config.menu_bw * 2;
case WL_SOUTH: case WL_SOUTH:
state->y = mon->y + mon->h - state->h - config.menu_bw * 2; state->y = mon->y + mon->h - state->h - config.menu_bw * 2;
break; break;
case WL_SOUTH_WEST: case WL_SOUTH_WEST:
state->y = mon->y + mon->h - state->h - config.menu_bw * 2; state->y = mon->y + mon->h - state->h - config.menu_bw * 2;
case WL_WEST: case WL_WEST:
state->x = mon->x; state->x = mon->x;
break; break;
case WL_CENTER: case WL_CENTER:
default: default:
break; break;
@ -1874,6 +1869,16 @@ static int main_loop_signal_handler ( char command, int quiet )
return FALSE; 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. * Setup signal handling.
* Block all the signals, start a signal processor thread to handle these events. * 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; 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 );
}

View file

@ -37,8 +37,7 @@
extern Display *display; extern Display *display;
scrollbar *scrollbar_create ( Window parent, XVisualInfo *vinfo, Colormap map, scrollbar *scrollbar_create ( Window parent, XVisualInfo *vinfo, Colormap map, short x, short y, short w, short h )
short x, short y, short w, short h )
{ {
scrollbar *sb = g_malloc0 ( sizeof ( scrollbar ) ); scrollbar *sb = g_malloc0 ( sizeof ( scrollbar ) );