diff --git a/Examples/i3_switch_workspaces.sh b/Examples/i3_switch_workspaces.sh new file mode 100755 index 00000000..a5920567 --- /dev/null +++ b/Examples/i3_switch_workspaces.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +if [ -z $@ ] +then +function 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}" ] + then + i3_empty_workspace.sh >/dev/null + elif [ -n "${WORKSPACE}" ] + then + i3-msg workspace "${WORKSPACE}" >/dev/null + fi +fi diff --git a/Makefile.am b/Makefile.am index 9d416647..5e95f8d2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,12 +26,14 @@ rofi_SOURCES=\ source/dmenu-dialog.c\ source/run-dialog.c\ source/ssh-dialog.c\ + source/script-dialog.c\ source/history.c\ config/config.c\ include/rofi.h\ include/run-dialog.h\ include/ssh-dialog.h\ include/dmenu-dialog.h\ + include/script-dialog.h\ include/xrmoptions.h\ include/history.h\ include/textbox.h @@ -66,6 +68,7 @@ EXTRA_DIST=\ $(man1_MANS)\ $(markdown_FILES)\ $(markdown_SC_FILES)\ + Examples/i3_switch_workspaces.sh\ INSTALL.md ## diff --git a/config/config.c b/config/config.c index 54590735..7037599d 100644 --- a/config/config.c +++ b/config/config.c @@ -29,6 +29,9 @@ #include "rofi.h" Settings config = { + // List of enabled switchers. + // -switchers + .switchers = "window,run,ssh", // Set the default window opacity. // This option only works when running a composite manager. // -o diff --git a/doc/rofi-manpage.markdown b/doc/rofi-manpage.markdown index d1a3599b..f2364edd 100644 --- a/doc/rofi-manpage.markdown +++ b/doc/rofi-manpage.markdown @@ -14,11 +14,11 @@ SYNOPSIS [ -terminal *terminal* ] [ -loc *position* ] [ -hmode ] [ -fixed-num-lines ] [ -padding *padding* ] [ -opacity *opacity%* ] [ -display *display* ] [ -bc *color* ] [ -bw *width* ] [ -dmenu [ -p *prompt* ] ] [ -ssh-set-title *true|false* ] [ -now ] [ -rnow ] [ -snow ] [ -version ] [ -help] [ -dump-xresources ] -[ -disable-history ] [ -levenshtein-sort ] +[ -disable-history ] [ -levenshtein-sort ] [ -show *mode* ] [ -switcher *mode1,mode2* ] DESCRIPTION ----------- -`rofi` is an X11 popup window switcher. A list is displayed center-screen showing open window titles, WM_CLASS, and desktop number. +`rofi` is an X11 popup window switcher. A list is displayed center-screen showing open window titles, WM_CLASS, and desktop number. The user may filter the list by typing, navigate with Up/Down or Tab keys, and select a window with Return (Enter). Escape cancels. License @@ -219,11 +219,38 @@ OPTIONS When searching sort the result based on levenshtein distance. +`-show` *mode* + + Open rofi in a certain mode. + + For example to show the run-dialog: + + rofi -show run + + This function deprecates -rnow,-snow and -now + +`-switchers` *mode1,mode1* + + Give a comma separated list of modes to enable, in what order. + + For example to only show the run and ssh dialog (in that order): + + rofi -switchers "run,ssh" -show run + + Custom modes can be added using the internal 'script' mode. Each mode has two parameters: + + :