Menu

Scripts

Helpdesk
CraazyT
2012-10-01
2012-10-05
  • CraazyT

    CraazyT - 2012-10-01

    Hello,

    Hey I noticed that there is a be.pacman in the scripts folder. How do I use it?

     
  • Thomas Luebking

    Thomas Luebking - 2012-10-02

    See "Button Example: package monitor" in
    http://sourceforge.net/p/be-shell/wiki/Advanced%20Usage/

    It's virtually the same but the pacman sample script accesses a "Pacman" button and requires pwless sudo permissions on "sudo pacman -Sy" top update the database (or you'll have to add a root cronjob to do that every now and then, just run "crontab -e" as root)

     
    • CraazyT

      CraazyT - 2012-10-03

      Thanks Thomas,

      I didn't even that wiki page existed. I use yaourt a lot do you suppose I can replace pacman with yaourt?

       
      • Thomas Luebking

        Thomas Luebking - 2012-10-03

        Yes, but i don't think it would make any difference.
        Yaourt does not seem to be in the package database, but i might be wrong on this.

         
        • CraazyT

          CraazyT - 2012-10-03

          Yeah I think they replaced it with packer but I like yaourt better it displays better detail. I got it working, I don't care if I can't launch pacman from the notifier. I'm fine with it showing there are updates (it's not that hard to open a terminal and pacman -Syu ;-)

           
          • Thomas Luebking

            Thomas Luebking - 2012-10-03

            you can just turn the pacman command to

            konsole --hold -e "pacman -Syu"
            

            or so, will open konsole, run pacman -Syu and (--hold) keep konsole open.

            Since pacman is a CLI tool, you can only log it

            pacman -Syu > /tmp/pacman_Syu.log 2>&1
            

            or run it in a terminal emulator.

             
            • CraazyT

              CraazyT - 2012-10-05

              Where exactly do I put that in the be.pacman script? and if so at the top or towards the bottom?

               
              • Thomas Luebking

                Thomas Luebking - 2012-10-05

                Replacing/Extending the exec command which is there (quite at the bottom, IN this line)

                echo "<action label=\"Update all\" exec=\"sudo /usr/bin/pacman -Syu\"/>" >> "$file"
                
                 
    • CraazyT

      CraazyT - 2012-10-03

      This might be a stupid question, but how can I set it up to display what it's doing like in konsole?

       
      • Thomas Luebking

        Thomas Luebking - 2012-10-03

        you could run pacman (the update all action) in a "konsole -e sudo pacman -Syu" or so.
        another option would be to redirect the output into a log file (and eventually have that logfile be a FiFo attached to a Label on the desktop)

        If you're only interested in the result, you could just notify yourself

        notify-send [OPTION...] <SUMMARY> [BODY]
        
         
  • CraazyT

    CraazyT - 2012-10-03

    Thomas another question on the scripts if you don't mind. I am using arch linux and recently setup netcfg. I followed the wiki but there is a few things I don't understand

    1. I have a wireless icon but when I click on it it does nothing

    This is what's is in my config:

    [netcfg]
    Icon=network-wireless
    Menu=netcfg
    MenuUpdater=/home/tommy/be.shell/scripts/netcfg-profiles
    Mode=0
    Type=Button

    How do I add this and where if so? and will it show when i click on the netcfg icon?

    Now, you also want to know about your connection quality?

    and added this to my cron
    /5 * * * /home/joe_user/.kde/share/apps/be.shell/scripts/netquality

    Thanks in advance :-)

     
    • Thomas Luebking

      Thomas Luebking - 2012-10-03

      it's hopefully:

      [netcfg]
      Icon=network-wireless
      Menu=netcfg
      MenuUpdater=/home/tommy/be.shell/scripts/netcfg-profiles
      Mode=0
      Type=Button
      

      Next, is this

      /home/tommy/be.shell/scripts/netcfg-profiles
      

      an executable shell script?

      If so, pressing the button should
      - write a menu into ~/.kde/share/apps/be.shell/netcfg.xml
      - display it's contents

      if there's such file but no menu, please post the content of the menu (ensure there's no data you might consider private, such as the SSID, when postiing)

      This

      /5 * * * /home/joe_user/.kde/share/apps/be.shell/scripts/netquality
      

      is for sure wrong in your case, since you are not joe_user ;-)

      Ensure that this:

      /home/tommy/.kde/share/apps/be.shell/scripts/netquality
      

      is an an executable shell script (it's shipped with the be.shell scripts to match the "netcfg" button, ie. the id of the button is important)

      I'd generally suggest to collect the helper scripts in a place, like a "scripts" subdir the appdir (~/.kde[4]/share/apps/be.shell) path.

       
      • CraazyT

        CraazyT - 2012-10-03

        I tried it with my system at home and all I did was copy these scripts to the folder you suggested ~/.kde4/share/apps/be.shell/scripts and it worked I got a menu up!! Yay!!

        On my work laptop I installed netcfg and tried wifi-select but do you suppose all it was was just copying the scripts in the right location?

        There is one more question that I don't understand, it's for the netquality script. How exactly do I link that to the icon in the panel?

        [netcfg]
        Icon=network-wireless
        Menu=netcfg
        MenuUpdater=/home/tommy/be.shell/scripts/netcfg-profiles
        Mode=0
        Type=Button

        or is another button like so

        [netquality]
        Icon=network-wireless
        Menu=netquality
        MenuUpdater=/home/tommy/.kde4/share/apps/be.shell/scripts/netquality
        Mode=0
        Type=Button

        That's where I'm confused.

        Thanks Thomas I appreciate it I'm loving be::shell you did a great job with it ;-)

         
        • Thomas Luebking

          Thomas Luebking - 2012-10-03

          The scripts do all the "hard" work, so yes - if they cannot be accessed, nothing's gonna work at all.

          The netquality script just checks the current quality and alters the icon of the

          [netcfg]
          

          button accordingly.
          So you
          - need such button
          - need to run the netquality script every now and then (That's what cron is good for. Do radom things every now and then)

          The suggested

          /5 * * * /home/tommy/.kde/share/apps/be.shell/scripts/netquality

          entry would run it every 5 minutes (but cron has actually support for very complex timing setups, read the manpage and then google and then ask at stackoverflow and then you'd still not know about half the possibilities =)

           
      • CraazyT

        CraazyT - 2012-10-04

        Thomas I have another dumb question. I can only execute the netcfg script you have included if I issue the following command in a terminal:

        ./netcfg mynetwork (mynetwork is my netcfg profile)

        If I click on the mennu icon in the panel it shows (mynetwork) but I can't execute it from the icon. I have netcfg and iwlist wlan0 scan listed in my sudoers file with no password.

        Any ideas?

        Sorry if it's stupid question, I'm getting closer with it working ;-)

         
  • Thomas Luebking

    Thomas Luebking - 2012-10-04

    Likely kinda my bad - i last minute renamed the script from be.netcfg to netcfg but netcfg-profiles wrote be.netcfg as executable.

    I updated the script, adjust the script path by altering the BE_NETCFG variable on top of the netcfg-profiles script (it now points be.shell/scripts/netcfg in the local "kde4-config --path data"

    In case that's not 100% clear, the scripts are mainly thought as starting points (and i've to fix the dialog for the netcfg script, looks better in the wifi-select GUI variant =)

     
    • Thomas Luebking

      Thomas Luebking - 2012-10-04

      and i've to fix the dialog for the netcfg script, looks better in the wifi-select GUI variant.

      nope, actually did but did not copy over the adjusted script to my mobiles =)

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.