You are not logged in.

#901 2012-07-12 07:31:16

Ambrevar
Trusted User (TU)
Registered: 2011-08-14
Posts: 157
Website

Re: Share your Awesome(WM) desktop!

tlamer wrote:
Ambrevar wrote:

The only thing I did not manage to get working yet is to bind a key to spawn something on a specific tag.
Anyone has a clue?

https://github.com/tlamer/.dotfiles/blo … _rules.lua in lines for chromium you can see how to spawn app on specific tag. in this particular cese chromium is always on second tag.

Doh, I'm sorry, I forgot half of the sentence here. I meant "spawning a console application" (cmus for example).

intrntbrn wrote:

maybe he wants more somethink like:

awful.key({ "Control" }, "y", function () awful.tag.viewonly(tags[mouse.screen][1]) awful.util.spawn(terminal) end),

Almost that! But I do not want to switch tags.
Anyway I tried to append

awful.tag.history.restore()

even if it is a dirty work around. Sadly it doesn't work, the window will appear on current tag (I guess awful returns before the window really shows up).

Offline

#902 2012-07-12 08:17:54

chignole
Member
Registered: 2012-02-06
Posts: 10

Re: Share your Awesome(WM) desktop!

TheImmortalPhoenix wrote:

Can you, please, share your Xdefaults file ?

Thanks

Offline

#903 2012-07-12 09:23:35

intrntbrn
Member
From: Germany
Registered: 2011-12-01
Posts: 66

Re: Share your Awesome(WM) desktop!

Ambrevar wrote:
tlamer wrote:
Ambrevar wrote:

The only thing I did not manage to get working yet is to bind a key to spawn something on a specific tag.
Anyone has a clue?

https://github.com/tlamer/.dotfiles/blo … _rules.lua in lines for chromium you can see how to spawn app on specific tag. in this particular cese chromium is always on second tag.

Doh, I'm sorry, I forgot half of the sentence here. I meant "spawning a console application" (cmus for example).

intrntbrn wrote:

maybe he wants more somethink like:

awful.key({ "Control" }, "y", function () awful.tag.viewonly(tags[mouse.screen][1]) awful.util.spawn(terminal) end),

Almost that! But I do not want to switch tags.
Anyway I tried to append

awful.tag.history.restore()

even if it is a dirty work around. Sadly it doesn't work, the window will appear on current tag (I guess awful returns before the window really shows up).

maybe theres an easier way, but you should take a look at run_or_raise

function run_or_raise(cmd, properties)
	local clients = client.get()
	local focused = awful.client.next(0)
	local findex = 0
	local matched_clients = {}
	local n = 0
	for i, c in pairs(clients) do
		--make an array of matched clients
		if match(properties, c) then
			n = n + 1
			matched_clients[n] = c
			if c == focused then
				findex = n
			end
		end
	end
	if n > 0 then
		local c = matched_clients[1]
		-- if the focused window matched switch focus to next in list
		if 0 < findex and findex < n then
			c = matched_clients[findex+1]
		end
		local ctags = c:tags()
		if table.getn(ctags) == 0 then
			-- ctags is empty, show client on current tag
			local curtag = awful.tag.selected()
			awful.client.movetotag(curtag, c)
		else
			-- Otherwise, pop to first tag client is visible on
			awful.tag.viewonly(ctags[1])
		end
		-- And then focus the client
		client.focus = c
		c:raise()
		return
	end
	awful.util.spawn(cmd)
end

-- Returns true if all pairs in table1 are present in table2
function match (table1, table2)
	for k, v in pairs(table1) do
		if table2[k] ~= v and not table2[k]:find(v) then
			return false
		end
	end
	return true
end

try to find the client youve spawned via classname, name or something else and then use: awful.client.movetotag(yourtag, yourfoundclient)

Offline

#904 2012-07-12 09:44:59

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 435

Re: Share your Awesome(WM) desktop!

chignole wrote:
TheImmortalPhoenix wrote:

Can you, please, share your Xdefaults file ?

Thanks

Sure: http://ompldr.org/vZXB3dg

Offline

#905 2012-07-12 11:17:37

ganastasiou
Member
Registered: 2010-02-03
Posts: 56

Re: Share your Awesome(WM) desktop!

TheImmortalPhoenix wrote:

Can you share your ranger's colorscheme?

Offline

#906 2012-07-12 11:30:04

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 435

Re: Share your Awesome(WM) desktop!

Offline

#907 2012-07-12 12:51:02

null
Member
Registered: 2009-05-06
Posts: 271

Re: Share your Awesome(WM) desktop!

