diff options
| -rw-r--r-- | LICENSE | 21 | ||||
| -rw-r--r-- | README.md | 41 | ||||
| -rw-r--r-- | main.go | 7 |
3 files changed, 64 insertions, 5 deletions
@@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 by nick@softwarefools.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8021077 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# Fenestra + +A simple, beautiful and customizable Viewer for my Cheatsheets. +Its written in go and uses nucular. + +## Install + +A Makefile is included to download all the important libaries and compile with the propper flags. +Just run + +``` +make fetch_all +make build +``` + + + +## Usage + +You can load from file or pipe text into Fenestra as you would with xmessage. Also a self destruct timer can be set to end the cheat peek automatically. The theme features of Nucular can be triggered also from the commandline. + +``` +cat example.cheat | fenestra +``` +will open the cheatsheet +``` +fenestra -f example.cheat -d 10 --color-theme Red +``` +will do the same in Red Theme for 10s and close + +## Dependencies + +[Nucular](https://github.com/aarzilli/nucular) - The awsome Go Port of Nuklear by Alessandro Arzilli + +[GetOpt](https://github.com/pborman/getopt) - An versatile Flagparser for CLIs by Paul Borman + + +## Motivation + +I was configuring a new installation of Xmonad and went fairly creative on Keybindings. As the Xmonad Help only really is one long string piped into an xmessage, I decided to document all my precious keys in a cheatsheet. I often write some Cheatsheets im my home folder to keep clever one-liners or specific program sequences. My usual method of opening them with a texteditor seemed a little uncouth because I will not edit my Xmonad cheatsheet in some time and xmassage seemed a bit too retro for my sweet new setup. +I love the simplicity and the looks of the Nucular GUI libary and decided to use it for a new simple viewer that could display my sheets nicely and give them some order. This is the result. @@ -45,7 +45,7 @@ func init() { getopt.FlagLong(&menubar, "no-menu", 'm', "Dont Show Menu") getopt.FlagLong(&scaling, "magnify", 'g', "Magnification level") getopt.FlagLong(&countd, "count-down", 'd', "Set Count down in seconds for auto-quit") - getopt.FlagLong(&themestr, "color-theme", 'c', "Specify Theme") + getopt.FlagLong(&themestr, "color-theme", 'c', "Specify Theme: Dark, Red, White or Default") getopt.FlagLong(&help, "help", 'h', "Show Program Usage") getopt.FlagLong(&filename, "file", 'f', "The textfile to be parsed and displayed") getopt.FlagLong(&exitbut, "quit-button", 'q', "Label of the Quit Button") @@ -54,10 +54,7 @@ func init() { func main() { - //timer := time.NewTimer(time.Second*time.Duration(countd*1000)) - //defer timer.Stop() go func() { - //<-timer.C time.Sleep(time.Duration(countd)*time.Second) if countd>0 { fmt.Println("Timer of",countd,"s has Ended") @@ -137,7 +134,7 @@ func main() { } func showHelp() { - fmt.Printf("Usage of %s Version %s:\n A simple and Customizable Cheatsheet viewer.\n When No Text is piped and no File specified the Parameters\n will be shown as Text.\n\n", os.Args[0], version) + fmt.Printf("Usage of %s\n Version %s Compiled %s\n A simple and Customizable Cheatsheet viewer.\n When No Text is piped and no File specified\n the Parameters will be shown as Text.\n\n", os.Args[0], version, compdate) getopt.Usage() os.Exit(0) |
