Robert Sharp | 24 Apr 15:29 2014

Running lua code from a menu

Hi

I am new to Awesome - giving it a go to see if it can improve my working desktop. I can see it is going to take some effort but it looks like it might be rewarding.

I am looking to start a bunch of windows that ssh into each of my PCs for system admin. I wrote a simple lua function using awful.util.spawn_with_shell and then thought I could just call the function from a menu entry. Nothing happened. I then read further into awful.menu and found that it expected a string, presumably to execute itself. So is there no way to execute a bit of lua from a menu? If not, is there any other way to execute lua script on demand?

Thanks,
Robert
david cobac | 21 Apr 09:50 2014
Picon

wibox binding

Hi,

i'm trying to bind mouse wheel with a wibox just like :

 mywibox:buttons(awful.util.table.join(
 awful.button({ }, 4, function () naughty.notify({ text="roulette 4" }) end),
 awful.button({ }, 5, function () naughty.notify({ text="roulette 5" }) end)
     ))

but it makes awesome freeze...
Bug or should i use connect_signal or other ?


--
Cordialement
                           David Cobac
Raphael Cervantes | 20 Apr 21:16 2014
Picon

script to cycle through possible multi-screen configurations

Hi all,
I'm trying to implement the script suggested in this page
http://awesome.naquadah.org/wiki/Using_Multiple_Screens
for cycling through different multi-screen configurations. Its in the 
section: Cycling through possible configurations.

When I put it in my rc.lua file, I get the error message "attempt to 
index global 'config' (a nil value).

I was wondering if anyone has a script that would allow a plug-and-play 
dual monitor that Gnome offers. I can't be bothered to play with xrandr 
commands when I'm about to give a presentation to an audience.

-Raphael

david cobac | 20 Apr 18:54 2014
Picon

Re: Updating an imagebox image

Hi,

just one more thing : i've got almost the same problem with a textbox, except that it sometimes indicates the text, and sometimes not. Is textbox widget actually a cairo surface ?

For example, I have a text widget which indicates the current tag. I've placed it in the view tag only section of the globalkeys bindings :

-- View tag only.
        awful.key({ modkey }, "#" .. i + 9,
                  function ()
                        local screen = mouse.screen
                        local tag = awful.tag.gettags(screen)[i]
                        if tag then
                           awful.tag.viewonly(tag)
                           tagw:set_text(tag.name)
                        end
                  end),

The textbox is only defined by :
tagw = wibox.widget.textbox()

Thanks for the help.

awesome v3.5.5 (Kansas City Shuffle)
 • Build: Apr 16 2014 17:38:00 for x86_64 by gcc version 4.8.2 (root <at> antec)
 • Compiled against Lua 5.1.5 (running with Lua 5.1)
 • D-Bus support: ✘




2014-04-17 21:43 GMT+02:00 david cobac <david.cobac <at> gmail.com>:
2014-04-17 21:22 GMT+02:00 Uli Schlachter <psychon <at> znc.in>:


Try this:

imagew:set_image(gears.surface.load_uncached("/tmp/image.png"))
 

Thanks Uli, that's great or maybe : YOU are great !

 
-- 
Cordialement
                           David Cobac



--
Cordialement
                           David Cobac
david cobac | 18 Apr 19:59 2014
Picon

emacs binding conflict

Hi,
My modkey is set to Mod4 (windows)
In the globalkeys table, i set :

awful.key({ modkey,           }, "space",  function () 
--my function
end)

but this (strangely) conflicts with emacs C-<SPC> binding to set a mark which becomes inactive.

No conflict with my previous 3.4 (ubuntu 12.04) installation. 
Now :
awesome v3.5.5 (Kansas City Shuffle)
 • Build: Apr 16 2014 17:38:00 for x86_64 by gcc version 4.8.2 (root <at> antec)
 • Compiled against Lua 5.1.5 (running with Lua 5.1)
 • D-Bus support: ✘


--
Cordialement
                           David Cobac
david cobac | 17 Apr 17:55 2014
Picon

Updating an imagebox image

Hi,
i have a png image file which periodically updates.

I've tried to display it with an imagebox and a timer but there's actually no updates in the display, here is a complete minimal (i hope) code :

function imagew_icon()
   local fic ="/tmp/image.png"
   imagew:set_image(fic)
