Project

General

Profile

unexist.dev

/

subtle

Assorted tidbits and projects

Snippets » History » Version 1

Version 1/46 - Next ยป - Current version
Anonymous, 05/30/2009 11:38 PM


Recipes\015\012\015\012This page shows small snippets that might be useful:\015\012\015\012{{>toc}}\015\012\015\012h2. Rotate\015\012\015\012This will rotate the windows on the current view clockwise.\015\012\015\012
\015\012"S-KP_Divide" => lambda {\015\012  current_view.clients.each do |c|\015\012    c.gravity = \015\012      case(c.gravity)\015\012        when 7: 8\015\012        when 8: 6\015\012        when 9: 6\015\012        when 6: 2\015\012        when 3: 2\015\012        when 2: 4\015\012        when 1: 4\015\012        when 4: 8\015\012      end\015\012  end  \015\012}\015\012
\015\012\015\012h2. Swap\015\012\015\012This two snippets toggle the gravity mode of two windows\015\012\015\012
\015\012"S-KP_Add" => lambda {\015\012  current_view.clients.each do |c|\015\012    c.gravity = \015\012      case(c.gravity)\015\012        when 4: 4.to_mode33.to_horz\015\012        when 6: 6.to_mode66.to_horz\015\012        when 8: 8.to_mode33.to_vert\015\012        when 2: 2.to_mode66.to_vert          \015\012      end\015\012  end\015\012}\015\012
\015\012\015\012
\015\012"S-KP_Subtract" => lambda {\015\012  current_view.clients.each do |c|\015\012    c.gravity = \015\012      case(c.gravity)\015\012        when 4: 4.to_mode66.to_horz\015\012        when 6: 6.to_mode33.to_horz\015\012        when 8: 8.to_mode66.to_vert\015\012        when 2: 2.to_mode33.to_vert\015\012      end\015\012    end\015\012}\015\012