You are not logged in.

#151 2019-09-21 16:51:40

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,769

Re: The great yad hacking thread

achim wrote:

Hello everybody,

I have installed a YAD script on a notebook with the operating system Linux Mint 18.3 - 64 Bit, in which the code line "--no-buttons --close-on-unfocus" does not work. Therefore, a question: does anyone have a similar problem or knows a solution? Here is the code:

#!/bin/sh
#
# Start-Center für verschiedene YAD-Scripts
#
TEXT="<span foreground='blue'><b><big><big>
Linux Tools

Bitte einen Modus wählen:
</big></big></b></span>"

yad --borders=50 --center --columns=2 --window-icon="$HOME/.icons/system22.png" --title="Achim's Linux-Tools Start Center" --form \
--width=800 --height=500 --fixed --text="$TEXT" \
--image="gtk-execute" \
--image-on-top \
--field="Backup / Restore":fbtn "tback.sh" \
--field="Handy auslesen":fbtn "tcopycam.sh" \
--field="Änderungsdatum Bilder":fbtn "toedat.sh" \
--no-buttons --close-on-unfocus

Greetings,
achim

Just state your yad version

yad --version

chances are you're using a version where the feature is not present.


Per aspera ad astra.

Offline

#152 2019-09-21 18:02:08

achim
Member
Registered: 2019-08-23
Posts: 35

Re: The great yad hacking thread

That will be so. It is the version 0.27 from the package of .Linux-Mint 18.3. Oddly, my desktop PC with Tower, also LM 18.3, uses version 0.39. Can I actually install a higher version without problems?

Offline

#153 2019-09-22 12:36:21

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,769

Re: The great yad hacking thread

achim wrote:

That will be so. It is the version 0.27 from the package of .Linux-Mint 18.3. Oddly, my desktop PC with Tower, also LM 18.3, uses version 0.39. Can I actually install a higher version without problems?

YAD is at 4.1 now (they jumped from 0.41 or so straight up). We've been shipping updated yad versions in BL Helium for a while and never had forward-incompatibilities. You should be able to install the higher version. Unless you use a package, remember to install into /usr/local though.


Per aspera ad astra.

Offline

#154 2019-09-22 16:27:08

achim
Member
Registered: 2019-08-23
Posts: 35

Re: The great yad hacking thread

thanks

Offline

#155 2019-10-28 03:11:21

misko_2083
Member
Registered: 2016-05-24
Posts: 342

Re: The great yad hacking thread

Found a use for the html dialog.
Made a fake title bar in a yad's paned window.
https://i.imgur.com/a6NX9hA.png

Used xdotool, xprop, wmctrl, CSS, HTML, bash and C (Xlib). Fun smile
https://www.youtube.com/watch?v=cwJMRKAQAMU


Што ни оштровиди ум сагледати не може - љубав превазилази.

Offline

#156 2019-11-01 19:46:57

Anton
Member
From: СПб, Россия
Registered: 2019-04-11
Posts: 9

Re: The great yad hacking thread

misko_2083 wrote:

Да си жив и здрав.
You'll figure it out eventually.

I like to help but realy don't want to run those BLOBs in the archive.
It's more than enough having all those proprietary BLOBs in the linux kernel. smile

Done.

Offline

#157 2019-11-02 00:05:34

misko_2083
Member
Registered: 2016-05-24
Posts: 342

Re: The great yad hacking thread

Anton wrote:

So, my installer script was forked by the pirates to unpack pirated games.
And they even thank me in the instructions.
How thoughtful of them.


Што ни оштровиди ум сагледати не може - љубав превазилази.

Offline

#158 2019-11-02 18:29:50

Anton
Member
From: СПб, Россия
Registered: 2019-04-11
Posts: 9

Re: The great yad hacking thread

misko_2083.
For example: Free game with it.
Look it (cat merged file) in action.
Installer template.
Thank you again for your help.

Last edited by Anton (2019-11-08 09:34:50)

Offline

#159 2019-11-02 20:03:54

Anton
Member
From: СПб, Россия
Registered: 2019-04-11
Posts: 9

Re: The great yad hacking thread

misko_2083 wrote:

Found a use for the html dialog.
Made a fake title bar in a yad's paned window.
https://i.imgur.com/a6NX9hAm.png

Used xdotool, xprop, wmctrl, CSS, HTML, bash and C (Xlib). Fun smile
https://www.youtube.com/watch?v=cwJMRKAQAMU