and your browserview.py please or whatever file you hacked to get this awesome column view with the huge preview screen smile

Last edited by null (2012-07-12 12:51:24)


⚑★⚓ my dotfile repo ⚓★⚑

Offline

#908 2012-07-12 12:54:19

raphix
Member
Registered: 2008-09-27
Posts: 20
Website

Re: Share your Awesome(WM) desktop!

Ambrevar wrote:
tlamer wrote:
Ambrevar wrote:

The only thing I did not manage to get working yet is to bind a key to spawn something on a specific tag.
Anyone has a clue?

https://github.com/tlamer/.dotfiles/blo … _rules.lua in lines for chromium you can see how to spawn app on specific tag. in this particular cese chromium is always on second tag.

Doh, I'm sorry, I forgot half of the sentence here. I meant "spawning a console application" (cmus for example).

intrntbrn wrote:

maybe he wants more somethink like:

awful.key({ "Control" }, "y", function () awful.tag.viewonly(tags[mouse.screen][1]) awful.util.spawn(terminal) end),

Almost that! But I do not want to switch tags.
Anyway I tried to append

awful.tag.history.restore()

even if it is a dirty work around. Sadly it doesn't work, the window will appear on current tag (I guess awful returns before the window really shows up).

I did this to be able to bind a urxvt instance starting with ncmpcpp :

{ rule = { name = "ncmpcpp" },
      properties = { tag = tags[1][5], switchtotag = true } },

in the awful.rules.rules table (somewhere in my rc.lua) and

awful.key({ modkey, "Shift"   }, "w", function () awful.util.spawn("urxvtc -e ncmpcpp")            end),

in my keybinding section. Notice that you can just remove switchtotag=true (or set it to false) to start the application on the desired tab without switching to it.

I also decided to have a tag and some dedicated colors for a root session, here is what I did, it may help you in case the previous part did not :

{ rule = { instance = "rootterm" },
      properties = { tag = tags[1][8], switchtotag = true } },

in the awful.rules.rules table (somewhere in my rc.lua) and

awful.key({ modkey, "Shift"   }, "x", function () awful.util.spawn("urxvt -name \"rootterm\" -e su root") end),

You may use xprop to know which names you want to match in the rules section.


configs files on github  -- keep up the good work, arch devs

Offline

#909 2012-07-12 12:56:29

Ambrevar
Trusted User (TU)
Registered: 2011-08-14
Posts: 157
Website

Re: Share your Awesome(WM) desktop!

Thanks raphix. Actually I already tried your solution, but it didn't work 'cause the app name did not appear in any window properties for me.
But seeing you claiming it works, I just realized from where the issue arises: the terminal itself !
For some reasons I'm using LXTerminal instead of URxvt to spawn some apps, but I tried with URxvt, and it works !

Thanks for helping me to figure it out.

Here follows the noteworthy differences between the two terminals
URxvt

WM_COMMAND(STRING) = { "urxvt", "-e", "cmus" }
_NET_WM_ICON_NAME(UTF8_STRING) = "cmus"
WM_ICON_NAME(STRING) = "cmus"

LXTerminal

_NET_WM_ICON_NAME(UTF8_STRING) = "<selected track>"
WM_ICON_NAME(STRING) = "<selected track>"

I'm not sure if the ICON_NAME values are relevant or not for Awesome, but I guess the relevant detail here is the WM_COMMAND key. LXTerminal does not have it.

Last edited by Ambrevar (2012-07-12 13:14:41)

Offline

#910 2012-07-12 13:43:54

raphix
Member
Registered: 2008-09-27
Posts: 20
Website

Re: Share your Awesome(WM) desktop!

As written in the dedicated section in the FAQ, the really relevant parts are :

WM_CLASS(STRING) = "smplayer", "Smplayer"
                     |           |
                     |           |--- class
                     |
                     |--- instance
                     
 WM_NAME(STRING) = "SMPlayer"
                    |
                    |--- name

When playing cmus, LXTerminal keeps lxterminal and LXterminal for the values of instance and class, and the name is  WM_NAME(STRING) = "<selected track>", so that "cmus" does not appear anywhere and the rule is not applied. With urxvt, I think you have to use a "-name cmus" somewhere to force cmus to appear as a name, otherwise it's still "urxvt".

Glad my previous message was helpful to you!

Last edited by raphix (2012-07-12 13:44:18)


configs files on github  -- keep up the good work, arch devs

Offline

#911 2012-07-12 16:35:59

Ambrevar
Trusted User (TU)
Registered: 2011-08-14
Posts: 157
Website

Re: Share your Awesome(WM) desktop!