end
imagew = wibox.widget.imagebox()
imagew_timer = timer({ timeout = 10 })
imagew_timer:connect_signal("timeout", function () imagew_icon()  end)
imagew_timer:start()
imagew_icon()

thanks for any help !

--
Cordialement
                           David Cobac
Thorsten Jolitz | 17 Apr 10:40 2014
Picon

Prefix: C-o instead of Mod4?


Hi List,

having used Tmux on the console and Stumpwm with X quite some time now,
I got used to have the same prefix (C-o) and more or less the same
keybindings for both WM's, so I don't have think about being on the
console or in an X session. 

Now awesome is really awesome and a strong competitor to stumpwm and I
want to try it. Changing keybindings would be easy, but how to set a
keychord (Control + o) as prefix instead of single keys that have been
added to Mod4 is not so obvious (but maybe I missed something obvious
here).

Somebody somewhere asked about using C-M- as prefix (Control + Alt), and
the answer was basically 'you can't'. 

--

-- 
cheers,
Thorsten

david cobac | 16 Apr 16:54 2014
Picon

widget buttons

Hi !
I've several  widgets defined the same way :

mpdtw  = wibox.widget.base.make_widget()
mpdtw.fit = function ( mpdtw , width , height )
   local size = math.min ( width , height )
   return size, size
end
mpdtw.draw = function ( mpdtw , wibox , cr , width , height )
...
...
end

None of them react when i define events like this for example :

mpdtw:buttons(awful.util.table.join(
awful.button({ }, 1, function () awful.util.spawn( "mpc toggle" ) end),
awful.button({ }, 4, function () awful.util.spawn( "mpc seek +2%" ) end),
awful.button({ }, 5, function () awful.util.spawn( "mpc seek -2%" ) end)
 ))

thanks for any help !

awesome v3.5.5 (Kansas City Shuffle)
 • Build: Apr 12 2014 19:40:24 for x86_64 by gcc version 4.8.2 (root <at> antec)
 • Compiled against Lua 5.1.5 (running with Lua 5.1)
 • D-Bus support: ✘

--
Cordialement
                           David Cobac
Fer | 10 Apr 15:54 2014
Picon

systray icon minimize and maximize

Hi.

Some apps (pidgin, sonata) are iconified to the systray but looks like they
don't get untagged doing so.

When I click the systray icon, I want to bring the client window to the
visible tag.

I've tryed to add the property::minimize signal without success, the signal
does not get triggered (I've just tryed with focus and unfocus and get both
singals logged).

Some ideas? 

Thanks a lot

Harvey | 10 Apr 05:54 2014
Picon

XDG compliant icon lookup

Hey this works for me, can someone please test/merge?

I also think something like the string below is needed, not sure where
though.. this way whatever icon theme you specify in beautiful would be
used..

naughty.config.icon_dirs = { "~/.icons/" , "/usr/share/icons/hicolor/",
"/usr/share/pixmaps/", "/usr/share/icons/" .. beautiful.icon_theme  .."/"}

Let me know

I can also do a github merge request if thats easier...

Harvey
V. Todorov | 9 Apr 16:35 2014
Picon

Re: Fwd: Get the current client from a global key callback

Just installed it, this is definitely something that I would play with. 10x.
I will continue my research on the awesome lua part too. I will write back if I create something interesting ; )


On Wed, Apr 9, 2014 at 5:19 PM, Bennett Piater <bennett <at> piater.name> wrote:
AFAICT, Kupfer[1] does pretty much what you want?

[1]http://engla.github.io/kupfer/

