Levent S.B. | 1 Mar 2012 08:05
Picon

Re: newbie-problem: nm-applet recognizes access-points, won't connect

Hi Hartmut,
first of all, thanks for your reply! I guess i have to save the „runeonce“ code as a new library in /usr/share/awesome/lib?
I did this, added the code you provided at the end of my rc.lua but got no effect save the tags in the panel appeared twice.
Sorry if i seem a bit clumsy, maybe i am missing something essential here.

Is it necessary to install gnome if i want to run the applet?


Thank you,
Levent


On 29.02.2012 20:17, Hartmut Bischoff wrote:
Hi,

I did the same:
Installed Ubuntu, ran gnome and installed awesome.
In Gnome, I could access the nm-applet.
Same in awesome, providing this in the rc.lua

local r = require("runonce")
r.run("nm-applet")
r.run("gnome-power-manager")
r.run("dropbox start -i")
r.run("/usr/lib/gnome-disk-utility/gdu-notification-daemon")
r.run("firefox")


where "runconce" is
-- <at> author Peter J. Kranz (Absurd-Mind, peter <at> myref.net)
-- Any questions, criticism or praise just drop me an email

local M = {}

-- get the current Pid of awesome
local function getCurrentPid()
    -- get awesome pid from pgrep
    local fpid = io.popen("pgrep -u " .. os.getenv("USER") .. " -o awesome")
    local pid = fpid:read("*n")
    fpid:close()

    -- sanity check
    if pid == nil then
        return -1
    end

    return pid
end

local function getOldPid(filename)
    -- open file
    local pidFile = io.open(filename)
    if pidFile == nil then
        return -1
    end
   
    -- read number
    local pid = pidFile:read("*n")
    pidFile:close()
       
    -- sanity check
    if pid <= 0 then
        return -1
    end
       
    return pid;
end
       
local function writePid(filename, pid)
    local pidFile = io.open(filename, "w+")
    pidFile:write(pid)
    pidFile:close()
end

local function shallExecute(oldPid, newPid)
    -- simple check if equivalent
    if oldPid == newPid then
        return false
    end

    return true
end

local function getPidFile()
    local host = io.lines("/proc/sys/kernel/hostname")()
    return awful.util.getdir("cache") .. "/awesome." .. host .. ".pid"
end

-- run Once per real awesome start (config reload works)
-- does not cover "pkill awesome && awesome"
function M.run(shellCommand)
    -- check and Execute
    if shallExecute(M.oldPid, M.currentPid) then
        awful.util.spawn_with_shell(shellCommand)
    end
end


have fun!


--
Dr. Hartmut Bischoff
Stuttgart


Levent S.B. | 1 Mar 2012 08:50
Picon

Re: newbie-problem: nm-applet recognizes access-points, won't connect

Hi again,
you don't need to bother anymore, i just solved the problem. I don't know if this is a bug, but it seems to be an issue with the rights administration. If i run nm-connection-editor with root permission i get the necessary menu with the option to enter my wlan-password.
Strange enough, since i already added myself to the network group, but at least it works!
Greetings,
Levent

On 29.02.2012 20:17, Hartmut Bischoff wrote:
Hi,

I did the same:
Installed Ubuntu, ran gnome and installed awesome.
In Gnome, I could access the nm-applet.
Same in awesome, providing this in the rc.lua

local r = require("runonce")
r.run("nm-applet")
r.run("gnome-power-manager")
r.run("dropbox start -i")
r.run("/usr/lib/gnome-disk-utility/gdu-notification-daemon")
r.run("firefox")


where "runconce" is
-- <at> author Peter J. Kranz (Absurd-Mind, peter <at> myref.net)
-- Any questions, criticism or praise just drop me an email

local M = {}

-- get the current Pid of awesome
local function getCurrentPid()
    -- get awesome pid from pgrep
    local fpid = io.popen("pgrep -u " .. os.getenv("USER") .. " -o awesome")
    local pid = fpid:read("*n")
    fpid:close()

    -- sanity check
    if pid == nil then
        return -1
    end

    return pid
end

local function getOldPid(filename)
    -- open file
    local pidFile = io.open(filename)
    if pidFile == nil then
        return -1
    end
   
    -- read number
    local pid = pidFile:read("*n")
    pidFile:close()
       
    -- sanity check
    if pid <= 0 then
        return -1
    end
       
    return pid;
end
       
local function writePid(filename, pid)
    local pidFile = io.open(filename, "w+")
    pidFile:write(pid)
    pidFile:close()
end

local function shallExecute(oldPid, newPid)
    -- simple check if equivalent
    if oldPid == newPid then
        return false
    end

    return true
