Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/keithdhedger/yadqt

This is an app to produce simple Qt dialogs from the command line, similar to YAD for gtk.
https://github.com/keithdhedger/yadqt

cli cli-app dialogs linux qt-gui qt5 qt5-gui qt6 script

Last synced: 4 months ago
JSON representation

This is an app to produce simple Qt dialogs from the command line, similar to YAD for gtk.

Awesome Lists containing this project

README

        

# YadQt
This is an app to produce simple Qt dialogs from the command line, similar to YAD for gtk.

To build/install:
```console
./autogen.sh --prefix=/usr
make
make install
```

**QUICK USE:**

yadqt -h
```console
Usage: yadqt [options]

Options:
-h, --help Displays help on commandline options.
--help-all Displays help including Qt specific options.
-v, --version Displays version information.
-t, --title Title.
-b, --body Body.
-d, --default Default text ( lists, forms etc, 1st positional arg passed will overide this ).
--fromstdin Read default data from stdin.
--width <640> Dialog width ( set to 0 for default size for
dialog ).
--height <320> Dialog height ( set to 0 for default size for
dialog ).
--opseparator <|> Separator for multi item output ( use "newline"
to use '\n' ).
--ipseparator <|> Separator for multi item default text input ( use "newline"
to use '\n' ).
--multiple Select multiple items ( lists ).
--btntoerr Print button to stderr.
--buttons Buttons ( for info boxes ).
--type Box Type ( no type will display aboutbox for Qt ).
````

**Dialog types:**

about

aboutqt

query

info

warn

fatal

input

getitem

form

list

textfile

imagefile

colour

font

text

tailbox

notepad

richtext

**Examples:**

````yadqt --type=aboutqt````

````yadqt --type=fatal -t "DANGER!" -b "BSOD!" --buttons="abort|Ignore" --btntoerr 2>/dev/pts/2;echo $?````

![fatal](screenshots/fatal.png "yadqt --type=fatal")

````cat /usr/include/linux/limits.h|yadqt --type=getitem -t "Select Item" -b "Items:" --ipseparator=newline --fromstdin````

````yadqt --type=getitem -t "my title" -b "some input" -d "one|three|two|end" --btntoerr 2>/dev/pts/2;echo $?````

![fatal](screenshots/getitem.png "yadqt --type=getitem")

````yadqt --type=input -t "my title" -b "some input" -d "default input txt";echo $?````

![fatal](screenshots/input.png "yadqt --type=input")

````yadqt --type=info -b "Some info for you" --buttons="ok" --btntoerr 2>/dev/pts/2;echo $?````

![fatal](screenshots/info.png "yadqt \--type=info")

````yadqt --type=form -t "Simple Form" -b "Entry 1|Box Two|Data 3|Last Box" --btntoerr --default="default 1|box 2|box n" 2>/dev/pts/2;echo $?````

![fatal](screenshots/form.png "yadqt --type=form")

````yadqt --type=form -t "Simple Form" -b "Entry 1|Box Two|Data 3|Last Box" --default="default 1|box 2|box n" --width=300 --height=0````

![fatal](screenshots/form2.png "yadqt --type=form")

````yadqt --type=list -t "Simple List" --default="$(cat /etc/fstab|tr '\\n' '|')" --multiple --btntoerr --width=600 --height=350 2>/dev/pts/2;echo $?````

````yadqt --type=list -t "Simple List" --default="$(cat /etc/fstab)" --btntoerr --width=600 --height=350 --ipseparator="newline"````

````yadqt --type=list -t "Simple List" --default="default 1|item 2|item 3|num 4|five|666|item nth" --multiple --opseparator="newline";echo $?````

![fatal](screenshots/list1.png "yadqt --type=list")

````yadqt --type=text -t "Show Text" --default="some text@second line@third line" --ipseparator=@````

![fatal](screenshots/text1.png "yadqt --type=text")

````while read;do echo $REPLY;done< <(cat /etc/fstab)|yadqt --type=text --fromstdin --width=800 -t "Show Text"````

![fatal](screenshots/text2.png "yadqt --type=text")

````yadqt --type=textfile --width=800 --height=400 -d /usr/include/linux/limits.h --btntoerr 2>/dev/pts/3;echo $?````

![fatal](screenshots/textfile.png "yadqt --type=textfile")

````yadqt --type=imagefile -d '/home/keithhedger/WallpapersByCatagory/AllHallows/halloween-graveyard.gif'````

````yadqt --type=imagefile -d '/home/keithhedger/Backgrounds/bc3.png' --height=420 --width=640````

![fatal](screenshots/image.png "yadqt --type=imagefile")

````yadqt --type=colour --default="#c080ff80" -t "Select a colour..."|yadqt --type=input -t "Results" -b "Colour Selected" --fromstdin````

````yadqt --type=colour --default="#c080ff80" --btntoerr -t "Select a colour..." 2>/dev/pts/2;echo $?````

![fatal](screenshots/colour.png "yadqt --type=colour")

````yadqt --type=font -d "Monospace,20"````

![fatal](screenshots/font.png "yadqt --type=font")

**Tailbox will update additions from file**

```tail -n25 -f '/run/XfceWMScript.log' |yadqt --type=tailbox -t "Tail box" --width=800```

Or

```yadqt --type=tailbox -t "Tail box" --width=800 < /run/XfceWMScript.log```

![fatal](screenshots/tailbox.png "yadqt --type=tailbox")

**Notepad simple text file editor**

```yadqt --type=notepad --width=800 --height=400 ../../README ;echo $?```

![fatal](screenshots/notepad.png "yadqt --type=notepad")

**Richtext simple richtext viewer**

```yadqt --type=richtext --width=800 --height=400 '/tmp/KeithDHedger.github.io/docs/index'```

![fatal](screenshots/richtext.png "yadqt --type=richtext")

**Simple search in current folder:**

Searches files for text and opens in default app.
```console
find . -print0 |xargs -0 grep -s --binary-files=without-match --ignore-case --binary-files=without-match --line-number "$(yadqt --type=input -t Search -b "Search for")"|yadqt --type=list -t "Found" --width 800 --fromstdin --ipseparator=newline |awk -F: '{print $1}'|xargs xdg-open
````
![fatal](screenshots/search1.png "Search example")

![fatal](screenshots/search2.png "Search example")



Some options are not yet implemented



TODO

documentation - ONGOING ... :(

more boxes

set o/p separator for data.DONE

set i/p separator for data.DONE