On 04/09/2014 04:15 PM, V. Todorov wrote:
> Yes. Generally one client should have one such string (keyword, lets say
> instead of a tag) which should be unique (across all clients). Then with
> the second shortcut I will type in the keyword and it will bring forth
> the client which has this keyword assigned - if the client is not on the
> currently focused tag (awesome tag) I will switch to the first tag that
> the client is assigned to, otherwise I will just bring forth the client
> without changing tags (awesome tags). Sorry for the clunky explanation ; )
>
>
> On Wed, Apr 9, 2014 at 4:46 PM, Halim Zaghdoudi <halim.zag <at> gmx.de
> <mailto:halim.zag <at> gmx.de>> wrote:
>
>     Ahh so you didn't meant real awesome-like "tags", but just a string
>     which you can search for later that points to one or more clients?
>
>     *Gesendet:* Mittwoch, 09. April 2014 um 15:41 Uhr
>
>     *Von:* "V. Todorov" <inspell.87 <at> gmail.com <mailto:inspell.87 <at> gmail.com>>
>     *An:* "Awesome Mailinglist" <awesome <at> naquadah.org
>     <mailto:awesome <at> naquadah.org>>
>     *Betreff:* Fwd: Get the current client from a global key callback
>     Including the list as well.
>
>     ---------- Forwarded message ----------
>     From: *V. Todorov* <inspell.87 <at> gmail.com <http://inspell.87 <at> gmail.com>>
>     Date: Wed, Apr 9, 2014 at 4:41 PM
>     Subject: Re: Get the current client from a global key callback
>     To: Halim Zaghdoudi <halim.zag <at> gmx.de <http://halim.zag <at> gmx.de>>
>
>
>     Hi,
>
>     Thanks for the replies. Actually I am no trying to move a client to
>     a tag - tag switching by numbers is perfect. But find the client - I
>     have tons of clients open - I would like to search for a client and
>     bring it to front (and if I need switch the tag too - if the client
>     is assigned to one tag only. A good point is what to do if the
>     client is assigned to multiple tags but I will figure it out).
>
>     Regards,
>     /v
>
>
>     On Wed, Apr 9, 2014 at 4:38 PM, Halim Zaghdoudi <halim.zag <at> gmx.de
>     <http://halim.zag <at> gmx.de>> wrote:
>
>         Isn't it very handy to access tabs by the numbers, too? :D
>         But i think your idea should be doable. You get a string from
>         the prompt, and then just use the api to move the currently
>         focused client to the tag named like the string. If this tag
>         doesn't exist, you create it. And then for your other keybinding
>         you just get a string from the prompt and then watch the given
>         tag via awful.tag.viewonly(), Problem would be the tag creation,
>         I tried it once to write my own functions, but had various
>         problems with updating the taglist in my wibox. Finally you
>         could add a keybinding-function which will clear all unused tags.
>
>         *Gesendet:* Mittwoch, 09. April 2014 um 15:21 Uhr
>         *Von:* "V. Todorov" <inspell.87 <at> gmail.com
>         <http://inspell.87 <at> gmail.com>>
>         *An:* "Awesome Mailinglist" <awesome <at> naquadah.org
>         <http://awesome <at> naquadah.org>>
>         *Betreff:* Get the current client from a global key callback
>         Hello,
>
>         I have a simple question. How can I get the current (focused)
>         client from a global key callback?
>         I searched google (well didn't spend more than 10 minutes
>         because I didn't have much time, so I guess I will have to waste
>         yours ; )  but anyway I am on my way to implement a simple and
>         handy feature - something similar to easymotion vim plugin - I
>         don't know if it is already implemented.
>         Here is what it should do:
>         A user will be able to press a global key combination and get a
>         prompt where he can assign a 'tag' (a string) to the currently
>         focused window. Then he can do the same thing for another
>         window. Then he can press another key combination and enter a
>         tag which will select the window that has the specified tag
>         assigned and it will bring it infront.
>
>         This is my first global key definition:
>
>             -- set 'switch-to' tag on the focused client
>             awful.key({ modkey}, "\\",    function ()
>                             awful.prompt.run({ prompt = "switch-to tag:
>         ", text = awful.client.switchtotag, },
>                             mypromptbox[mouse.screen].widget,
>                             function (s)
>                                 awful.client.switchtotag = s
>                             end)
>                     end)
>
>         The problem with this is that client.switchtotag is a static
>         variable - available to all clients I guess. I want it to be
>         instance variable - instance of switchtotag per client. How can
>         I do that?
>
>         Currently when I press Win+\ and assign a tag to a terminal, and
>         then do the same thing for eclipse for example I will change the
>         tag of the terminal. One thing that comes to my mind is to
>         assign this key shortcut to a client - not global - but I have
>         the feeling that I will like it more if it is global. What do
>         you think?
>
>         And this is the basic functionality. The next thing that I want
>         to do is exactly what easymotion does.
>         I press a key and all opened clients receive a tag (generated in
>         some way - and very short and easy to type). The user then
>         enters the tag and the client is focused.
>
>         Regards,
>         /v
>
>
>
>
>



Gmane