end

local function getPidFile()
    local host = io.lines("/proc/sys/kernel/hostname")()
    return awful.util.getdir("cache") .. "/awesome." .. host .. ".pid"
end

-- run Once per real awesome start (config reload works)
-- does not cover "pkill awesome && awesome"
function M.run(shellCommand)
    -- check and Execute
    if shallExecute(M.oldPid, M.currentPid) then
        awful.util.spawn_with_shell(shellCommand)
    end
end


have fun!


--
Dr. Hartmut Bischoff
Stuttgart


Alexander Yakushev | 1 Mar 2012 08:50
Picon
Gravatar

Re: newbie-problem: nm-applet recognizes access-points, won't connect

On 03/01/2012 09:05 AM, Levent S.B. wrote:
Hi Hartmut,
first of all, thanks for your reply! I guess i have to save the „runeonce“ code as a new library in /usr/share/awesome/lib?
I did this, added the code you provided at the end of my rc.lua but got no effect save the tags in the panel appeared twice.
Sorry if i seem a bit clumsy, maybe i am missing something essential here.

Is it necessary to install gnome if i want to run the applet?


Thank you,
Levent
Hello Levent,

Which version of Awesome do you use? Tags appearing twice actually mean that Awesome tried to load your ~/.config/awesome/rc.lua, failed midway and then loaded /etc/xdg/awesome/rc.lua as a fallback. If your Awesome version is 3.4.11 then you should see a red box in the right top informing you what actually crashed. You can also look for errors in the file ~/.xsession-errors.

That was just FYI. I don't think adding "runonce" module to Awesome would fix your problem. And I am pretty much not sure what you can with NM but to suggest trying wicd. Wicd is better then NM because it works like a daemon (so the X session is not required for it to work - you'll have your connection as soon as system loads) and has different clients to manage it (wicd-curses - terminal client, wicd-gtk - GUI one). You'll find the daemon and clients in the Ubuntu repository.

Keep us informed about your progress,

Best regards,
Alexander
Levent S.B. | 1 Mar 2012 09:37
Picon

Re: newbie-problem: nm-applet recognizes access-points, won't connect

Hi Alexander,
i'm running awesome 3.4.10-1, installed from the ubuntu 11.10 amd64 repos on an ubuntu 11.10 64-bit minimal installation.
As i wrote in my last mail (i hope you got it?), i can access the menu by running sudo nm-connection-manager (without sudo it opens as well, but i'm not allowed to edit anything).
Nevertheless, i'm going to try wicd as soon as i have the time :)
Thanks for the info,
Levent


On 01.03.2012 08:50, Alexander Yakushev wrote:
On 03/01/2012 09:05 AM, Levent S.B. wrote:
Hi Hartmut,
first of all, thanks for your reply! I guess i have to save the „runeonce“ code as a new library in /usr/share/awesome/lib?
I did this, added the code you provided at the end of my rc.lua but got no effect save the tags in the panel appeared twice.
Sorry if i seem a bit clumsy, maybe i am missing something essential here.

Is it necessary to install gnome if i want to run the applet?


Thank you,
Levent
Hello Levent,

Which version of Awesome do you use? Tags appearing twice actually mean that Awesome tried to load your ~/.config/awesome/rc.lua, failed midway and then loaded /etc/xdg/awesome/rc.lua as a fallback. If your Awesome version is 3.4.11 then you should see a red box in the right top informing you what actually crashed. You can also look for errors in the file ~/.xsession-errors.

That was just FYI. I don't think adding "runonce" module to Awesome would fix your problem. And I am pretty much not sure what you can with NM but to suggest trying wicd. Wicd is better then NM because it works like a daemon (so the X session is not required for it to work - you'll have your connection as soon as system loads) and has different clients to manage it (wicd-curses - terminal client, wicd-gtk - GUI one). You'll find the daemon and clients in the Ubuntu repository.

Keep us informed about your progress,

Best regards,
Alexander

stardiviner | 1 Mar 2012 09:46
Picon
Gravatar

[SOLVED] Re: Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.naquadah.awesome.awful was not provided by any .service files


--

-- 
>> stardiviner <<  =>GPG: 5D9F64D8 Twitter:  <at> numbchild
http://stardiviner.dyndns-blog.com/author.html
Michal Sojka | 2 Mar 2012 09:42
Picon
Picon
Favicon
Gravatar

Re: newbie-problem: nm-applet recognizes access-points, won't connect

On Wed, 29 Feb 2012, Levent S.B. wrote:
> Hello altogether!
> Longing to get away from the graphical overload of standard ubuntu, i 
> have finally decided to set up a minimal installation of oneiric-ocelot 
> 64 bit with awesome as window-manager.
> So far i'm very pleased working with it, i'm just not very experienced 
> with configuring the system to my hardware. After successfully 
> configuring my sound chip, i'm now fighting with the wireless internet 
> connection.
> 
> I have installed the NetworkManager and added nm-applet to my rc.lua as 
> described in http://awesome.naquadah.org/wiki/Nm-applet. I have added 
> myself to the netdev-group and set „managed“ in 
> /etc/NetworkManager/NetworkManager.conf to „true“ to make the nm-applet 
> handle connections.
> This works fine for the normal eth0 wired connection.
> 
> Available access points are displayed when clicking on the applet, but 
> selecting one doesn't have any effect, save for a „Wireless network 
> diconnected“ notification popping up. I'm not prompted for a password.
> 
> Any suggestions?

I've solved this by running
/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 when I
start the session. AFAIK this thing is responsible for prompting the
user for password.

-Michal

Wayne Werner | 2 Mar 2012 14:36
Picon
Gravatar

Re: newbie-problem: nm-applet recognizes access-points, won't connect

On Fri, Mar 2, 2012 at 2:42 AM, Michal Sojka <sojkam1 <at> fel.cvut.cz> wrote:
On Wed, 29 Feb 2012, Levent S.B. wrote:
> Hello altogether!
> Longing to get away from the graphical overload of standard ubuntu, i
> have finally decided to set up a minimal installation of oneiric-ocelot
> 64 bit with awesome as window-manager.
> So far i'm very pleased working with it, i'm just not very experienced
> with configuring the system to my hardware. After successfully
> configuring my sound chip, i'm now fighting with the wireless internet
> connection.
>
> I have installed the NetworkManager and added nm-applet to my rc.lua as
> described in http://awesome.naquadah.org/wiki/Nm-applet. I have added
> myself to the netdev-group and set „managed“ in
> /etc/NetworkManager/NetworkManager.conf to „true“ to make the nm-applet
> handle connections.
> This works fine for the normal eth0 wired connection.
>
> Available access points are displayed when clicking on the applet, but
> selecting one doesn't have any effect, save for a „Wireless network
> diconnected“ notification popping up. I'm not prompted for a password.
>
> Any suggestions?

Something that might be of interest to you (especially if you don't connect to many new places) is using wpa_supplicant. I don't have my config right in front of you, but if wpa_supplicant works for your card you can have it set to connect on boot, and it connects to open, WEP, and WPA just fine. There's a wpa_gui client that allows you to graphically setup the connection once and then you're good to go.

If you're interested I can hunt my configuration down.

HTH,
Wayne
Gabriel Lecouvreur | 2 Mar 2012 17:42
Picon

Laptop and external screen on the fly

Hello,

I have a small issue with awesome : I sometimes plug my laptop to an external
screen and then issue  an xrandr command to make the new screen available. Then,
Awesome restarts. And I am not pleased with the way it deals with clients : 
clients with no rule in my rc.lua (like my urxvt-terms) stay on the laptop 
screen (the former main screen) and I would like them to go on the new main 
screen (while keeping their tags positions). I have searched and read some old 
threads of the mailing list, and apparently there is no way to store these
positions before restarting. I wonder however if it would be possible to make a 
transfer-to-mainscreen.lua (or sh) script using some awesome-client magic to do it. 

Say something like:

for k,c in awful.client.cycle(true,2)
do
  newtagtable = ...
  c.tags = newtagtable
  … // whatever should appear here
done

However, I am not sufficiently experienced with awful and lua coding to:
- complete the code to make it work
- know where and how to pass those commands to awesome-client

If anyone could help me by bringing me a step further, I would really appreciate!

Thank you very much in advance.

G
Picon
Gravatar

Re: Laptop and external screen on the fly

What if you set the extern monitor as primary? I usually set my HDMI
output as primary, sometimes I even disable my laptop monitor.

Gabriel Lecouvreur | 2 Mar 2012 19:29
Picon

Re: Laptop and external screen on the fly

My external monitor is already set as primary (at least it is screen 1
for awesome). But my urxvts act as if they are stuck on the laptop
screen (as if there tag table contain screen.count instead of "1").
Yes, I could also disable the laptop screen but I like to keep a root
term there and a few other dedicated apps (which behave well with
awesome).

2012/3/2 Claudio Roberto França Pereira <spideybr <at> gmail.com>
What if you set the extern monitor as primary? I usually set my HDMI
output as primary, sometimes I even disable my laptop monitor.


Gmane