# HG changeset patch # User Sean E. Russell # Date 1585790647 18000 # Wed Apr 01 20:24:07 2020 -0500 # Node ID bd2710bf229de7008741789cf9cbd35a13d731c7 # Parent ed6e3498dadcb928a470468a8268b07550c5c957 TODOs diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,24 @@ +Copyright (c) 2020, Sean E. Russell +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +# i3quake + +Quake mode for terminal in [i3](https://github.com/i3/i3) window manager + +![quake](https://github.com/NearHuscarl/i3-quake/blob/master/screen/quake.png) + +## Installation +* Install all dependencies +* Download the python file and put it in `$PATH` + +## Usage +Open terminal dropdown in quake style (or bottom up). Each workspace can +have one terminal in quake mode. If the focused workspace already have +quake terminal. The next command will toggle visiblity state of said +console regardless of the input arguments + +## Options + +```bash +$ i3_quake -h +usage: i3_quake [-h] [-i] [-p POS] [-H RATIO] [-t TERM] [CMD] + +positional arguments: + CMD command to execute in new terminal + +optional arguments: + -h, --help show this help message and exit + -i, --in-place set current terminal at top down position and execute + cmd + -p POS, --pos POS open terminal at top or bottom (default is top) + -H RATIO, --height RATIO + height of terminal in percentage of monitor height + -t TERM, --term TERM terminal name (default is xterm) +``` + +## Examples +```bash +$ i3_quake # default use xterm and open $SHELL +``` +```bash +$ i3_quake -H 0.6 -t termite htop +``` +```bash +$ i3_quake -p bottom -H 0.2 -t xfce4-terminal ipython +``` + +## Flickering +Add this line to i3 config (~/.config/i3/config) to hide the terminal +immediately when created to prevent flickering issue + +```i3 +for_window [title="quake_.*"] move window to scratchpad +``` + +## Credit +Original work is [i3-quickterm](https://github.com/lbonn/i3-quickterm) by [ibonn](https://github.com/lbonn) +which will open terminal dropdown from selected shell in rofi dmenu. i3-quake generalize the idea +with command argument to run when open terminal. + +## Licenses +**[BSD 3 Clauses](https://github.com/NearHuscarl/i3-quake/blob/master/LICENSE.md)** diff --git a/main.go b/main.go --- a/main.go +++ b/main.go @@ -1,5 +1,12 @@ package main +// TODO: arguments to the shell +// TODO: vanity package +// TODO: code cleanup +// TODO: upload to repo +// TODO: CI +// TODO: documentation + import ( "flag" "fmt" @@ -29,7 +36,7 @@ func main() { pos := flag.String("p", "top", "Position: top, bottom, left, right (top)") ratio := flag.Float64("H", 0.25, "% height of window, 0-1 (0.25)") - cmd := flag.String("t", "/usr/bin/st", "Terminal program") + cmd := flag.String("t", "st", "Terminal program") flag.Parse() var p int switch strings.ToLower(*pos) {