Sponsored Content
Top Forums Programming [LUA] WindowManager: Awesome - Checking OS and assign different icon Post 302952039 by sea on Wednesday 12th of August 2015 08:53:56 PM
Old 08-12-2015
[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 displayed in the shared WM configuration because of the shared /home partition.

After some tweakings i've managed to get the WM reloaded without issues, but still, no icon is displayed, in neither of the OS'.

rc.lua
Code:
-- Functions
	-- Its just a workaround for an 'unstable' 'hwmon/hwmon[12]' definition of Fedora21 - Rawhide
	-- Function (only) from: http://stackoverflow.com/questions/4990990/lua-check-if-a-file-exists
	function file_exists(name)
		local f=io.open(name,"r")
		if f~=nil then io.close(f) return true else return false end
	end

-- Themes define colours, icons, and wallpapers
	beautiful.init(awful.util.getdir("config") .. "/themes/sea/theme.lua")

	os_icon = wibox.widget.imagebox()
	if file_exists("/etc/favicon.png")
	then	-- Its either fedora or provides same functionality
		os_icon:set_image(beautiful.icon_fedora)
		naughty.notify({ preset = naughty.config.presets.critical, title = "Its fedora", text = err })
	else	-- Probably Arch
		os_icon:set_image( beautiful.icon_arch )
		naughty.notify({ preset = naughty.config.presets.critical, title = "Its arch", text = err })
	end

-- Show the menu entry with icon
	mylauncher = awful.widget.launcher({ image = beautiful.os_icon,
		                             menu = mymainmenu })

And within the ./themes/sea/theme.lua there is:
Code:
theme.icon_fedora 	= "/etc/favicon.png"
theme.icon_arch 	= themes .. "/sea/arch_icon_16.png"

I do get a msgbox saying "Its arch", but i dont get an icon.

Any ideas or hints please?
Thank you

EDIT:
Note that 'beautiful' is the class providing the items of the active theme.

Last edited by sea; 08-13-2015 at 12:17 AM..
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

WindowManager

I Have Installed GARNOME but i don't know how i can start it in RedHat 7.3...it is very confusion to change WindowManagers in RedHat 7.3...in slackware i just changed in /etc/X11/xinit/xinitrc and it was it...but in RedHat 7.3 it is very diferent...please help (2 Replies)
Discussion started by: CreamHarry
2 Replies

2. 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

3. Shell Programming and Scripting

[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... (0 Replies)
Discussion started by: sea
0 Replies

4. 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

5. 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

6. 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
WM-ICONS-CONFIG(1)					      General Commands Manual						WM-ICONS-CONFIG(1)

NAME
wm-icons-config - show and set configuration for wm-icons SYNOPSIS
wm-icons-config [options] NAME [ICON_SET] ... DESCRIPTION
This show wm-icons package configuration, and the list of installed icon sets. It also is used to set aliases to icon-sets in system or user space. In the synopsis above, NAME is icon alias name, ICON_SET is icon set directory (for example: mini 16x16-default). If NAME already exists as an alias, it is not overwritten, unless the --force option is given. Explicit NAMEs override --defaults. Just the alias names are given for --which and --remove options. OPTIONS
Informational options: display info and exit --help Print a short usage message --version Show version number and exit --inst-dir Show wm-icons installed icon directory and exit --user-dir Show wm-icons user icon directory and exit --show-defaults Show default aliases and exit --show-aliases Show the aliases currently present. One of --global, --personal, --user-dir must be given --show-sets Show a list of installed icon sets Directory selection options: precisely one of these must be given --global Set up global (system-wide) links in the base dir --personal Set up personal links in ~/.wm-icons --user-dir=USER_DIR Set up links in USER_DIR Choice of links: at least one of these must be given --defaults Set up default aliases, as shown by --show-defaults Extra options --remove Remove the symlinks rather than creating them, return (0, 1) --which Show the icon set for the given alias(es), return (0, 1) --quiet Do not output results of alias manipulating to stdout --force Force overwriting of existing symlinks BUGS
None known. AUTHORS
Mikhael Goikhman <migo (at) cpan.org> and others (see file AUTHORS). This manual page was initially written by Manoj Srivastava <srivasta@debian.org>, for the Debian GNU/Linux system. 09-Apr-2006 WM-ICONS-CONFIG(1)
All times are GMT -4. The time now is 02:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy