You are not logged in.
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).
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
I solved thanks
Can you, please, share your Xdefaults file ?
Thanks
Offline
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 appendawful.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
TheImmortalPhoenix wrote:I solved thanks
Can you, please, share your Xdefaults file ?
Thanks
Offline
I solved thanks
Can you share your ranger's colorscheme?
Offline
Offline
and your browserview.py please or whatever file you hacked to get this awesome column view with the huge preview screen
Last edited by null (2012-07-12 12:51:24)
Offline
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 appendawful.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
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
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
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
and your browserview.py please or whatever file you hacked to get this awesome column view with the huge preview screen
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
ah, never looked into this config file. I guess I have to go to RTFM... Thanks a lot
Offline
.
Last edited by SolomonKull (2012-07-15 14:51:07)
Offline
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.
Dirty
(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
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
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.
Offline
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
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.
Thanks, I see bioe said something about using awful for dynamic tag management, I guess I'll give that a shot.
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?
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
Offline