Where is the code?
RTX and lika is me there.

Last edited by Anton (2019-11-02 20:04:28)

Offline

#160 2019-11-05 19:39:51

misko_2083
Member
Registered: 2016-05-24
Posts: 342

Re: The great yad hacking thread

Anton wrote:

misko_2083.
Free game with it.
Look it (cat merged file) in action.
Installer template.
Thank you again for your help.

I've searched the forums for yad installer on rutracker.org and found some games than are not free.
htps://rutracker.org/forum/viewtopic.php?t=5696248
https://rutracker.org/forum/viewtopic.php?t=5630907
https://rutracker.org/forum/viewtopic.php?t=5497249
My initial conclusion was that you are captaing Jack Sparrow.
Apologies if not so.

Posted the code in the google groups.
I try to preserve the free space on the server of this forum.


Што ни оштровиди ум сагледати не може - љубав превазилази.

Offline

#161 2019-11-07 22:06:07

Anton
Member
From: СПб, Россия
Registered: 2019-04-11
Posts: 9

Re: The great yad hacking thread

misko_2083 wrote:

I've searched the forums for yad installer on rutracker.org and found some games than are not free.
htps://rutracker.org/forum/viewtopic.php?t=5696248
https://rutracker.org/forum/viewtopic.php?t=5630907
https://rutracker.org/forum/viewtopic.php?t=5497249
My initial conclusion was that you are captaing Jack Sparrow.
Apologies if not so.

Posted the code in the google groups.
I try to preserve the free space on the server of this forum.

