Awesome WM - panel & script question

Hi forum, I want to ask how can I show text output from my bash scripit in awesome panel. I cannot find any help on the Internet...

JackH79 wrote:
You could also make up your own widget. Try something like:
-- myScript Widget
local function script_output()
local f = io.popen("/home/me/my_script")
local out = f:read("*a")
f:close()
return { out }
end
mywidget = widget({ type = "textbox" })
vicious.register(mywidget, script_output, "$1")
Edit: the function should be local. Also, come to think of it, you could also pipe your script output to naughty.notify via notify-send if that fits your needs.
You can use aweful.util.pread instead of popen, read, and close.
-- myScript Widget
local function script_output()
return { awful.util.pread("/home/me/my_script") }
end
mywidget = widget({ type = "textbox" })
vicious.register(mywidget, script_output, "$1")

Similar Messages

  • Quick SAP Script question New Page Print

    Quick SAP Script question
    I have added a new page to an existing SAP Script BUT only want it to print if a condition is true.
    I need to do this from within the form as the print program is SAP Std.
    Any idea how I can prevent the new page from printing?
    i.e. I need the form NOT to call the new page if the condition is false. Is there a way of forcing an exit or stop from with in the form?

    Hi,
    To trigger a new page, there is script ediotr command NEW-PAGE.
    so find where is that command is triggered and use the below code for trigger it on any specific condition....
    if &condition& = 'True'
    /*  NEW-PAGE
    elseif
    /: NEW-PAGE   
    endif
    so it means if condition is satisfied your new page will not work.. else it will...
    Hope you got it...
    Try this..
    Best luck..
    Regs,
    Lokesh.

  • Scripting Question - Very Basic

    Hello, I'm using the trial version of InDesign and am wondering if because it's the trial version that I can't load custom scripts from Adobe?  I've downloaded and installed a Custom Calendar script [I can see the extracted files in/on my PC] but the app apparently doesn't see it.  Any help you can offer is greatly appreciated.  Thanks, 

    Thank you so much, you were spot on. 
    From: Peter Spier <[email protected]>
    To: Friar5 <[email protected]>
    Sent: Monday, December 12, 2011 3:18 PM
    Subject: Scripting Question - Very Basic
    Re: Scripting Question - Very Basic created by Peter Spier in InDesign - View the full discussion
    Have you put thew script in a location that InDesign uses for scripts? See How to install scripts in InDesign | InDesignSecrets
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4079869#4079869
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4079869#4079869. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in InDesign by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Quick script question

    Hi all,
    Could anyone advise me if i can add anything within - header('Location: http://www.mysite.co.uk/thankyou.html'); in the script below so as the page
    re- directs back to the main index page after a few seconds ?
    Thankyou for any help.
    <?php
    $to = '[email protected]';
    $subject = 'Feedback form results';
    // prepare the message body
    $message = '' . $_POST['Name'] . "\n";
    $message .= '' . $_POST['E-mail'] . "\n";
    $message .= '' . $_POST['Phone'] . "\n";
    $message .= '' . $_POST['Message'];
    // send the email
    mail($to, $subject, $message, null, '');
    header('Location: http://www.mysite.co.uk/thankyou.html');
    ?>

    andy7719 wrote:
    Mr powers gave me that script so im rather confused at this point in time
    I don't think I "gave" you that script. I might have corrected a problem with it, but I certainly didn't write the original script.
    What you're using is far from perfect, but to suggest it would lay you open to MySQL injection attacks is ludicrous. For you to be prone to MySQL injection, you would need to be entering the data into a MySQL database, not sending it by email.
    There is a malicious attack known as email header injection, which is a serious problem with many PHP email processing scripts. However, to be prone to email header injection, you would need to use the fourth argument of mail() to insert form data into the email headers. Since your fourth argument is null, that danger doesn't exist.
    One thing that might be worth doing is checking that the email address doesn't contain a lot of illegal characters, because that's a common feature of header injection attacks. This is how I would tidy up your script:
    <?php
    $suspect = '/Content-Type:|Bcc:|Cc:/i';
    // send the message only if the E-mail field looks clean
    if (preg_match($suspect, $_POST['E-mail'])) {
      header('Location: http://www.example.com/sorry.html');
      exit;
    } else {
      $to = '[email protected]';
      $subject = 'Feedback form results';
      // prepare the message body
      $message = 'Name: ' . $_POST['Name'] . "\n";
      $message .= 'E-mail: ' . $_POST['E-mail'] . "\n";
      $message .= 'Phone: ' . $_POST['Phone'] . "\n";
      $message .= 'Message: ' . $_POST['Message'];
      // send the email
      mail($to, $subject, $message);
      header('Location: http://www.example.com/thankyou.html');
      exit;
    ?>
    Create a new page called sorry.html, with a message along the lines of "Sorry, there was an error sending your message". Don't put anything about illegal attacks. Just be neutral.
    By the way, when posting questions here, don't use meaningless subject lines, such as "Quick script question". If you're posting here, it's almost certain to be a question about a script. It doesn't matter whether it's quick. Use the subject line to tell people what it's about.

  • Unique Script Questions-timed startup?

    Hello All,
    I am long time mac fanatic with some unusual script questions. I have a project ongoing where I will need to put my pb 15" in a remote location with a Canon camera. Canon has transmitter device which will allow me via ethernet to ftp to my pb.
    Here's essentially what I need to the script to do and I am trying to find out just how feasible this is. I need my laptop to bootup to receive photos via ftp at a certain time period. The camera will send to the builtin ftp software. Once booted I need the script to hold for period of about an hour. Once time has elapsed I need the script to connect to the internet via a broadband EVDO card. We are using one of the EVDO cards built in to Tiger. It then must ftp a folder of images to a remote server.
    Simple, huh? : ) I am running Transmit as my ftp software. I believe it is scriptable and will watch a folder to send.
    Any ideas? I'd love to hear them. I can be reached via scott at scottaudette.com.
    This setup is going be used in very cool photo location but I can't publicly announce where.
    Scott
    G5 and PB 15"   Mac OS X (10.4.7)  

    'Transmit ... I believe it is scriptable' - yes it is. Go to How can I use AppleScript with Transmit? to download sample 'Transmit' scripts.
    'Once booted I need the script to hold for period of about an hour.' - well then, save the script as a 'stay open' application, with an 'on idle () ... end idle' handler - with a return of (60 * 60) seconds; and then drag the saved application onto the 'System Preferences' 'Accounts' 'Login Items' tab's list - of the user which the Mac will boot to (when turned ON).
      Mac OS X (10.4.4)  

  • Can I post here(Acrobat Windows) Java Script questions here?

    Hello
    Can I post here(Acrobat Windows) Java Script questions here? If not, wht is the correct forum?
    THank you

    Back up and down to Acrobat Scripting. Bot Windows and MacIntosh Acrobat versions use the same JavaScript.
    If you are using LIVECYCLE DESIGNER use their forums. The JavaScript syntax and objects are different in LIVECYCLE DESIGNER!

  • Oracle Scripting Question

    Can any one of you let me know which is the relavant forum to post question on Oracle Scripting Module.
    Question:
    Using the graphical scripting mode what are the steps for using a check-box and proceeding to the next panel
    in a script.
    Thanks,
    Kalyan.

    Kalyan,
    Looks like you were working on Scripting in 2010...Did your project live?
    Does scripting work? I am not aware of any customer that uses scripting and therefore a bit hesitant to use it.
    Any feedback from you would be highly appreciated.
    Thanks
    Rahul

  • New Awesome setup, a few questions.

    Hello everyone.
    Been tinkering away all day on a new lightweight setup using the Awesome WM. I like it a lot, but I have a few simple questions. I've tried searching the forums and the wiki to no avail. Hopefully it isn't because I wasn't looking hard enough!
    1.) Background: I've got the background set using nitrogen, I like the tool! But it doesn't stay set on reboot. I'm sure this one is easy, but I can't figure it out. Also, I have to run the tool from a terminal in the directory with the wallpapers. Is there a way to set the default directory it looks for wallpapers at? Does it have one already that I just don't know?
    2.) Firefox: It runs well, but there are some UGLIES to sort out. I'm sure GTK2 theme is one of them. The text in the browser looks fine, but the top bar with the tabs and menus has a really ugly font. Any suggested gtk2 themes for the awesome wm? Any good apps for changing them or any good packages with a lot to choose from?
    3.) Launcher: is there a way to put "quick launch" style icons on the awesome menu bar?
    Sorry if these questions are bone head, I've been slamming my head all day agains the configuration of vim and urxvt and I just don't want to give up. Those things are beasts. I actually ended up ditching urxvt for the xfce terminal and i'm really happy with it.
    Any good suggestions for VIM themes?
    Just looking to take a break and process some of this stuff before diving back into the config files really. Sorry the questions are a bit scattered, maybe I should have posted this in the newbie corner...feel free to move it!
    Thanks!!

    Cool, got the nitrogen thing worked out just fine.
    I'm having troubles making vim look right in the terminal. The default color scheme seems to appear correctly...but when I do desert it doesn't look like it does in gvim. I'd prefer to use vim in the console, anyone using the xfce terminal and have vim looking right? any .Xdefaults I could take a look at to get it going right?
    I appreciate the feed back!

  • FLASH MX 2004 action script question

    Hi!
    I need to create an script for a basic function; when mouse goes over a moveclip, that works also link, I want it to trigger an invisible red dot on a nerby map. I have created a movieclip and named it "red", it's a 1 sec clip with nothing in the beginning and a red dot in the end. I want this dot to trigger and show only when mouse goes over this specific link, otherwise it must be invisible.
    I know this is pretty basic stuff and I have done this before few years back but I have forgotten how to do it and need help now.
    Any help would be very much appreciated :-)
    Kim

    I still need help, this problem is little more complicated;
    I can manage making the red dot visible and invisible by triggering roll over and roll out on a button.
    The problem is, I have a navbar which is line of flags made to a movie clip, with 5 invisible buttons. These buttons are configured to do three different actions; get URL, trigger a light effect and a movement effect.
    Now I need this invisible button to trigger my red dot also so that when mouse is over a certain flag a red dot appears on a map on the correct location.
    I have the red dot on a new layer. It has instance name "redDot" and on the very first frame of this red button layer, I have action script that says: redDot._visible = false;
    This works as it should and the dot is invisible when the movie has loaded.
    I need to make this invisible button to trigger the visibility of my red dot, and I have tried to add the code:
    on (rollOver) {
    redDot._visible = true;
    on (rollOut) {
    redDot._visible = false;
    to this invisible button, but it dosent work, furthermore it affects the other functions of the button/movie clip, which were working fine before.
    Here is the code attached to this invisible button so far:
    on (release) {
    getURL(/:url1);
    on (rollOver) {
    gotoAndPlay(2);
    on (rollOut) {
    gotoAndPlay("sec");
    I have the URL:s on an external text file.
    So my question is; where do I add the action script to make it visible when moving the mouse over this invisible button? To my understanding, it should go in the same place as the other code that is working, but I'm doing something wrong...
    I tried to do this:
    on (release) {
    getURL(/:url1);
    on (rollOver) {
    gotoAndPlay(2)
            redDot._visible = true;
    on (rollOut) {
    gotoAndPlay("sec")
    redDot._visible = false;
    But it is wrong, I also tried like this:
    on (release) {
    getURL(/:url1);
    on (rollOver) {
    gotoAndPlay(2);
    on (rollOut) {
    gotoAndPlay("sec");
    on (rollOver) {
    redDot._visible = true;
    on (rollOut) {
    redDot._visible = false;
    But it makes the other functions that worked to stop working.
    I also tried to give the invisible button an instance name and do it like this:
    invisible.on (rollOver) {
            redDot._visible = true;
    invisible.on (rollOut) {
    redDot._visible = false;
    And put them in the actions layer of button movie clip but nothing works.
    Flash is really giving me a headache now...
    To conclude, I made a simple test button, put it on the scene somewhere and and attached the rollOver and rollOut codes, targeting the "redDot" and it works fine, the button didn't need a instance name to work. I don't understand why I can't make it to work with the invisible button where it should be.
    I hope this clarifies the point and I can get some help with this and sorry for bothering again with this problem.
    Oh and I use old Flash MX 2004.
    Thanks
    Kim

  • Madwifi-ng preup/predown script question [solved]

    Hi,
    I recently installed Arch 0.7.1 on my laptop.
    So far I am very impressed with the speed and the simplicity :-)
    I just have one small problem: madwifi-ng
    Currently, I have to manually create the ath0 interface with wlanconfig, which is annoying. On the Gentoo forum I have found a partial script with preup/predown functions (the thread is located here)
    preup() {
    if [ "${IFACE}" == "ath0" ]; then
    /sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta > /dev/null
    return $?
    fi
    if mii-tool ${IFACE} 2> /dev/null | grep -q 'no link'; then
    ewarn "No link on ${IFACE}, aborting configuration"
    return 1
    fi
    return 0
    predown() {
    if [ "${IFACE}" == "ath0" ]; then
    killall wpa_supplicant
    /sbin/wlanconfig ath0 destroy
    return $?
    fi
    return 0
    I am using a Netgear WG511T pcmcia card.
    I would really appreciate any suggestions on where to put this code, and how to modify it for use with Arch Linux, or if I should use something else alltogether.
    Thanks in advance!

    Another interesting problem: I recently upgraded to the latest madwifi-ng code with svn update and also started using wpa_supplicant 0.5.0 (upgraded from 0.4.7)
    The netcfg script stopped working and after a little tinkering I discovered that  the following section from start_profile() in the netcfg script was killing wpa_supplicant before it could connect:
    while ! wpa_cli status | grep "wpa_state=COMPLETED" >/dev/null 2>&1; do
    if [ $i -gt 10 ]; then
    wpa_cli terminate >/dev/null 2>&1
    ifconfig $WIFI_INTERFACE down
    stat_fail && return
    fi
    sleep 2
    let i++
    done
    fi
    I have now commented out the loop and running the command "netcfg netgear" no longer halts there and so far everything seems to be fine again. I am guessing more than a 20 second timeout is needed, so I'll try having the iterator increment to 30 or something and see if that solves it.
    [EDIT]
    Now using  [ $i -gt 30 ]; and it works. On second thought, since everything  now really just works and my main question was essentially answered, I am adding [solved] to the title.
    Thanks again!
    [/EDIT]

  • Simple Action Script question

    This is probably a very basic question, but going through all
    my old Flash work didn't help me remember...
    I have my animation starting on the main stage with an image
    fading in. when that is done playing, at the end i want it to go to
    a movie clip on the stage and play it from frame 2. what is the
    action script for this?

    Doesn't seem to be working... your_mc is the instance name of
    the mc, correct? i placed this script in a frame - it's above where
    my mc first appears and the initial animation on the stage ends. is
    that correct?
    stop();
    tellTarget(mc_square-grid){
    gotoAndPlay(2);
    When I test the movie, the initial animation plays then
    stops, but the MC does not start playing. and the following error
    message appears:
    Target not found: Target="NaN" Base="_level0"
    quote:
    Originally posted by:
    ActionScripter1
    tellTarget(your_mc){
    gotoAndPlay(2);

  • ITunes Apple Script question

    Any thoughts why the following script generates will only force a refresh of the smart playlist "Random Country" if Live Updating is turned off. This script works for the other two playlists shown which have Live Updating turned on.
    on run
              tell application "iTunes"
      --delete every track of playlist "Random Christian"
      --delete every track of playlist "Mainstream"
                        delete every track of playlist "Random Country"
              end tell
    end run
    I get the following error why I run the script with Live Updating activated.
    error "iTunes got an error: every track of playlist \"Random Country\" doesn’t understand the delete message." number -1708 from every track of playlist "Random Country"
    I am currently running iTunes 11.0.2 on OSX 10.8.2

    Thanks Winston Churchill. I was missing purchased content (cloud stuff) on my ATV2. The problem was with iTunes and many others were having similar problems. I asked them to fix iTunes so it worked, but they insisted on giving me outdated instructions that had no relevance to me. It is very frustrating dealing with them. I intentionally shortened my question when I asked it here just to find out what the directions they gave meant and you have answered that. Thanks again. This is the thread about missing shows:
    https://discussions.apple.com/message/16486299#16486299

  • Complicated Scripting Question

    Here is a little background before my question-
    I have been making DVDs that basically consist of a main menu and a chapter menu. I have only one track in my project for the video. When the viewer selects "play video" from the main menu the entire video track plays then returns to the main menu. When they select a chapter from the chapter menu the same video track plays from whichever chapter marker they selected.
    I wrote a short script so if a viewer watches the video from the main menu and presses the menu button they will be brought to the main menu, and if they are watching the video via selecting a chapter they will be returned to the chapter menu when the menu button is pressed.
    I did this by having a prescript for each menu (mov GPRM 0, Current Item)
    and assigning a script to the menu button (Jump Indirect GPRM 0).
    But..now I have to make a DVD which is just like this except it must have double the menus (one set in english, one set in portuguese). They will both share the single (bilingual) video track.
    So I need to make a first menu which lets the viewer select their language, once they select that they need to be brought to their language's main menu.
    My first question is can I write a script so that once they are brought to a main menu based on what language they chose, whenever they press the title button they will be returned to this main menu and not the language selection menu or the wrong language's main menu.
    My second question is how would I write a script so when a viewer presses menu while watching the video they will be returned to the last menu the came from (main menu or chapter menu) keeping in mind that there are 2 sets of each menu.
    I'm still new to scripting and I'm having a hard time wrapping my head around all the different menus. If any one has the time to throw out any suggestions I would greatly appreciate it.
    Powermac G4 Dual 1.42   Mac OS X (10.4.4)  
    Powermac G4 Dual 450   Mac OS X (10.3.9)  

    You know, there's times when stories are just dandy for sorting the problem, and there's times for scripts... this seems like a time for scripting to me! Drew - your solution will work, but it seems so long...
    What I would do is this.
    From the very first menu make each button to select the language go to a script - and then on to the correct 'main' menu:
    mov GPRM0, SPRM8
    div GPRM0, 1024
    Jump EnglishMenu If (GPRM0 = 1)
    Jump FrenchMenu If (GPRM0 = 2)
    Jump SpanishMenu If(GPRM0 = 3)
    (I am assuming three buttons, and these three languages... you could have 36 different buttons and languages, of course.)
    The next question is do you need to set up a particular audio stream? if so, I'd add it to the script above as a line before each jump statement.
    Now that you have a value in a GPRM to identify the user choice, you can use it over and over. When you press the 'title' button, point it to a script which does this:
    Jump EnglishMainMenu If (GPRM0 = 1)
    Jump FrenchMainMenu If (GPRM0 = 2)
    Jump SpanishMainMenu IF (GPRM0 = 3)
    Of course the name of your menus will be different, just select the correct one when writing the script.
    Now for the menu call - this is assuming that you have a series of sub menus within each language choice. All I would do is set another GPRM each time I go to a different menu. So, assuming we are on the main menu for English and want to go to a chapter selection menu in English, I would go via another script:
    mov GPRM1, 1
    Jump EnglishSubMenu
    For each other menu I would go via a similar script but set a different value each time. That way we know the language (value in GPRM0) and the correct menu (in GPRM1)
    The menu call goes to this script:
    goto 4 If(GPRM0 = 1)
    goto 7 If(GPRM0 = 2)
    goto 10 If(GPRM0 = 3)
    Jump EnglishSubmenu If(GPRM1 = 1)
    Jump SecondEnglishmenu If(GPRM1 = 2)
    Jump AnotherEnglishMenu If(GPRM1 = 3)
    Jump FrenchSubMenu If(GPRM1 = 4)
    Jump SecondFrenchMenu IF(GPRM1 = 5)
    Jump ThirdFrenchMenu If(GPRM1 = 6)
    Jump SpanishSubMenu If(GPRM1 = 7)
    Jump SecondSpanishMenu If(GPRM1 = 8)
    Jump ThirdSpanishMenu If(GPRM1 = 9)
    The goto commands are looking to see which language you are in and the jump commands take you to the correct menu as long as you set these values up when you moved between the menus. This entire script could be simplified further, but as it is it serves to illustrate the process you need to go through.
    There we have it, two main scripts and a bunch of stand-alone scripts to set values... you will be able to easily stay within a branching menu system for a single language with this.

  • Adobe Forms - FormCalc Scripting Question for Image Control

    Hi All,
    I have three images on my master page. I have a hidden text field. Based on a certain value within this text field I need to turn off Imagefield B and ImageField C and Leave ImageField A visible.
    I know this can be done via FormCalc scripting.
    My Questions:
    Which event shoudl I put the script in? I was thinking the textfield initialize event.
    What would be the EXACT syntax to turn turn image fields on or off?
    Please inform if know.
    Regards,
    Salil

    I solved it now, just changing the FormCalc expression.
    Instead of using the expression:
    this.value.image.href = xfa.resolveNode(this.value.image.href).value;
    I used this:
    this.value.image.href = xfa.record.Images.URL;
    The URL value of Image Field, in this case is:
    <b>$record.Images[*].URL</b>
    And, to finish, I needed to add a Text Field bounded to  <b>$record.Imagens[*].URL</b>, case else the image doesn't appear.
    That's it!

  • Newbie script question... consecutive numbers with update.

    complete newbie type question... this is also my first post.  ( I am using CS3)
    does anyone have a script which can make it so I can add numbers into the text consecutively.
    for example, if this is my text "the big fat dog sat on the very wide mat, but was then displaced by a unfriendly cat."
    and I wanted to place a number 1, number 2, 3, etc at points in the text so it read, "the big fat dog1 sat on the very wide mat2, but was then displaced by a unfriendly cat3." but later wanted to add another number and have later numbers update themselves, so the text then said, "the big fat dog1 sat on the very wide mat2, but was then displaced3 by a unfriendly cat.4".
    by inserting the three, the previous three became four.
    Has anyone got something which might be useful in this regard.
    Many thanks
    Steve

    i wanted to avoid footnotes as they leave a bar at the bottom of each page.
    i wanted a script to do something similar to footnotes but not much further.
    does anyone have just a simple script that can do what I asked?
    Steve

Maybe you are looking for