You are not logged in.
Hi Misko and others ! I'm going to spend the next 30 days working on Yad once again and have a button layout question.
Is there a way to have a Grid of Form Buttons that fills a whole yad window ? The whole screen size ?
I can do this with multiple yad windows and position them one below the other but, even when I set all yad windows to with "behind display properties", programs will get between the multiple windows.
This is what I am trying to accomplish using only One Yad Window:
https://www.youtube.com/watch?v=a-Iy7YeeW8A
Thanks for helping, Bobby
If I understand this, with my limited knowledge of English,
you are trying to make a window manager on top of window manager with bash. Yikes O.O
In the video you have KDE, that means it's a kwin window manager.
To overide the default window placement in kwin you have to calculate where to place each yad window.
Each yad window would be like an icon on the desktop that runs on single click.
That's probably possible in kwin and much much faster if you make a few icons on the desktop.
Nevertheless, let's say you have a school project and your school mark depends on it.
Just kidding. Nothing can surprise me after I've seen an OP on the xfce forums that uses 46 xfce4-panels instead of desktop icons.
Back to the subject. You need to get the _NET_WORKAREA property from a root window.
More about _NET_WORKAREA here:https://specifications.freedesktop.org/ … 01s03.html
You will be placing windows inside those geometries.
You would need to know the size of each window and calculate how many can fit inside the workarea.
Once you place them you need to keep them below. That is possible with devilspie or wmctrl.
https://superuser.com/questions/226505/ … ottom-most
Good luck with the project.
Last edited by misko_2083 (2018-05-17 21:57:29)
Што ни оштровиди ум сагледати не може - љубав превазилази.
Offline
Hi Misko, Thank you for your feedback and humor then that xcfe 46 panel link gave me a head ache. That is a lot of panels !!!
The example in my video is 100% bash & yad and it is usable on both Debian - Q4OS Linux and Bunsenlabs without any changes to the bash (yad) programming.
--------------------------------------
I would like to place 40 Yad Form Buttons in 1 Yad Window and have them wrap automatically to create multiple rows, top to bottom in a single Yad Window.
Is above possible ??
------------------------------
If above is not possilbe with auto wrap Not possible, I will create multiply panels.
Can I display these panels one at a time using Yad Icon using Yad Geometry ?
Thank You and very much appreciate your wit, humor and awesome help !!
Bobby
Offline
Hi Misko, Thank you for your feedback and humor then that xcfe 46 panel link gave me a head ache. That is a lot of panels !!!
The example in my video is 100% bash & yad and it is usable on both Debian - Q4OS Linux and Bunsenlabs without any changes to the bash (yad) programming.
--------------------------------------
I would like to place 40 Yad Form Buttons in 1 Yad Window and have them wrap automatically to create multiple rows, top to bottom in a single Yad Window.
Is above possible ??
------------------------------
If above is not possilbe with auto wrap Not possible, I will create multiply panels.
Can I display these panels one at a time using Yad Icon using Yad Geometry ?Thank You and very much appreciate your wit, humor and awesome help !!
Bobby
Hey Bobby C. yad isn't the right tool for this.
You can check the app "Xlunch".
Xlib and Imlib2 are dependancies, might need libimlib2-dev for compiling.
On jessie based I had to add extra flag -std=c99 in the makefile because of some increment in the for loops.
CFLAGS ?= -O2 -s -std=c99
It's one ARGB window that can be used as a launcher. No idea how it will behave with the Openbox. With JWM (or maybe just with puppy linux) it couldn't find the 32bit visuals, http://www.murga-linux.com/puppy/viewtopic.php?t=113839, I havent tested in BunsenLabs...
Last edited by misko_2083 (2018-07-12 20:45:31)
Што ни оштровиди ум сагледати не може - љубав превазилази.
Offline
Some fun.
Requires xloadimage and xdotool.
This a paned dialog.
- First tab is being redrawn with xloadimage. Reads all the .png images in $HOME/Pictures and draws on tab 1.
- Second tab is a simple progress bar.
#!/bin/bash
id="$((${RANDOM}+$RANDOM))"
yad --class tab-slideshow --plug=$id --tabnum=1 --text="\n\n\n\t\t\tLoading" & TAB_PID=$!
for num in {1..100}; do echo "# Progress : ${num} %"; echo "$num"; sleep 1; done | yad --plug=$id --tabnum=2 --progress &
yad --paned --class "yad-slideshow" --key=$id --tab="tab1" --tab="tab2" --active-tab='2' --width=900 --height=600 --splitter=500 --fixed & YPID=$!
# Wait untill the tab is created, that is until window name appears
until xdotool getwindowname "$(xdotool search --any --pid $TAB_PID --class "tab-slideshow" 2>/dev/null | tail -1 2>/dev/null)" &>/dev/null; do
# sleep until the window opens
sleep .1
done
# Decimal window id
WindowID="$(xdotool search --class "tab-slideshow" 2>/dev/null | tail -1)"
# Hexadecimal, that's what xloadimage accepts
WindowIDHex=$(printf "0x%08x" ${WindowID})
sleep .5
while true; do
for NAME in $HOME/Pictures/*.png; do xloadimage -windowid $WindowIDHex "$NAME" -quiet 2>/dev/null
sleep 1
done
done & XLOAD_IMAGE=$!
wait $YPID
kill -SIGKILL $XLOAD_IMAGE
exit 0
Last edited by misko_2083 (2018-09-05 20:26:16)
Што ни оштровиди ум сагледати не може - љубав превазилази.
Offline
Hi guys. Thank you so much for all of your tutorials here.
Before going any further, I feel it's only appropriate that I let you know that...I'm the (cough...cough) "developer" of MiyoLinux. You may (or may not) be familiar with it (?). LOL!
I use yad for some of the "Accessories" that I include in Miyo. However, to be honest, I'm no code expert. I usually just scratch, claw, and hack until I get things working.
I'm wondering if anyone here would be willing to help me with something that I would like to accomplish? I have searched and searched but have come up empty.
I'm not here to advertise MiyoLinux; I'm genuinely here to ask for help. So, before I actually go any further...and out of respect for bl and all that you do, I will wait to make sure that my request is okay. If a moderator feels this is inappropriate and wants to remove this post, I understand and thank you anyway.
Respectfully,
miyo
Offline
^ your request is ok, but it's hard to say more if you don't actually ask the question.
Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos
Offline
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
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).
Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos
Offline
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.
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.
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
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
Што ни оштровиди ум сагледати не може - љубав превазилази.
Offline
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
That is some hack. I admire the ingenuity.
Offline
I would be honored if you will allow me to acknowledge you for this in the future.
It's fine by me.
That is some hack. I admire the ingenuity.
@malm Just luck, I guess.
Што ни оштровиди ум сагледати не може - љубав превазилази.
Offline
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.
Offline
This is what I was working two days ago.
List for panel launchers that behaves similar to jgmenu.
#!/bin/bash
#######################################################
# Description: #
# bash script to run dropdown list #
# via yad list UI #
#######################################################
ERR(){ echo "ERROR: $1" 1>&2; }
declare -i DEPCOUNT=0
for DEP in /usr/bin/{xdotool,yad,xargs,printf,strace} /bin/echo; {
[ -x "$DEP" ] || {
ERR "$LINENO Dependency '$DEP' not met."
DEPCOUNT+=1
}
}
[ $DEPCOUNT -eq 0 ] || exit 1
VERSION=`yad --version | awk '{ print $1 }'`
verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
verlt() {
[ "$1" = "$2" ] && return 1 || verlte $1 $2
}
if verlt $VERSION 0.38.2; then
yad --text=" The version of yad installed is too old for to run this program, \n Please upgrade yad to a version higher than 0.38.2 " \
--button="gtk-close"
exit
fi
# Ensures only one instance of this scipt can start
# Also, if there is another yad window closes it
if [[ $(pgrep -c $(basename $0)) -ne 1 ]]; then
pids="$(xdotool search --class "yad_launcer")"
wpid="$(xdotool getwindowfocus)"
for pid in $pids; do
# Compares window class pid with the pid of a window in focus
if [[ "$pid" == "$wpid" ]]; then
xdotool windowunmap $pid
exit 1
fi
done
fi
#######################################################
# Here you define columns: #
# icon, command, application name, description #
# #
#######################################################
# --- You can change this part
# For the icons you can also write full path
# [key]="icon"
declare -A ICON=(
[0]="aqualung"
[1]="gtk-ok"
[2]="gcolor2"
[3]="gweled"
[4]="minitube"
[5]="gtk-ok"
[6]="qmmp"
[7]="shutter"
)
# [key]="command"
declare -A APPS=(
[0]="/usr/bin/aqualung"
[1]="/usr/bin/frozen-bubble"
[2]="/usr/bin/gcolor2"
[3]="/usr/games/gweled"
[4]="/usr/bin/minitube"
[5]="/usr/bin/neverball"
[6]="/usr/bin/qmmp"
[7]="/usr/bin/shutter"
)
# Application name for the column
# [key]="app name"
declare -A APP_NAME=(
[0]="Aqualung"
[1]="Frozen Bubble"
[2]="Gcolor2"
[3]="Gweled"
[4]="Mini Tube"
[5]="Neverball"
[6]="Qmmp"
[7]="Shutter"
)
# [key]="description"
declare -A APP_DESC=(
[0]="Music player"
[1]="Game"
[2]="Color selector"
[3]="Puzzle game"
[4]="Youtube"
[5]="Game"
[6]="Music player"
[7]="For screenshots"
)
APP_TITLE="Launcher"
# Activation method can be select or dclick
# select - run application on selection
# dclick - run application on double-click
ACTION=select
# --- Don't change anything bellow'
_list()
{
for k in "${!APPS[@]}"; do
printf "%s\n%s\n%s\n%s\n" "${ICON[$k]}" "${APPS[$k]}" "${APP_NAME[$k]}" "${APP_DESC[$k]}"
done
}
_list | yad --list \
--title="$APP_TITLE" \
--column="icon":IMG \
--column="Command" \
--column="Application" \
--column="Description" \
--width="500" \
--height="450" \
--hide-column="2" \
--$ACTION-action="sh -c \"echo %s | cut -d ' ' -f 2 2>&1 | xargs sh -c >/dev/null 2>&1\"" \
--no-buttons \
--search-column=3 \
--window-icon="xfce4-desktop" \
--undecorated \
--close-on-unfocus \
--on-top \
--skip-taskbar \
--mouse \
--sticky \
--class="yad_launcer" & ICONS_PID=$!
# Command is executed when SIGCHLD signal is emited
# Monitor for SIGCHLD signal and exit 252
# Exit if SIGCHLD is emited
strace -p $ICONS_PID -e trace=signal -s 32 2>&1 \
| while read -r line; do
if [[ $line =~ "--- SIGCHLD" ]];then
# Close on launch
exit 0
elif [[ $line == "+++ exited with 252 +++" ]]; then
# Yad is closed on unfocus or Escape keypress
exit 252
fi
done
Tried the same with icons dialog but the icons are scatered inside the dialog.
#!/bin/bash
#######################################################
# Description: #
# bash script to run icons popup launcher #
# via yad list UI #
#######################################################
ERR(){ echo "ERROR: $1" 1>&2; }
declare -i DEPCOUNT=0
for DEP in /usr/bin/{xdotool,yad,strace} /bin/echo; {
[ -x "$DEP" ] || {
ERR "$LINENO Dependency '$DEP' not met."
DEPCOUNT+=1
}
}
[ $DEPCOUNT -eq 0 ] || exit 1
VERSION=`yad --version | awk '{ print $1 }'`
verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
verlt() {
[ "$1" = "$2" ] && return 1 || verlte $1 $2
}
if verlt $VERSION 0.38.2; then
yad --text=" The version of yad installed is too old for to run this program, \n Please upgrade yad to a version higher than 0.38.2 " \
--button="gtk-close"
exit
fi
# Ensures only one instance of this scipt can start
# Also, if there is another yad window closes it
if [[ $(pgrep -c $(basename $0)) -ne 1 ]]; then
pids="$(xdotool search --class "yad_fullscreen_launcer")"
wpid="$(xdotool getwindowfocus)"
for pid in $pids; do
# Compares window class pid with the pid of a window in focus
if [[ "$pid" == "$wpid" ]]; then
xdotool windowunmap $pid
exit 1
fi
done
fi
yad --icons \
--read-dir=/usr/share/applications \
--width="400" \
--height="500" \
--mouse \
--item-width=2 \
--sort-by-name \
--undecorated \
--single-click \
--skip-taskbar \
--close-on-unfocus \
--class="yad_fullscreen_launcer" \
--no-buttons & ICONS_PID=$!
# Command is executed when SIGCHLD signal is emited
# Monitor for SIGCHLD signal and exit 252
# Exit if SIGCHLD is emited
strace -p $ICONS_PID -e trace=signal -s 32 2>&1 \
| while read -r line; do
if [[ $line =~ "--- SIGCHLD" ]];then
# Close on launch
exit 0
elif [[ $line == "+++ exited with 252 +++" ]]; then
# Yad is closed on unfocus or Escape keypress
exit 252
fi
done
No idea how to have icons lined up.
Што ни оштровиди ум сагледати не може - љубав превазилази.
Offline
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.
Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos
Offline
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
^Quite, nice tool. Thanks damo for pointing it out!
Postpone all your duties; if you die, you won't have to do them ..
Offline
Nice tool indeed Damo. Built with Haskell too.
Offline
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.
Certain arithmetic operations are permitted for declared integer variables without the need for expr or let.
declare -i INTEGER
INTEGER+=1
echo $INTEGER
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.
I'll use quotes more frequently for you guys.
When the script doesn't work I use bash -x scriptname
Што ни оштровиди ум сагледати не може - љубав превазилази.
Offline
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.
Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos
Offline
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'
--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), idle Twitterings and GitStuff )
Offline
Thanks for the suggestions ohnonot and johnraf.
Што ни оштровиди ум сагледати не може - љубав превазилази.
Offline
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
^ 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