There is "Games for Linux" section.
There is no point publishing opensource/free games on that site (although they are, but they are very rare there).
I have been making repacks (90% bought by me) with earlier YSI versions since the end of August 2018. I started making installer with Zenity in the spring of 2018, but in the middle of summer 2018 I found out about YAD (on http://murga-linux.com/puppy/viewtopic.php?t=97458).

//07.11.2019 — YSI links updated

Last edited by Anton (2019-11-08 09:39:16)

Offline

#162 2019-11-09 20:23:39

misko_2083
Member
Registered: 2016-05-24
Posts: 342

Re: The great yad hacking thread

Relax, I'm only messing with you. :-D

I like the way you write the scripts.
They are readable. You have an eye for that.


Што ни оштровиди ум сагледати не може - љубав превазилази.

Offline

#163 2019-11-26 14:56:20

achim
Member
Registered: 2019-08-23
Posts: 35

Re: The great yad hacking thread

Good day everybody,

I want to generate a printer selection in a yad-script. Installed printers are currently

EPSON WF-3520 series
pc-fax
Generic CUPS-PDF Printer

So far I solve the conversion somewhat with "lpoptions -d" EPSON_WF-3520_Series "or" lpr -P PDF ".
How do I achieve a change if I do not know the printer name? I'm looking for a way to convert the printer via script by the installed printers are read and then offered via yad for selection. Is anyone familiar with it?

achim

Offline

#164 2019-11-26 15:41:22

damo
....moderator....
Registered: 2015-08-20
Posts: 5,966

Re: The great yad hacking thread

lpstat and lpadmin may be what you need. For example, get a list of printers with

lpstat -e

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#165 2019-11-27 02:30:28

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,778
Website

Re: The great yad hacking thread

@achim you are aware of the utility system-config-printer?
https://packages.debian.org/stretch/sys … ig-printer
It's not yad, but might already do what you need...


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#166 2019-11-27 15:18:21

achim
Member
Registered: 2019-08-23
Posts: 35

Re: The great yad hacking thread

@damo
lpstat: Error - unknown option "e".
lpstat -v reads printer information. I do not yet know how to transfer the printer names to variables.

@johnraff
I've already thought of that. However, I would prefer a separate function under yad.

Many greetings
achim

Offline

#167 2019-11-27 22:41:30

misko_2083
Member
Registered: 2016-05-24
Posts: 342

Re: The great yad hacking thread

Have a look in the cups manual:
https://www.cups.org/doc/options.html#PRINTER


Што ни оштровиди ум сагледати не може - љубав превазилази.

Offline

#168 2019-11-28 03:00:35

damo
....moderator....
Registered: 2015-08-20
Posts: 5,966

Re: The great yad hacking thread

achim wrote:

@damo
lpstat: Error - unknown option "e".
lpstat -v reads printer information. I do not yet know how to transfer the printer names to variables.

Works for me on Buster.

@johnraff
I've already thought of that. However, I would prefer a separate function under yad.

Example idea

### read printer devices
$ lpstat -v
device for Brother: dnssd://Brother%20HL-3140CW%20series._pdl-datastream._tcp.local/
device for Brother_HL_3140CW_series: ipp://BRW2C6FC9166C82.local:631/ipp/print
device for Brother_HL_3140CW_series_jem_laptop: ///dev/null

### put the 3rd fields in an array
$ arrPRINTERS=($(lpstat -v | awk '{print $3}'))

### format result (make a loop if there are more than one)
$ PRINTER_1=${arr[0]%:*} && echo "$PRINTER_1"
Brother

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#169 2019-11-28 12:43:49

achim
Member
Registered: 2019-08-23
Posts: 35

Re: The great yad hacking thread

@misko_2083

Thanks, that's very good. This enables me to build a complete printer dialog.

@damo

The example does not work for me unfortunately. Or I just do not understand it?  sad

Offline

#170 2019-11-28 17:38:23

damo
....moderator....
Registered: 2015-08-20
Posts: 5,966

Re: The great yad hacking thread

achim wrote:

...
@damo

The example does not work for me unfortunately. Or I just do not understand it?  sad

I don't know - you haven't said what you have tried. Post your commands and the output?


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#171 2019-11-29 11:15:01

achim
Member
Registered: 2019-08-23
Posts: 35

Re: The great yad hacking thread

@damo

I just can not manage to formulate a loop that will give me a usable result. For it works now with this command:

lpstat -a | awk '{print $1}'

Nevertheless, many thanks for your support

PS. Maybe you have just told me how to formulate a loop with result from your proposal.

Achim

Offline

#172 2019-11-29 20:33:13

secureIT
New Member
Registered: 2019-11-29
Posts: 1

Re: The great yad hacking thread

Hello Achim,


look at the thread in forums.linuxmint
I think i got a solution ........

Offline

#173 2019-11-29 21:42:30

damo
....moderator....
Registered: 2015-08-20
Posts: 5,966

Re: The great yad hacking thread

achim wrote:

@damo

I just can not manage to formulate a loop that will give me a usable result. For it works now with this command:

lpstat -a | awk '{print $1}'

Nevertheless, many thanks for your support

PS. Maybe you have just told me how to formulate a loop with result from your proposal.

Achim

Quick yad hack to loop through printers, and display your choice

#!/bin/bash
##
## yad-printer.sh

arrP=($(lpstat -a | awk '{print $1}'))

LIST=""

for ((j=0; j<${#arrP[*]}; j++));do
    p="${arrP[$j]}"
    [[ "$p" == "reason" ]] && continue
    LIST="${LIST}FALSE $p "
done

RET=$(yad --list \
    --text="Choose a Printer:" \
    --checklist --width=400 --height=200 \
    --column="Choose" --column="Printer Name" $LIST --separator=":" \
    --button=gtk-ok:0 --button=gtk-cancel:1 \
    )

if (( $? == 1 )); then # cancel button pressed
    exit 0
else
    printer=${RET%*:}
    printer=${printer#*:}
fi

echo -e "\n\tDo what you want with $printer!!\n"

(NB No error checks, and multi-choice is possible, but it was a quick try)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#174 2019-11-30 01:42:02

achim
Member
Registered: 2019-08-23
Posts: 35

Re: The great yad hacking thread

@damo

A big thank you, now I save a lot of time and do not need any more experiments. An error check I will install.


@secureIT

one reads again and again that the TE wants to close the thread without good reason. That's why I'll do better for myself. I still have many interesting ideas.

achim

Last edited by achim (2019-11-30 01:45:13)

Offline

#175 2019-12-01 21:00:31

achim
Member
Registered: 2019-08-23
Posts: 35

Re: The great yad hacking thread

Hi,

the content of the variable "sprint" is the default printer. Is it possible over this code

RET = $ (yad --list --center --fixed --title = "Printer" --window-icon = "gtk-print" --text = "\ n Currently '$ sprinter' is the default printer \ n \ n The following devices are available: \ n "\
     --radiolist --width = 550 --height = 350 --column = "Check" --column = "printername" $ LIST --separator = ":" \
     --button = gtk-cancel: 1 --button = gtk-ok: 0
     )
dvar = $ (echo $?)

to display the corresponding line as "activated"?

achim

Offline

Board footer

Powered by FluxBB