Hey guys! Quick question. I’m playing with bash, to be more exact Woeusb. I was just wondering is it possible to report the progress in a kidalog progressbar.<\/p>\n
Here’s what i have<\/p>\n
\n
AdvertisementBlockquote#!/bin/bash
\nPASSWORD=$(kdialog --title “Enter Root password” --password “Enter your password to run the script as root”)
\noutput=$(kdialog --getopenfilename “Select iso file” “select iso” --title “Select iso file”)
\nanswer=$(kdialog “Select sub drive” --combobox “Select USB Device” $(lsblk --nodeps --paths --output NAME,TRAN | grep usb | awk ‘{print $1}’))
\necho “$PASSWORD” | sudo -S bash -c woeusb --device if=$output of=$anaswer<\/p>\n<\/blockquote>\nI would love any feedback you can offer.<\/p>\n
Regards:<\/p>\n
TheYikes<\/p>","upvoteCount":1,"answerCount":6,"datePublished":"2024-11-29T18:21:26.126Z","author":{"@type":"Person","name":"theyikes","url":"https://community.spiceworks.com/u/theyikes"},"suggestedAnswer":[{"@type":"Answer","text":"
Hey guys! Quick question. I’m playing with bash, to be more exact Woeusb. I was just wondering is it possible to report the progress in a kidalog progressbar.<\/p>\n
Here’s what i have<\/p>\n
\nBlockquote#!/bin/bash
\nPASSWORD=$(kdialog --title “Enter Root password” --password “Enter your password to run the script as root”)
\noutput=$(kdialog --getopenfilename “Select iso file” “select iso” --title “Select iso file”)
\nanswer=$(kdialog “Select sub drive” --combobox “Select USB Device” $(lsblk --nodeps --paths --output NAME,TRAN | grep usb | awk ‘{print $1}’))
\necho “$PASSWORD” | sudo -S bash -c woeusb --device if=$output of=$anaswer<\/p>\n<\/blockquote>\nI would love any feedback you can offer.<\/p>\n
Regards:<\/p>\n
TheYikes<\/p>","upvoteCount":1,"datePublished":"2024-11-29T18:21:26.185Z","url":"https://community.spiceworks.com/t/linux-show-proccess-in-progressbar/1148103/1","author":{"@type":"Person","name":"theyikes","url":"https://community.spiceworks.com/u/theyikes"}},{"@type":"Answer","text":"
or if it’s any easier perhaps i could try DD instead of woeusb.<\/p>","upvoteCount":0,"datePublished":"2024-11-29T19:13:07.543Z","url":"https://community.spiceworks.com/t/linux-show-proccess-in-progressbar/1148103/2","author":{"@type":"Person","name":"theyikes","url":"https://community.spiceworks.com/u/theyikes"}},{"@type":"Answer","text":"
OK i tried using<\/p>\n
echo “$PASSWORD” | sudo -S dd if=/dev/sda of=/dev/sdb bs=4M status=progress | kdialog --progressbar “Copying Data” 100<\/p>\n
but the progress bar isn’t changing.<\/p>","upvoteCount":0,"datePublished":"2024-11-29T19:32:02.129Z","url":"https://community.spiceworks.com/t/linux-show-proccess-in-progressbar/1148103/3","author":{"@type":"Person","name":"theyikes","url":"https://community.spiceworks.com/u/theyikes"}},{"@type":"Answer","text":"
i attempted to run “echo “$PASSWORD” | sudo -S bash -c dd if=$output of=$answer bs=4M status=progress | kdialog --progressbar “Copying Data” 100”
\nbut i keep getting this error.
\nkf.kio.core: KFileFilter::fromMimeType() called with empty input
\nkf.kio.core: KFileFilter::fromMimeType() called with unknown MIME type “select”
\nkf.kio.core: KFileFilter::fromMimeType() called with unknown MIME type “iso”
\n0+1 records in
\n0+1 records out
\n7 bytes copied, 5.7094e-05 s, 123 kB/s
\norg.kde.kdialog-86647 /ProgressDialog<\/p>","upvoteCount":0,"datePublished":"2024-11-29T19:38:01.465Z","url":"https://community.spiceworks.com/t/linux-show-proccess-in-progressbar/1148103/4","author":{"@type":"Person","name":"theyikes","url":"https://community.spiceworks.com/u/theyikes"}},{"@type":"Answer","text":"The issue you are having is that dialog (or the K version) doesn’t know how to parse the output of ‘dd’ or ‘woeusb’ (that isn’t one I’ve heard of). Try using ‘pv’ - the progress viewer - it acts like ‘cat’ with statistics.<\/p>\n
echo \"$PASSWORD\" | sudo -S pv -n -s $(du -sb ${output} | awk '{print $1}') ${output} > ${answer} | kdialog --progressbar “Copying Data” 100<\/code><\/p>\n
A thing to note - this is going to overwrite ${Answer} with the contents of ${Output} - that seems backwards to me.<\/p>","upvoteCount":1,"datePublished":"2024-11-30T14:31:23.957Z","url":"https://community.spiceworks.com/t/linux-show-proccess-in-progressbar/1148103/5","author":{"@type":"Person","name":"stevejones4947","url":"https://community.spiceworks.com/u/stevejones4947"}},{"@type":"Answer","text":"
Oh my god two things, first thanks for getting back to me so quickly, I’ll play around with you script later. Second… LinuxMonger!!! What a wicked name!!!<\/p>","upvoteCount":0,"datePublished":"2024-11-30T16:56:24.825Z","url":"https://community.spiceworks.com/t/linux-show-proccess-in-progressbar/1148103/6","author":{"@type":"Person","name":"theyikes","url":"https://community.spiceworks.com/u/theyikes"}}]}}