Yes I know about WM_NAME and WM_CLASS, but check by yourself: cmus does not appear in any of these fields, neither with LXTerminal nor with URxvt.
I see 2 explainations:
* either Awesome is hiding some tricks...
* or the properties change after cmus has started.

Offline

#912 2012-07-12 23:26:22

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 435

Re: Share your Awesome(WM) desktop!

null wrote:

and your browserview.py please or whatever file you hacked to get this awesome column view with the huge preview screen smile

in .config/ranger/option.py i set this:

column_ratios = (1, 1, 3, 2)
preview_files = False
preview_script = '~/.config/ranger/scope.sh'
use_preview_script = True
padding_right = True

scope.sh:

#!/bin/bash

# ranger supports enhanced previews.  If the option "use_preview_script"
# is set to True (by default it's False), this script will be called
# and its output is displayed in ranger.  ANSI color codes are supported.

# NOTES: This script is considered a configuration file.  If you upgrade
# ranger, it will be left untouched. (You must update it yourself.)
# Also, ranger disables STDIN here, so interactive scripts won't work properly

# Meanings of exit codes:
# code | meaning    | action of ranger
# -----+------------+-------------------------------------------
# 0    | success    | success. display stdout as preview
# 1    | no preview | failure. display no preview at all
# 2    | plain text | display the plain content of the file
# 3    | fix width  | success. Don't reload when width changes
# 4    | fix height | success. Don't reload when height changes
# 5    | fix both   | success. Don't ever reload

# Meaningful aliases for arguments:
path="$1"    # Full path of the selected file
width="$2"   # Width of the preview pane (number of fitting characters)
height="$3"  # Height of the preview pane (number of fitting characters)

maxln=200    # Stop after $maxln lines.  Can be used like ls | head -n $maxln

# Find out something about the file:
mimetype=$(file --mime-type -Lb "$path")
extension=$(echo "$path" | grep '\.' | grep -o '[^.]\+$')

# Functions:
# "have $1" succeeds if $1 is an existing command/installed program
function have { type -P "$1" > /dev/null; }
# "success" returns the exit code of the first program in the last pipe chain
function success { test ${PIPESTATUS[0]} = 0; }

case "$extension" in
	# Archive extensions:
	7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
	rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
		als "$path" | head -n $maxln
		success && exit 0 || acat "$path" | head -n $maxln && exit 3
		exit 1;;
	# PDF documents:
	pdf)
		pdftotext -l 10 -nopgbrk -q "$path" - | head -n $maxln | fmt -s -w $width
		success && exit 0 || exit 1;;
	# BitTorrent Files
	torrent)
		transmission-show "$path" | head -n $maxln && exit 3
		success && exit 5 || exit 1;;
	# HTML Pages:
	htm|html|xhtml)
		have w3m    && w3m    -dump "$path" | head -n $maxln | fmt -s -w $width && exit 4
		have lynx   && lynx   -dump "$path" | head -n $maxln | fmt -s -w $width && exit 4
		have elinks && elinks -dump "$path" | head -n $maxln | fmt -s -w $width && exit 4
		;; # fall back to highlight/cat if theres no lynx/elinks
esac

case "$mimetype" in
	# Syntax highlight for text files:
	text/* | */xml)
		highlight --out-format=ansi "$path" | head -n $maxln
		success && exit 5 || exit 2;;
	# Ascii-previews of images:
