YAD - Tips
Keyboard instead of Mouse
Hello everybody,
How can I move with the keyboard instead of the mouse in a selection dialog created with "--file-selection"?
Best regards, Achim
How can I move with the keyboard instead of the mouse in a selection dialog created with "--file-selection"?
Best regards, Achim
- misko_2083
- Posts: 114
- Joined: Tue 08 Nov 2016, 13:42
Re: Keyboard instead of Mouse
Tab to change the focus to another widget, then arrow keys up and down.achim wrote:Hello everybody,
How can I move with the keyboard instead of the mouse in a selection dialog created with "--file-selection"?
Best regards, Achim
To get to the right pane when you open a yad file selection press shift+tab.
Re: Keyboard instead of Mouse
Thanks misko_2083!misko_2083 wrote:Tab to change the focus to another widget, then arrow keys up and down.achim wrote:Hello everybody,
How can I move with the keyboard instead of the mouse in a selection dialog created with "--file-selection"?
Best regards, Achim
To get to the right pane when you open a yad file selection press shift+tab.
cpu temperature monitor
Say I have a folder holding icons showing temperatures from 10C to
105C. My bash script finds the temp and selects the appropriate icon.
How using yad can I place the icon in the tray? I would arrange to do
this "find temp and display icon" loop every few seconds.
Edit: The icons are from an old tempicon app having .svg extensions,
if that's a concern or consideration. Maybe they can be converted if
necessary.
Art
105C. My bash script finds the temp and selects the appropriate icon.
How using yad can I place the icon in the tray? I would arrange to do
this "find temp and display icon" loop every few seconds.
Edit: The icons are from an old tempicon app having .svg extensions,
if that's a concern or consideration. Maybe they can be converted if
necessary.
Art
Hey Misko, thanks anyway, but I have no idea how to implement your code in yradio, if you feel like it sometime, maybe you want to do it ?misko_2083 wrote:Fredx181, if you want to make one, even simpler version of yradio,
you can use the list for navigation between the radio categories and stations.
Here's an example with the notification icon.
....
....
(also I'm not sure if I understand what the improvement exactly can be , but it sounds promising what you're suggesting )
Fred
Want to make a YAD Gui Camera Image viewing program.
Any pointers will be appreciated.
I have security cameras that use proprietary Web view apps but, if my internet is down I can not see my camera output. I can though, capture snapshots from each camera locally using a URL -- *.cgi script in each camera. Here is the flow I want to acomplish.
1. Use wget to get image form camera http:/admin:pw@192.168.1.100 (Done, this works)
2. wget saves images to snampshot.cgi.1, snapshot.cgi.2, snapshot.cgi.3, etc. (every 3 seconds). (Done)
Need to do this:
A. Rename files:
rename snapshot1.cgi.1 ---> camera0000001.jpg
rename snapshot1.cgi.2 ---> camera0000002.jpg
rename snapshot1.cgi.1 ---> camera0000003.jpg
etc........
Use DevedeNG to make a DVD video out of the files, 1 hour long video file.
This will work on Amcrest Cameras and many others. Once it is done, I'll give credit to all and put it on Github under GPL License 2.1+.
I am just stuck at the Renaming part.
Thanks, Bobby
I have security cameras that use proprietary Web view apps but, if my internet is down I can not see my camera output. I can though, capture snapshots from each camera locally using a URL -- *.cgi script in each camera. Here is the flow I want to acomplish.
1. Use wget to get image form camera http:/admin:pw@192.168.1.100 (Done, this works)
2. wget saves images to snampshot.cgi.1, snapshot.cgi.2, snapshot.cgi.3, etc. (every 3 seconds). (Done)
Need to do this:
A. Rename files:
rename snapshot1.cgi.1 ---> camera0000001.jpg
rename snapshot1.cgi.2 ---> camera0000002.jpg
rename snapshot1.cgi.1 ---> camera0000003.jpg
etc........
Use DevedeNG to make a DVD video out of the files, 1 hour long video file.
This will work on Amcrest Cameras and many others. Once it is done, I'll give credit to all and put it on Github under GPL License 2.1+.
I am just stuck at the Renaming part.
Thanks, Bobby
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Re: Want to make a YAD Gui Camera Image viewing program.
Trylamplinux wrote:A. Rename files:
rename snapshot1.cgi.1 ---> camera0000001.jpg
rename snapshot1.cgi.2 ---> camera0000002.jpg
Code: Select all
cd /path/to/snapshots
for f in snapshot1.cgi* ; do mv $f $(printf 'camera%07d.jpg' ${f##*.}); done
Re: cpu temperature monitor
artsown wrote:Say I have a folder holding icons showing temperatures from 10C to
105C. My bash script finds the temp and selects the appropriate icon.
How using yad can I place the icon in the tray? I would arrange to do
this "find temp and display icon" loop every few seconds.
Edit: The icons are from an old tempicon app having .svg extensions,
if that's a concern or consideration. Maybe they can be converted if
necessary.
Art
Code: Select all
mkfifo /tmp/PIPE
exec 4<> /tmp/PIPE
yad --notification --listen <& 4 &
echo "icon:/path/105c.svg" >/tmp/PIPE
EDIT: to clarify, only the 'echo "icon:/*.svg" >/tmp/PIPE' statement needs to be in your loop, which means the icon name needs to be represented with a variable.
Code: Select all
echo "icon:${PATH}${temp}.svg" >/tmp/PIPE
Code: Select all
echo "tooltip:temperature is ${temp}" >/tmp/PIPE
echo "menu:Refresh Temp!bash -c command!/path/to/icon.svg|" >/tmp/PIPE
Rather than storing pre-created svg temperature value files, if you have image magick installed then you could create images dynamically
That creates a .png, so you'd have to amend the code that stemsee posted to
Code: Select all
# Requires imagemagick
temp=113 # temperature value hard coded here
convert \
-size 32x32 \
xc:lightblue \
-font DejaVu-Sans \
-pointsize 18 \
-fill black \
-gravity center \
-draw "text 0,0 '${temp}'" \
image.png
Code: Select all
echo "icon:/path/image.png" >/tmp/PIPE
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]
Yad notification screen rotation. Left Click icon for normal. Right click for menu.
edit
this version changes the trray icon to indicate rotation, using up down left right arrows (make your own!)
EDIT: I added /etc/rotate file to remember last orientation so it could be reused easily/auotmatically
Code: Select all
#!/bin/sh
connected=`xrandr | grep connected | cut -f1 -d' ' | head -1`
yad --notification --listen --text="Rotate Screen" --tray-icon="/usr/share/pixmaps/picdrop.png" --command="bash -c 'xrandr --output $connected --rotate normal'" --menu="Rotate Left!xrandr --output $connected --rotate left!|Rotate right!xrandr --output $connected --rotate right!|Rotate Inverted!xrandr --output $connected --rotate inverted!|"
this version changes the trray icon to indicate rotation, using up down left right arrows (make your own!)
Code: Select all
#!/bin/sh
mkfifo /tmp/RPIPE
exec 3<> /tmp/RPIPE
export connected=`xrandr | grep connected | cut -f1 -d' ' | head -1`
function left (){
xrandr --output $connected --rotate left
echo "icon:/usr/share/pixmaps/left.png" >/tmp/RPIPE
}; export -f left
function right (){
xrandr --output $connected --rotate right
echo "icon:/usr/share/pixmaps/right.png" >/tmp/RPIPE
}; export -f right
function inverted (){
xrandr --output $connected --rotate inverted
echo "icon:/usr/share/pixmaps/inverted.png" >/tmp/RPIPE
}; export -f inverted
function normal (){
xrandr --output $connected --rotate normal
echo "icon:/usr/share/pixmaps/normal.png" >/tmp/RPIPE
}; export -f normal
yad --notification --listen --text="Rotate Screen" --tray-icon="/usr/share/pixmaps/normal.png" --command="bash -c normal" --menu="Rotate Left!bash -c left!/usr/share/pixmaps/left.png|Rotate right!bash -c right!/usr/share/pixmaps/right.png|Rotate Inverted!bash -c inverted!/usr/share/pixmaps/inverted.png|" <&3
Code: Select all
#!/bin/sh
# yad tray screen rotation "ytsr" b stemsee
# copyright (c) 2019 Marcos M Contant
[[ "`whoami`" != "root" ]] && exec sudo -E -S ${0} "$\""
running=`ps -e | grep rotate | wc -l`
[[ "$running" -gt 2 ]] && exit #check if running, one instance only
export OUTPUT_CHARSET=UTF-8
mkfifo /tmp/RPIPE
exec 3<> /tmp/RPIPE
export connected=`xrandr | grep connected | cut -f1 -d' ' | head -1`
function left (){
xrandr --output $connected --rotate left
echo "icon:/usr/share/pixmaps/left.png" >/tmp/RPIPE
echo "left" >/etc/rotate
}; export -f left
function right (){
xrandr --output $connected --rotate right
echo "icon:/usr/share/pixmaps/right.png" >/tmp/RPIPE
echo "right" >/etc/rotate
}; export -f right
function inverted (){
xrandr --output $connected --rotate inverted
echo "icon:/usr/share/pixmaps/inverted.png" >/tmp/RPIPE
echo "inverted" >/etc/rotate
}; export -f inverted
function normal (){
xrandr --output $connected --rotate normal
echo "icon:/usr/share/pixmaps/normal.png" >/tmp/RPIPE
echo "normal" >/etc/rotate
}; export -f normal
function restate (){
state=`cat /etc/rotate`
[[ -z "$state" ]] && state=normal
xrandr --output $connected --rotate $state
echo "icon:/usr/share/pixmaps/$state.png" >/tmp/RPIPE
echo "$state" >/etc/rotate
}; export -f restate
bash -c restate &
yad --notification --listen --text="Rotate Screen" --tray-icon="/usr/share/pixmaps/normal.png" --command="bash -c normal" --menu="Rotate Left!bash -c left!/usr/share/pixmaps/left.png|Rotate right!bash -c right!/usr/share/pixmaps/right.png|Rotate Inverted!bash -c inverted!/usr/share/pixmaps/inverted.png|" <&3
- Attachments
-
- 2019-07-10-150857_257x150_scrot.png
- (9.88 KiB) Downloaded 311 times
Last edited by stemsee on Wed 31 Jul 2019, 13:38, edited 1 time in total.
YAD Wrapper for youtube-dl
Hello everybody,
The code "YAD Wrapper for youtube-dl" by Misko-2083 (http://murga-linux.com/puppy/viewtopic. ... &start=300) needs to be changed slightly. The URL is no longer valid. Unfortunately I do not know the new address, so I need your help for the correction.
Many thanks
The code "YAD Wrapper for youtube-dl" by Misko-2083 (http://murga-linux.com/puppy/viewtopic. ... &start=300) needs to be changed slightly. The URL is no longer valid. Unfortunately I do not know the new address, so I need your help for the correction.
Many thanks
Code: Select all
...
function ytdl_version () {
echo "#Checking youtube-dl version" >> "$ytdpipe"
wget --spider --user-agent="Mozilla/5.0 Gecko/20100101" --timeout=30 -q "https://rg3.github.io/youtube-dl/" -O /dev/null
if [[ "$?" -ne "0" ]]; then
echo "#Can't connect to youtube-dl server site" >> "$ytdpipe"
fi
ytdlcv=$(youtube-dl --version)
ytdllv=$(wget -O- -q "https://rg3.github.io/youtube-dl/update/LATEST_VERSION")
if [[ "$ytdlcv" == "$ytdllv" ]]; then
echo "#youtube-dl is up-to-date" >> "$ytdpipe"
else
echo "#youtube-dl update is available" >> "$ytdpipe"
fi
}
...
Hi achim, can't see what's wrong with the code (or url), to test I removed the writing to pipe ( >> "$ytdpipe") and it checks ok for me if a youtube-dl update is available or not.
Output:
Fred
Code: Select all
function ytdl_version () {
echo "#Checking youtube-dl version"
wget --spider --user-agent="Mozilla/5.0 Gecko/20100101" --timeout=30 -q "https://rg3.github.io/youtube-dl/" -O /dev/null
if [[ "$?" -ne "0" ]]; then
echo "#Can't connect to youtube-dl server site"
fi
ytdlcv=$(youtube-dl --version)
ytdllv=$(wget -O- -q "https://rg3.github.io/youtube-dl/update/LATEST_VERSION")
if [[ "$ytdlcv" == "$ytdllv" ]]; then
echo "#youtube-dl is up-to-date"
else
echo "#youtube-dl update is available"
fi
}
ytdl_version
Code: Select all
# ytdl_version
#Checking youtube-dl version
#youtube-dl is up-to-date
accept input at timeout
Hello,
Can yad accept input at timeout, without hitting enter or OK? Like this:
Sorry if the answer is somewhere in this long thread; I looked Thanks in advance
Can yad accept input at timeout, without hitting enter or OK? Like this:
Code: Select all
z=`Xdialog --timeout 5 --interval 5000 --stdout --inputbox "Enter a number and wait" 0 0` ; echo $z
I don't think it can but I'll be happy to stand corrected. There's an --always-print-result option, but the yad manual says
--always-print-result
Print result for any of the return codes. This options doesn't work if timeout was reached or Escape was pressed.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]
Re: accept input at timeout
NiceWognath wrote:Can yad accept input at timeout, without hitting enter or OK? Like this:Code: Select all
z=`Xdialog --timeout 5 --interval 5000 --stdout --inputbox "Enter a number and wait" 0 0` ; echo $z
SIGUSR1: Close dialog with 0 exit code.
If more than one yad running:
Code: Select all
yad --entry > /tmp/z & sleep 5 ; pkill -SIGUSR1 yad ; z=$(</tmp/z)
If more than one yad running:
Code: Select all
yad --title unique ... pkill -SIGUSR1 -f "yad.*unique"
Code: Select all
z=$(yad --entry & sleep 5 ; pkill -SIGUSR1 yad)
Code: Select all
z=$(timeout -s SIGUSR1 5 yad --entry)