Sponsored Content
Top Forums Shell Programming and Scripting [LUA-Awesome] Can i use $XDG_XY_DIR inside a lua script? Post 302865921 by sea on Sunday 20th of October 2013 03:15:58 PM
Old 10-20-2013
[LUA-Awesome] Can i use $XDG_XY_DIR inside a lua script?

Heyas

I'm a fan of AwesomeWM, but i had failed to learn lua, though, i'm quite satisfied with the cofniguration i have by now.

Either way, i'd like to know if i could 'call' those XDG_XY_DIR variables which are located on my linux ~/.config/user-dirs.dirs.

While to call scripts i use (copy-changed):
Code:
{ "BG: NASA iotd", "sh " .. awful.util.getdir("config") .. "/scripts/nasaBackground.sh",  },

I'm currently trying to open the project-container-folder like this:
Code:
menuscripttools = {
	    { "------",},
	    { "projects", files .. "$XDG_PROJECTS_DIR" },
	}

The menu is displayed properly, however, clicking on the according menu entry "projects", results in no activity...

Do i need to call a script in order to use $XDG_PROJECTS_DIR?
And if so, how could i get the use of the 'set' filenamager 'files' within the script to be called?
Or could i grep (or alike) the required value somehow?
Or is there a way to 'source' ~/.config/user-dirs.dirs within LUA?

I know there are 'bashets' but since i dont need a datastream just an execution (opening a folder), that seems a little too much..

Any ideas or thoughts?
Thank you.

Last edited by sea; 10-20-2013 at 08:02 PM..
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Installing PECL LUA on Centos for PHP

I'm kinda new to Linux, I'm mostly run websites, and it's rather easy to do everything... except install this PECL LUA plugin. :wall: I start by running this command: pecl install lua-0.9.4 downloading lua-0.9.4.tgz ... Starting to download lua-0.9.4.tgz (12,617 bytes) .....done: 12,617... (0 Replies)
Discussion started by: blackstar
0 Replies

2. UNIX Desktop Questions & Answers

[LUA / DE] AwesomeWM & Vicious Widgets

Hello Allthough i dont know LUA, despite its name, i do love the window manager that was created using that language. By now, I'm enough familiar with LUA so i could adapt (most of) the recent changes so i have vicous widgets working again - by the means of no error messages on start up. I... (1 Reply)
Discussion started by: sea
1 Replies

3. Programming

[LUA] Set variables according to if file exists

Heya I'm using Awesome WM with the Vicious widget library. As i'm using multi boot, Win8, Fedora and Arch, i have my WM-Config shared accross my GNU/Linux installations. The regarding snippet: -- Functions -- Its just a workaround for an 'unstable' 'hwmon/hwmon' definition of Fedora21 -... (0 Replies)
Discussion started by: sea
0 Replies

4. Programming

[LUA] WindowManager: Awesome - Checking OS and assign different icon

Heyas I'm having a bad time to fix this. Code is just related samples, paths are edited, take: ~/.config/awesome as 'base/config' (dot) dir. Situation: Recently i actualy started to have 2 different kinds of gnu/linux installed, with this, the abition raised, to get a distro specific icon... (1 Reply)
Discussion started by: sea
1 Replies

5. Programming

A make-like build utility based on Lua

xmake is a make-like build utility based on lua. (Link to project site: xmake) The project focuses on making development and building easier and provides many features (.e.g package, install, plugin, macro, action, option, task ...), so that any developer can quickly pick it up and enjoy the... (1 Reply)
Discussion started by: waruqi
1 Replies
doc::lua-oocairo-fontopt(3)				       Lua OO Cairo binding				       doc::lua-oocairo-fontopt(3)

Name
       lua-oocairo-fontopt - options controlling text rendering

Introduction
       A font options object contains options that tell Cairo how to render text on surfaces.  They can be created with the "font_options_create"
       function in the main oocairo module (see lua-oocairo(3)), and retrieved from scaled fonts or context objects with "get_font_options"
       methods.

       Font options objects can be compared with the "==" operator.  Two different objects with the same options set will be considered equal.

Methods
       The following methods are available on font options objects:

       opt:copy ()
	   Returns a new font options object, with identical options to opt.  The two objects will be completely independent, so you can set them
	   to have different options.

       opt:get_antialias ()
	   Get the current antialiasing mode, which will be one of the strings accepted by the "opt:set_antialias()" method.

       opt:get_hint_metrics ()
	   Returns the current hint metrics option, which will be one of the same strings accepted by the "opt:set_hint_metrics()" method.

       opt:get_hint_style ()
	   Get the kind of font hinting done when rendering text.  Returns one of the strings accepted by the "opt:set_hint_style()" method.

       opt:get_subpixel_order ()
	   Returns the current ordering of colour components in pixels used for subpixel rendering, which will be one of the same strings accepted
	   by the "opt:set_subpixel_order()" method.

       opt:hash ()
	   Return a number which can be used as a hash key identifying the particular options in opt.  That is, if you wanted to cache fonts
	   according to the options set on them, you could store them in a table with this hash value as the key.  Two font options objects with
	   the same options will have the same hash value.

       opt:merge (srcopt)
	   Add any options which are set to a non-default value in srcopt to opt if that still has the default value from them.  The options in
	   srcopt will be unchanged.  Nothing is returned.

       opt:set_antialias (antialiastype)
	   Set the antialiasing mode used for drawing.	The argument must be a string or boolean value accepted by the "set_antialias" method on
	   context objects (see lua-oocairo-context(3)).

       opt:set_hint_metrics (hintmetrics)
	   Set the kind of hinting to be applied to the metrics, as opposed to outlines, of the glyphs in a font.  The hintmetrics value must be
	   one of the following strings:

	   default
	   off
	   on
       opt:set_hint_style (hintstyle)
	   Set the kind of font hinting done when rendering text.  The hintstyle value must be one of the following strings:

	   default
	   none
	   slight
	   medium
	   full
       opt:set_subpixel_order (order)
	   Used to inform Cairo of the arrangement of colour components in the pixels of a display device like a monitor.  Only applies if
	   subpixel antialiasing is used.  The order value must be one of the following strings:

	   default
	   rgb
	   bgr
	   vrgb
	   vbgr

	   The last two options refer to vertical arrangements of colours.

1.4								    2011-05-18					       doc::lua-oocairo-fontopt(3)
All times are GMT -4. The time now is 04:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy