[Solved] Problems with permissions for a script

Hi I realize the topic "permissions in Linux" is something that you can find very easily in the internet but I cant seem to figure out a solution for my problem.
I currently have a working script (taken from the ArchWiki) which enables me to change my display brightness. However I must be either superuser or root to be able to use it since it sends commands to the necessary devices.
I am currently using fluxbox as "desktop environment" and I want to be able as normal user to change the brightness without calling "sudo" everytime. I have also bound the necessary keys in the fluxbox/keys file to send the necessary commands to the script so my only problem is now with the permission.
Every help is much appreciated
Last edited by Triver (2011-12-13 17:34:41)

ok it works that way (at least when I execute the additional script which contains the sudo command).
for some reason fluxbox doesnt react when I press the keycode that I looked up with xev (although it works with a combination like "Mod4 b: exec ~/script")
anyway I think I'll stick with that solution and add some additional commands in the script (like toggle wlan on/off), thx for the quick help
edit: ok now I'm having difficulties with extending the script
I want to add additional paramters so the script can be used multifunctional depending on the parameter you launch it with.
however he seems to think that the String which I want to compare with the parameter is a command.
here's the code
#! /bin/sh
if [$1 = "brightness"]; then
if [$2 = "up"]; then
//call the actual brightness script with sudo
elif [$2 = "down"]; then
// call the actual brightness scrip with sudo
else
echo "invalid parameters!"
exit 1
fi
fi
exit 0
I execute the script like this
~/script brightness up
but he only returns me
~/script: line 2: [brightness: command not found
so whats wrong with the code?
Last edited by Triver (2011-12-13 16:03:07)

Similar Messages

  • [SOLVED] Problems in permissions for accessing files

    Hi everyone
    let's say I want to copy a folder to /etc/
    the problems is my user can't copy files anywhere other then it's home it doesn't even have access to any file or folder other then home.
    on the other hand I can use root to view and copy or access but the files that root creates or copies are only for root , I mean other groups or users can't access them .
    I tried changing permissions on files ( chmod , chown) but sometimes it takes a lot of time .
    can you tell me how I can give my own user those permissions ?(permission of copying file to a folder like /etc/ or creating a file in there )
    is there a way to change root's default setting so when i create something with root that file or folder be accessible for others automatically ?!
    sorry if my questions are dumb
    --N3mo
    Last edited by N3mo (2012-11-16 16:49:43)

    You can indeed do that. I have no intention of telling you how.
    What you are trying to do is dangerous and, frankly, idiotic. I am sure that you are no idiot but your strategy is idiotic. (Smart people often do dumb things.)
    If you insist on doing this, you can do it. But you should learn about the security system you are disregarding so that you know the risks. If you do that, you will know how to run those risks if you wish.
    What packages are you downloading? Do you mean pacman's cache? Why do you want your user to have write access there?
    Note that apart from the general idiocy of this strategy, it will also prevent some programmes from working at all because some of them check for sane permissions and refuse to run if they find the permissions are insane.
    I don't even understand why you want to change root's settings. If you are working as root anyway, why do you also want your user to have access?
    You can keep themes etc. in your home directory in appropriate places. Then you have complete control of them. You should not be adding additional themes to the system's collection except by installing packages with pacman.
    Please learn about the way that the file structure, permissions and access controls are supposed to work and the protection that they offer you. (From yourself as well as other people.)

  • [SOLVED] problem with permissions.

    hi all
    I am trying to paste a folder in the path :
    /usr/share/themes
    but I can't do that at all because of an error about permissions.
    I can only paste & copy things in the Filesystem Folders through the terminal when I am in the root mode too.
    I have edited the sudoers file but no result.
    root ALL=(ALL) ALL
    yasser ALL=(ALL) ALL
    and it's just the same.
    Last edited by YYaaSSeeRR (2012-09-10 16:44:04)

    #3
    I remember PCManFM including among its options to open a folder as root (it's been quite a long time since I used it thus you would have to check yourself in order to be sure). If you figure it out in the end that may grant you a visual environment to move the theme folder which seems to be what you are ultimately interested in apparently.
    In the end too much of a hassle if you ask me as through terminal this is done pretty smoothly. And if you are the only user #2 made a good point suggesting you the use of the 'local' (home) .themes folder as the result will be ultimately the same.

  • Problem with Request for Permissions (mobile app)

    In my application I want to publish the results of the games on facebook. I used this tutorial: http://www.adobe.com/devnet/facebook/articles/flex_fbgraph_pt1.html
    Here is a fragment of my source code:
    <fx:Script>
            <![CDATA[
                import com.facebook.graph.FacebookMobile;
                import mx.events.Request;
                import valueObjects.GlobalVariables;
                protected var extendedPermissions:Array = ["publish_stream","user_website","user_status","user_about_me"];
               protected function initApp():void
                    FacebookMobile.init("app ID",loginHandler);
                protected function loginHandler(success:Object,fail:Object):void
                    if(success){   
                        currentState="loggedin";
                        nameLbl.text=success.user.name;
                        userImg.source=FacebookMobile.getImageUrl(success.uid,"small");
                        birthdayLbl.text=success.user.birthday;
                        FacebookMobile.api("/me/statuses",getStatusHandler);
                    else{   
                        this.login();
                protected function login():void
                    FacebookMobile.login(loginHandler, stage, []);
                protected function logout():void
                    FacebookMobile.logout();
                    currentState="loggedout";
                protected function getStatusHandler(result:Object, fail:Object):void
                    statusLbl.text=result[0].message;
                protected function submitPost():void
                    FacebookMobile.api("/me/feed",submitPostHandler,{message:GlobalVariables.d.toString()}, "POST");
                protected function submitPostHandler(result:Object,fail:Object):void
                    FacebookMobile.api("/me/statuses",getStatusHandler);
            ]]>
        </fx:Script>
    I have problem with permissions. After login I see a white screen instead of request for permission.  The desktop application does not have a problem with it. When I log for the first time to the desktop application and I will give the permissions applications, then in the mobile application everything works fine. But this is not a good solution. And so please help.

    The labelField of IconItemRenderer only supports single line text.  Try using the messageField instead:
    <s:List width="200" height="200">
        <s:dataProvider>
            <s:ArrayList>
                <s:DataItem desc="1 Hello World Hello World Hello World" />
                <s:DataItem desc="2 Hello World Hello World Hello World" />
                <s:DataItem desc="3 Hello World Hello World Hello World" />
            </s:ArrayList>
        </s:dataProvider>
        <s:itemRenderer>
            <fx:Component>
                <s:IconItemRenderer labelField="" messageField="desc">
                </s:IconItemRenderer>
            </fx:Component>
        </s:itemRenderer>
    </s:List>
    If you need more control you might need to subclass, this post might help: http://flexponential.com/2011/08/21/adding-multiline-text-support-to-labelitemrenderer/

  • In 2014, Since I upgraded my OS to Win 7, everytime I update Acrobat X Standard I get and error.  The problem seems to be with permissions for folders is there a permanent fix??

    In 2014, Since I upgraded my OS to Win 7, every time I update Acrobat X Standard I get and error.  The problem seems to be with permissions for folders is there a permanent fix??

    Is there any indication of the specific folder you are having problems with. Are you logged in as the administrator (or the same as when you installed) and have anti-virus disabled during the update? You might also try the updates from http://www.adobe.com/support/downloads/product.jsp?product=1&platform=Windows.

  • Problem with Twitter for Mac notifications

    Hello,
    I have a strange problem with Twitter for Mac. On both my home and office Macs. New posts appear in app window but there aren't any notifications even though notifications are set in preferences to show in both dock and menubar. Perhaps anyone noticed similar strange behaviour? I didn't find anything similar on Twitter forums.
    Thanks in advance.

    Solved by
    Dr.AvituvOct 20, 2014 11:09 PM
    go to Terminal and post this:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/support/lsregister -kill -seed
    if it doesn't have that specific directory try this:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -seed
    once the scanning is done (can be short or long, depends on how heavy your system is) RESTART the computer.
    when you're back, go to Apple>system preferences>extensions.... guess who's there.
    I hope it helped.
    The Doctor.
    iMac, OS X Yosemite (10.10)
    To restore Actions extensions for good and other stuff
    THANKS!

  • Stacked 100% bar chart - Problem with datatips for zero value data points

    I have a stacked 100% bar chart that shows datatips in Flex 4.   However, I don't want it to show datatips for
    data points with zero values.   Flex 4 shows the datatip for a zero value data point on the left side of a bar if the data point is not the first in the series.
    Here's the code that illustrates this problem.    Of particular concern is the July bar.    Because of the zero value data point problem, it's not possible to see the datatip for "aaa".
    Any ideas on how we can hide/remove the datatips for zero value data points ?        Thanks.
    <?xml version="1.0"?>
    <s:Application
    xmlns:fx="
    http://ns.adobe.com/mxml/2009"xmlns:mx="
    library://ns.adobe.com/flex/mx"xmlns:s="
    library://ns.adobe.com/flex/spark"creationComplete="initApp()"
    height="
    1050" width="600">
    <s:layout>
    <s:VerticalLayout/>
    </s:layout>
    <fx:Script><![CDATA[ 
    import mx.collections.ArrayCollection;[
    Bindable] 
    private var yearlyData:ArrayCollection = new ArrayCollection([{month:
    "Aug", a:1, b:10, c:1, d:10, e:0},{month:
    "July", a:1, b:10, c:10, d:10, e:0},{month:
    "June", a:10, b:10, c:10, d:10, e:0},{month:
    "May", a:10, b:10, c:10, d:0, e:10},{month:
    "April", a:10, b:10, c:0, d:10, e:10},{month:
    "March", a:10, b:0, c:10, d:10, e:10},{month:
    "February", a:0, b:10, c:10, d:10, e:10},{month:
    "January", a:10, b:10, c:10, d:10, e:10}]);
    private function initApp():void {}
    ]]>
    </fx:Script>
    <s:Panel title="Stacked Bar Chart - Problems with DataTips for Zero Value Items" id="panel1">
    <s:layout>
    <s:HorizontalLayout/>
    </s:layout>
    <mx:BarChart id="myChart" type="stacked"dataProvider="
    {yearlyData}" showDataTips="true">
    <mx:verticalAxis>
     <mx:CategoryAxis categoryField="month"/>
     </mx:verticalAxis>
     <mx:series>
     <mx:BarSeries
    xField="a"displayName="
    aaa"/>
     <mx:BarSeries
    xField="b"displayName="
    bbb"/>
     <mx:BarSeries
    xField="c"displayName="
    ccc"/>
     <mx:BarSeries
    xField="d"displayName="
    ddd"/>
     <mx:BarSeries
    xField="e"displayName="
    eee"/>
     </mx:series>
     </mx:BarChart>
     <mx:Legend dataProvider="{myChart}"/>
     </s:Panel>
     <s:RichText width="700">
     <s:br></s:br>
     <s:p fontWeight="bold">The problem:</s:p>
     <s:p>Datatips for zero value data points appear on left side of bar (if data point is not the first point in series).</s:p>
     <s:br></s:br>
     <s:p fontWeight="bold">For example:</s:p>
     <s:p>1) For "June", eee = 0, mouse over the left side of the bar to see a datatip for "eee". Not good.</s:p>
     <s:br></s:br>
     <s:p>2) For "July", eee = 0 and aaa = 1, can't see the datatip for "aaa", instead "eee" shows. Real bad.</s:p>
     <s:br></s:br>
     <s:p>3) For "Feb", aaa = 0, datatip for "aaa" (first point) does not show. This is good.</s:p>
     <s:br></s:br>
     <s:p>4) For "Mar", bbb = 0, datatip for "bbb" shows on the left side of the bar. Not good.</s:p>
     <s:br></s:br>
     <s:p fontWeight="bold">Challenge:</s:p>
     <s:p>How can we hide/remove datatips for zero value data points?</s:p>
     <s:br></s:br>
     </s:RichText></s:Application>

    FYI.
    Still have the issue after upgrading to the latest Flex Builder 4.0.1 with SDK 4.1.0 build 16076.   
    Posted this as a bug in the Adobe Flex Bug and Issue Management system.     JIRA
    http://bugs.adobe.com/jira/browse/FLEXDMV-2478
    Which is a clone of a similar issue with Flex 3 ...
    http://bugs.adobe.com/jira/browse/FLEXDMV-1984

  • Problem with mail for exchange after update on E72...

    Hi everyone,
      I updated Nokia E-mail to ver 3.9 on E72. Now I am facing  a problem with mail for exchange. I have configured gmail on mail for exchange. I recieve a warning that "unable to sync contact administrator if problem persist". It started to pop up just after the update was over and is very frustrating. Even previously i used to recieve mails instantly but now it generally takes half an hour for me to recieve them. I deleted and created mail for exchange several times but to no avail.
    Also i am not able to automatically recieve mails other emails which i have configured. every time I have to manually download them everytime.
    Can anybody suggest a way out.
    Thanks
    Anil

    It could be a problem if you're using your network's connections...
    I was on a Pay & Go tariff with o2 some time ago, and needed secure connections for various things, o2 told me they didn't provide secure connections on Pay & Go tariffs...
    Could be worth checking with them to make sure it's supported.
    Nokia History: 3110, 5110, 7110, 7110, 3510i, 6210, 6310i, 5210, 6100, 6610, 7250, 7250i, 6650, 6230, 6230i, 6260, N70, N70, 5300, N95, N95, E71, E72
    Android History: HTC Desire, SE Xperia Arc, HTC Sensation, Sensation XE, One X+, Google Nexus 5

  • Problem with facetime for mac

    hello guy! I've got a problem with facetime for mac.My sister has a I-pod touch fourth generation with factime but i cna't phone her a message come on my mac.It say "xxx can't receive facetime's calls"!Can you help me??

    Thanks, Dah•veed.
    I did see mention of using Google Public DNS while I was searching the forums prior to posting, but to be honest didn't think it was a DNS-related problem.
    However, to rule it out I've set the prefered DNS servers on my router to Google's, but FaceTime still disconnects after 4-5 seconds when calling between me and my brother-in-law.  It doesn't matter who initiates the call.
    As a test, before I made the changes to my router, I logged into FaceTime as him on my MBP and tried calling myself on my iMac, and that was successful.
    The same test between the two iMacs when they were here was unsuccessful, so now I'm definitely thinking it's something on the '08 iMac.
    Now I just need to figure out what...

  • Problem with GarageBand for iOS 6/7 Iphone 3gs / 4

    Problem with GarageBand for iOS 6/7 Iphone 3gs / 4
    Hello,
    On February 16, bought the GarageBand for iOS which was free and so I find and install it on my 3GS .
    Take the demo: Curtain Call Demo
    and within the instruments :
    audio Recorder
    Sampler
    Smart Drums
    Smart Strings
    Smart Bass
    Smart Keyboard
    Smart Guitar
    Keyboard
    Drums
    Guitar Amp
    1.4.1 is the latest version for ios 6.
    Configure my AppleID on a Iphone 4 and install the program , the version I have the Iphone 4 is the orange ( different from 3gs ) icon and put it on the AppStore : ios 2.0.1 for ios7.
    With these instruments :
    audio Recorder
    Sampler ( to download the instrument )
    Smart Drums ( to download the instrument )
    Smart Strings (Download the instrument )
    Smart Bass ( to download the instrument )
    Smart Keyboard ( to download the instrument )
    Smart Guitar
    Keyboard
    Drums
    Guitar Amp ( to download the instrument )
    and if I give what I need to restore tells me if I bought it I did not restore anything and tells me to buy :
    Complete collection of GarageBand instruments and sound at a price of : € 4.49
    As they are 2 different versions ? More than anything I say because I have to pay for the instruments in the 2.0.1 version of the Iphone 4 ... ?
    And besides not wearing demo Demo Curtain Call : (
    GarageBand 1.x If you are upgrading it using iTunes on a Mac or PC, you can restore the original collection of instruments and sounds. There is no need to buy this collection. Press "You've already purchased?" When displayed on iPhone, iPad or iPod touch.
    this puts on the AppStore but I have tried to restore as I wrote above, and does not work. There is nothing to restore.
    regards

    I've been having the same problem. However, I believe my problem is due to the 3G issues I've been having. I don't have internet access even when the 3G symbol appears, so probably my iphone keeps trying to connect to the network and has its battery drained! Have you been having the same issue?

  • I have problem with fonts for my site, i have used "Lucida sans unicode " family for certain texts. it shows perfect in mozilla 3.5 and mozilla 4. But the font not supporting in mozilla 5.0? please help me

    i have problem with fonts for my site, i have used "Lucida sans unicode " family for certain texts. it shows perfect in mozilla 3.5 and mozilla 4. But the font not supporting in mozilla 5.0? please help me

    i have problem with fonts for my site, i have used "Lucida sans unicode " family for certain texts. it shows perfect in mozilla 3.5 and mozilla 4. But the font not supporting in mozilla 5.0? please help me

  • I have problems with office for mac  screen resolution, specially with excel

    I have problems with office for mac  screen resolution, specially with excel ?

    For starters, make sure to Check for Updates on any of the Help menus, and make sure the product has all the latest patches. MS did come out with a patch addressing the display issues on Retina Macs. Latest patchlevel is 14.3.2.
    We are talking about Office:Mac 2011, right?

  • Please Help?! Problems with Viber for iPhone 4s

    Please help!
    I have had problems with Viber for a while now and had given up! But now a few contacts only have viber and not other free messaging apps so I’m trying to use it again but still having problems.
    I have uninstalled and reinstalled a number of times and still have not received an access code. My main problem though is the messaging it would work fine and then I wouldn’t be able to send any messages and I would receive a message go into the app and the message would not appear.
    The other day I reinstalled it whilst at work and worked perfectly could send and receive messages easily. Then when I went home the problem stated again. I then uninstalled and reinstalled again and it worked perfectly, but now back at work I’m having the issues again! I can’t keep uninstalling and reinstalling is there a way this can be fixed?!
    If anyone is able to help me out it would be much appreciated! Thanks

    You activated "Find My Mac," which disables the built-in Guest account and adds a Safari-only "Guest User" pseudo-account. To get the Guest account back, you would have to disable FMM.

  • When Apple solve problems with new iTunes calendar sync with windows and outlook?

    When Apple solve problems with new iTunes calendar sync with windows and outlook?

    Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID
    More Info here...
    Apple ID FAQs  >  http://support.apple.com/kb/HT5622
    If necessary...
    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • We have been having a problem with newsletters for a client. The newsletter works fine except if we add a button and/or link to the top zone on that newsletter it blows up ONLY ON iPhones!

    We have been having a problem with newsletters for a client.
    The newsletter works fine except if we add a button and/or link to the top zone on that newsletter it blows up ONLY ON iPhones!
    This happened last month too. It seems to be related to length of the newsletter too. It works on every device except iPhones - so weird.

    Hi, is anyone else experiencing i-phone only problems on email campaigns? not bashing Apple, just having issues where our newsletter are only having issues on iPhones

Maybe you are looking for

  • A div in a site am developing is not showing in firefox but shows on all the other browsers (chrome, safari, opera and explorer), can anyone help?

    i am developing a site and i used divs in making the arrangements. all other divs on the page shows but on particular one does not show. i gave all the divs a border with a red color, all the other browsers(explorer, opera, chrome and safari ) shows

  • Battery - charging or discharging?

    like many on here I have been effected by much reduced battery life following the upgrade to 3.1 and 3.1.2 - mine sits on charge for most of the day and so it doesn't really effect me, however I do use my phone at night as a Night stand clock sitting

  • Lost password for Apple ID and the email on record is no longer valid

    Hi, I have to apple accounts, one for Mexico, where I live, and one for the US Store, where I made some purchases. I just bought a new computer and would like to transfer all of my iTunes related files to the new computer. However, I do not remember

  • XI - R/3 Server Proxy

    Hi all, I have created a server proxy from an inbound interface declared in XI. I am trying to test it but I'm suffering the next error: 404 Resource not found Partner not reached Error: -20 Version: 6040 Component: ICM Date/Time: Mon Oct 8 13:32:43

  • How to configure BGRFC

    I want to know the step by step  or a complete example to set up a communication between two servers SAP using bgrfc. I tried to make a configuration. But messages are not processed automatically. The state of the unit is green and the queue has the