#	image/*)
#		img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;;
	# Display information about media files:
	video/* | audio/* | image/* | application/octet-stream)
		# Use sed to remove spaces so the output fits into the narrow window
		#mediainfo "$path" | sed 's/  \+:/: /;'
		mediainfo "$path" |  sed 's/ \+:/: /; s/\(.*:\)/'"$(printf "\e[37m")"'\1'"$(printf "\e[36m")"'/'
		success && exit 5 || exit 1;;
esac

exit 1

To show preview i press "i"

Offline

#913 2012-07-13 11:57:38

null
Member
Registered: 2009-05-06
Posts: 271

Re: Share your Awesome(WM) desktop!

ah, never looked into this config file. I guess I have to go to RTFM... Thanks a lot smile


⚑★⚓ my dotfile repo ⚓★⚑

Offline

#914 2012-07-14 16:02:20

SolomonKull
Member
From: The Internet
Registered: 2010-08-02
Posts: 31

Re: Share your Awesome(WM) desktop!

.

Last edited by SolomonKull (2012-07-15 14:51:07)

Offline

#915 2012-07-15 06:48:17

aline
Member
Registered: 2009-12-17
Posts: 22

Re: Share your Awesome(WM) desktop!

mBHQes.jpg

Ailvts.png

Last edited by aline (2012-07-15 07:03:42)

Offline

#916 2012-07-16 14:01:34

Rainbow
Member
From: Argentina
Registered: 2012-07-16
Posts: 16

Re: Share your Awesome(WM) desktop!

696Ocs.png

Last edited by Rainbow (2012-07-16 14:05:04)


if you can imagine it, ¡you can create it!

Offline

#917 2012-07-17 20:12:59

CommunistWitchDoctor
Member
Registered: 2012-07-17
Posts: 9

Re: Share your Awesome(WM) desktop!

It's just anrxc's config with a few tweaks. If anyone wants one of the tweaked things for some reason just ask and I'd be happy to provide it.

Clean
CFIdF.png


Dirty
nPUCb.png
(Yes I know my ranger doesn't match my color scheme and I should be ashamed)

Also, I've been trying to get shifty to work with this config but I can only seem to get it to break everything. If anyone has any tips as to that that would be great.

Last edited by CommunistWitchDoctor (2012-07-17 20:50:47)

Offline

#918 2012-07-17 20:38:45

fsckd
Forum Moderator
Registered: 2009-06-15
Posts: 3,564

Re: Share your Awesome(WM) desktop!

Welcome to the forums CommunistWitchDoctor. Please read this and this and edit your post. Thanks.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#919 2012-07-17 22:45:10

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Share your Awesome(WM) desktop!

CommunistWitchDoctor wrote:

Also, I've been trying to get shifty to work with this config but I can only seem to get it to break everything. If anyone has any tips as to that that would be great.

Yeah, I've been there.  You can check out this thread and see if it helps you at all; honestly, that process was so convoluted and frustrating that when I switched over to the git dev branch I gave up on shifty, and don't remember how I even got it working.

I like the Greek in your tags, by the way. wink

Offline

#920 2012-07-18 08:06:21

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 435

Re: Share your Awesome(WM) desktop!

CommunistWitchDoctor wrote:

Really nice! Can you share the wall of the screen on the right? And could you also tell me how did you set those borbers in your wiboxes?

Offline

#921 2012-07-18 12:37:50

CommunistWitchDoctor
Member
Registered: 2012-07-17
Posts: 9

Re: Share your Awesome(WM) desktop!

ANOKNUSA wrote:
CommunistWitchDoctor wrote:

Also, I've been trying to get shifty to work with this config but I can only seem to get it to break everything. If anyone has any tips as to that that would be great.

Yeah, I've been there.  You can check out this thread and see if it helps you at all; honestly, that process was so convoluted and frustrating that when I switched over to the git dev branch I gave up on shifty, and don't remember how I even got it working.

I like the Greek in your tags, by the way. wink

Thanks, I see bioe said something about using awful for dynamic tag management, I guess I'll give that a shot.


TheImmortalPhoenix wrote:
CommunistWitchDoctor wrote:

Really nice! Can you share the wall of the screen on the right? And could you also tell me how did you set those borbers in your wiboxes?

1680x1050
1366x768

The border is in the theme file as

-- {{{ Borders
theme.border_width  = 1
theme.border_focus  = "#6F6F6F"
theme.border_normal = theme.bg_normal
theme.border_marked = theme.fg_urgent
-- }}}

And is applied to the wibox like so

    -- Create the top wibox
    wibox[s] = awful.wibox({      screen = s,
        fg = beautiful.fg_normal, height = 12,
        bg = beautiful.bg_normal, position = "top",
        border_color = beautiful.border_focus,
        border_width = beautiful.border_width
    })

Last edited by CommunistWitchDoctor (2012-07-18 12:40:12)

Offline

#922 2012-07-20 08:09:10

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 435

Re: Share your Awesome(WM) desktop!

tZXN3Mw

Offline

#923 2012-07-23 13:08:23

F34R
Member
From: /dev/loliland
Registered: 2012-02-05
Posts: 238

Re: Share your Awesome(WM) desktop!

TheImmortalPhoenix wrote:

can u share theme or lua ?

thanks

Offline

#924 2012-07-23 17:35:14

TheImmortalPhoenix
Member
From: 127.0.0.1
Registered: 2011-08-13
Posts: 435

Re: Share your Awesome(WM) desktop!

Offline

#925 2012-07-23 18:06:38

F34R
Member
From: /dev/loliland
Registered: 2012-02-05
Posts: 238

Re: Share your Awesome(WM) desktop!

TheImmortalPhoenix wrote:

much thanks bro

Offline

Board footer

Powered by FluxBB