You are not logged in.

#61 2018-12-21 06:22:42

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: The great yad hacking thread

^ your request is ok, but it's hard to say more if you don't actually ask the question.

Offline

#62 2018-12-21 06:33:28

miyo
Member
Registered: 2018-12-21
Posts: 12

Re: The great yad hacking thread

Thank you ohnonot. I appreciate that.

What I'm trying to do is...create a full-screen application launcher that will close AFTER a user clicks on an application. Here is the basic command that I'm working with...

yad --icons --read-dir=/usr/share/applications --fullscreen --sort-by-name --undecorated --single-click --skip-taskbar

If I can figure this out, I will also add...

--no-buttons

...to the command.

I know that you can close yad after clicking on a button, but I can't find a way to close it after clicking on one of the icons in the window.

Last edited by miyo (2018-12-21 06:34:20)

Offline

#63 2018-12-21 06:38:16

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: The great yad hacking thread

miyo wrote:

What I'm trying to do is...create a full-screen application launcher that will close AFTER a user clicks on an application.

try xlunch. it's like gnome shell launcher for poor people (well, poor machines).

Offline

#64 2018-12-21 06:52:56

miyo
Member
Registered: 2018-12-21
Posts: 12

Re: The great yad hacking thread

ohnonot wrote:
miyo wrote:

What I'm trying to do is...create a full-screen application launcher that will close AFTER a user clicks on an application.

try xlunch. it's like gnome shell launcher for poor people (well, poor machines).

I've tried it, and it works well. smile

I'm just trying to keep extra packages out if I can...so that there are no packages (or as few packages as possible) not included in the system's repositories. wink

If I can't figure this out, I may use xlunch.

Thank you. I appreciate your time.

Last edited by miyo (2018-12-21 06:55:20)

Offline

#65 2018-12-22 00:05:46

miyo
Member
Registered: 2018-12-21
Posts: 12

Re: The great yad hacking thread

misko_2083 wrote:

miyo get the process id of the yad window and use the strace to watch for SIGCHLD signal.
When yad emits the SIGCHLD signal, send SIGURS1 signal to yad.

#!/bin/bash
yad --icons --read-dir=/usr/share/applications --fullscreen --sort-by-name --undecorated --single-click --skip-taskbar --no-buttons & ICONS_PID=$!

strace -p $ICONS_PID -e trace=signal -s 32 2>&1 \
| while read -r line; do
        if [[ $line =~ "--- SIGCHLD" ]];then
           kill -s SIGUSR1 $ICONS_PID
           break
         fi
done

Signal SIGUSR1 closes the ad dialog with 0 exit status.

If you use --close-on-unfocus, yad dialog will close on alt+tab

misko_2083,

Thank you! Exactly what I was looking for! Thank you so very much for taking the time to help me.

I would be honored if you will allow me to acknowledge you for this in the future.

Offline

#66 2018-12-22 19:02:10

malm
jgmenu developer
Registered: 2016-10-13
Posts: 735
Website

Re: The great yad hacking thread

That is some hack. I admire the ingenuity.

Offline

#67 2018-12-28 08:59:25

miyo
Member
Registered: 2018-12-21
Posts: 12

Re: The great yad hacking thread

misko_2083 wrote:
miyo wrote:

I would be honored if you will allow me to acknowledge you for this in the future.

It's fine by me.

Thank you. smile

Offline

#68 2019-01-06 09:44:32

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: The great yad hacking thread

DEPCOUNT+=1

do you want this to be an arithmetic operation? because it's not.
it will change 0 to 01, then 011 etc.

an arithmetic operation would look like this:

((DEPCOUNT+=1))

i'm guessing there are more errors, it's just the first i saw.

your doublequote fu is definitely poor.

Offline

#69 2019-01-06 11:43:48

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: The great yad hacking thread

This is a handy tool: shellcheck


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

#70 2019-01-06 12:02:47

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: The great yad hacking thread

^Quite, nice tool. Thanks damo for pointing it out!


Postpone all your duties; if you die, you won't have to do them ..

Offline

#71 2019-01-06 12:19:10

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: The great yad hacking thread

Nice tool indeed Damo. Built with Haskell too.

Offline

#72 2019-01-07 01:04:22

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: The great yad hacking thread

misko_2083 wrote:

Certain arithmetic operations are permitted for declared integer variables without the need for expr or let.

nice, i didn't know that.

The quotes where they need to be. Although shellcheck complains about semantics it can't check the logic. e.g. Process IDs are always integer numbers.

'm gonna take your word for it; personally I wouldn't sufficiently trust my own code to make such a bold statement.

btw, since your indices are simple integers (0-7) there is no need to declare an associative array.
a simple

