Project

General

Profile

Basic questions and a window moving issue

Added by Hartwig De Colle almost 9 years ago

Hi there.

I just installed subtle and I like it very much. Not only because of ruby ;-). Before subtle I used Xfce4 and tested xmonad and wmii for a very short time. But I like subtle more.

Just a few quick questions. I installed first the arch package and in the config file there was a setting to hide a view if there are no clients. Now I am using the hg version and cant find the setting anymore. Can someone help me there?

Is it possible to open a terminal on the current view? Say I am on the www view and I just want to start here an xterm to try something out.

Under one condition I can cycle to the windows (clients). If i manually create two small terminals and on the right side a bigger one, than I can switch to the other windows with W+j,W+h,W+l W+k. I changed the mappings here. But when I create these terminal per shellscript the show up on the right view, but I cant switch to the other windows with my mappings. With the mouse it works fine.

So here is the shellscript I am using:

 urxvt -name "rails-autotest"   -title "rails-autotest" -tr -fg white -sh 70 &
 urxvt -name "rails-server"     -title "rails-server" -tr -fg white -sh 70 &
 urxvt -name "rails-irb"        -title "rails-irb" -tr -fg white -sh 70 -e irb &

Hey unexist keep up the good work. I hope someone can help me.

Regards hartwig and greetings form austria


Replies (4)

RE: Basic questions and a window moving issue - Added by Christoph Kappel almost 9 years ago

Hello Hartwig,

glad to hear, usually people are attracted by ruby and the time will show if they can live with the 'oddities' of subtle. :)

I decided to remove dynamic views, because it's a huge overhead to check this and no one in the channel really liked it. There was a note in the news about this change: http://subforge.org/news/27

subtle is really strict about tagging, window placement depends on it and without scripting it's not possible to place windows on current window. You can make this window sticky, if you want it to be on the current view, but this window will be visible on all terms. The scripting way is to add a tag for each view and assign the current view name as tag to a newly created window. This will move windows to the current view, could be done like this: (haven't tested it)

# Create tags for each view
on :start do
  views = Subtlext::View.all.map { |v| v.name }
  tags  = Subtlext::Tag.all.map { |t| t.name }

  views.each do |v|
    unless(tags.include?(v))
      t = Subtlext::Tag.new(v)
      t.save
    end
  end
end

# Assign tags to new clients
on :client_create do |c|
  # Assign only clients with default tag
  if(["default"] == c.tags)
    c.tag(Subtlext::View.current.name)
  end
end

Hm, can you show me your config? Would be easier for me to reproduce this behaviour.

RE: Basic questions and a window moving issue - Added by Hartwig De Colle almost 9 years ago

Hi,
thanks for the quick reply. I will check the snippet over the weekend.

Hm, I saw that but I didn't know that it was called dynamic views. Thanks.

My config is in the attachment.

By then.

subtle.rb (18.1 KB) subtle.rb Subtle Configuration

RE: Basic questions and a window moving issue - Added by Hartwig De Colle almost 9 years ago

Hi,
I tried the snippet, also I have made a few modifications (and put some tracing in there), but I cant add a Tag to a client.

 on :client_create do |c|
   # Assign only clients with default tag
   File.open("subtle.log","w+") do |file|
     if(c.tags.any?{|t| t.name == "tmp-console"})
       file.puts "I am in here" 
       file.puts "CurrentView: #{Subtlext::View.current.name}" 
       c.tag(Subtlext::View.current.name)
       c.save
       file.puts c.has_tag?("tmp-console")
       file.puts c.has_tag?(Subtlext::View.current.name)      
       file.puts c.tags.inspect
     end
   end
 end

I have a Grab which starts an terminal with the name tmp-console. The client has the right tag. But when the hook gets executed the name of the current view will not be added as a tag. So the console shows up on my default view. If I an a view for the console it will be displayed there. So that part is working. It seams I am using the c.tag wrong or I am missing something.

By
Ps.: How do get the highlighting? I tried code.

RE: Basic questions and a window moving issue - Added by Christoph Kappel almost 9 years ago

Uhm do you use the the start hook too? You can only add tags that exist and you don't need to call #save on changes like that. Did you check if the tag you want to add exists with subtler -tl?

The code tag is right, but you need to supply a language as class parameter like this:

<pre><code class="ruby">puts "test"</code></pre>

Btw: This stuff would be easier via IRC. (#subtle / freenode)

    (1-4/4)