Development > Scripting and Bash

Preview and download images and files with zenity dialog

(1/1)

anon222:
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: ---#!/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
--- End code ---

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: ---#!/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
--- End code ---

This oone opens www.linuxliteos.com/forums/ and does nothing special :)
No link can be used or clicked.

--- Code: ---#!/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
--- End code ---

The last one opens a local index.html file but doesn't load any images.

--- Code: ---#!/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
--- End code ---
Anyway the script can be used instead of --question dialog
Just need to replace  'zenity --info --text="You clicked OK"' with a command.

Navigation

[0] Message Index

Go to full version