APP_DESC=(
           "Music player"
           "Game"
           "Color selector"
           "Puzzle game"
           "Youtube"
           "Game"
           "Music player"
           "For screenshots"
                )

will do the same in this case.

sorry I can't help with the actual script.

Offline

#73 2019-01-07 05:12:18

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,560
Website

Re: The great yad hacking thread

ohnonot wrote:

sorry I can't help with the actual script.

Me neither I'm afraid, but you could make your yad version checking a bit simpler and more robust by using 'dpkg --compare-versions'

man dpkg wrote:

--compare-versions ver1 op ver2
              Compare version numbers, where  op  is  a  binary  operator.  dpkg
              returns  true  (0)  if  the  specified condition is satisfied, and
              false (1) otherwise. There are  two  groups  of  operators,  which
              differ  in  how  they  treat an empty ver1 or ver2. These treat an
              empty version as earlier than any version: lt  le  eq  ne  ge  gt.
              These  treat  an  empty  version  as later than any version: lt-nl
              le-nl ge-nl gt-nl. These are provided only for compatibility  with
              control  file syntax: < << <= = >= >> >. The < and > operators are
              obsolete and should not be used, due to  confusing  semantics.  To
              illustrate: 0.1 < 0.1 evaluates to true.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#74 2019-01-09 11:56:31

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: The great yad hacking thread

No frills conky chooser, pretty basic but its working for me. I would like to add a killall conky there somewhere but not sure how? Suppose i could just point it to a kill script?

#!/bin/bash

yad --title="--dclick-action=CMD" --width=300 --height=200 --separator=" " --list --dclick-action="conky -c" --column=Name /home/s7/.config/conky/bar.conky.conf /home/s7/.config/conky/nl.conky.conf

Found it here: http://smokey01.com/yad/

Offline

#75 2019-01-09 12:17:39

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: The great yad hacking thread

^ Add a button with the appropriate label and index. Then test for the return value of the dialog: if it matches the index, run the kill command.


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

#76 2019-01-09 12:33:11

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: The great yad hacking thread

^ yes thats it, thanks damo.

--button=gtk-cancel:1 \
--button="Killall Conky":kill-conky \

Offline

#77 2019-01-09 13:54:07

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: The great yad hacking thread

Yad conky chooser v0.2. Bit better looking than the list option. Bunsenlabs conky manager is a work of art, much better control. I wonder is there ability for yad to do what bl conky manager can do?

2019-01-09--1547041697_467x305_scrot.th.png

#!/bin/bash

yad --title="Conky Chooser" --form --center --on-top --width=300 --height=200 --window-icon=utilities-system-monitor --width=250 \
--field="NL-Conky":fbtn 'conky -c "/home/s7/.config/conky/nl.conky.conf"' \
--field="BL-Top Conky":fbtn 'conky -c"/home/s7/.config/conky/BL conkys/BL-Top.conkyrc"' \
--field="Bar-Conky":fbtn 'conky -c "/home/s7/.config/conky/bar.conky.conf"' \
--button="Killall Conky":kill-conky \
--button="Restart Conky":conkyrestart \
--button=gtk-cancel:1

Offline

#78 2019-01-09 19:48:02

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: The great yad hacking thread

S7.L wrote:

... I wonder is there ability for yad to do what bl conky manager can do?

Well, the BL conky manager uses yad as the graphical interface for the script. Yad needs something behind the scenes to operate anything constructively!


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

#79 2019-01-13 15:22:08

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: The great yad hacking thread

Using a bit different config...

yad --width 200 --height 400 --title "CONKY" --form --center --on-top --width=300 --height=200 --window-icon=utilities-system-monitor --width=250 \
    --form \
    --field="Conky Bar:BTN" 'conky -c  "/home/s7/.config/conky/bar.conky.conf"' \
    --field="Conky NL:BTN" 'conky -c  "/home/s7/.config/conky/nl.conky.conf"' \
    --field="Conky BL-Top:BTN" 'conky -c  "/home/s7/.config/conky/BL-Top.conf"' \
    --field="Restart Conky":fbtn "conkyrestart" \
    --field="Kill Conky":fbtn "kill-conky" \

2019-01-14-011841_1366x768_scrot.th.png

I would like to space those cancel and ok buttons better.

^just use this...

--button=gtk-close:1

Last edited by S7.L (2019-01-13 15:33:48)

Offline

#80 2019-01-15 11:16:54

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: The great yad hacking thread

^ Thats very cool misko thankyou, is that something like electron? I wouldnt have a clue how to do that sort of thing, ive dabbled a bit in html and css but not ever puting it together with say a bash script.

Offline

Board footer

Powered by FluxBB