You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



Preview and download images and files with zenity dialog

Author (Read 11950 times)

0 Members and 1 Guest are viewing this topic.

Preview and download images and files with zenity dialog
« Reply #1 on: October 02, 2014, 09:38:09 PM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
I've experimented with --text-info, I've discovered it is possible to view and download images and any other files with it with just drag and drop.
Hrere we go, with this it's easy to quick grab images.
This script opens Scot(0)'s image from imgur.com in zenity dialog
Image can be dragged to the Desktop.
It will copy the image to the Desktop.
--checkbox can be removed here :)
Code: [Select]
#!/bin/bash
zenity --text-info --title="Forums" --width=1000 --height=800  --html --url="http://i.imgur.com/7izQZgD.jpg" --checkbox="I'm sure I want to remove Windows"
if [ "$?" -eq "0" ];then
      zenity --info --text="You clicked OK,\nWindows destroyed. :)"
else
       exit 0
fi

This script opens /github.com/linuxlite/litesoftware
Find a button 'Download ZIP', drag it to the desktop
It will copy master.zip on the Desktop
Code: [Select]
#!/bin/bash
zenity --text-info --title="Forums" --width=1000 --height=800  --html --url="https://github.com/linuxlite/litesoftware"
if [ "$?" -eq "0" ];then
      zenity --info --text="You clicked OK"
else
       exit 0
fi

This oone opens www.linuxliteos.com/forums/ and does nothing special :)
No link can be used or clicked.
Code: [Select]
#!/bin/bash
zenity --text-info --title="Forums" --width=850 --height=800  --html --url="http://www.linuxliteos.com/forums/"
if [ "$?" -eq "0" ];then
      zenity --info --text="You clicked OK"
else
       exit 0
fi

The last one opens a local index.html file but doesn't load any images.
Code: [Select]
#!/bin/bash
zenity --text-info --title="Forums" --width=850 --height=800  --html --filename="/usr/share/doc/litemanual/index.html"
if [ "$?" -eq "0" ];then
      zenity --info --text="You clicked OK"
else
       exit 0
fi
Anyway the script can be used instead of --question dialog
Just need to replace  'zenity --info --text="You clicked OK"' with a command.
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section