Giter VIP home page Giter VIP logo

wmiirc's Introduction

sunaku's wmii configuration in Ruby and YAML

Floating Tiling

This is a Ruby and YAML based configuration of the wmii window manager. It manipulates wmii through the Rumai library (which speaks directly to wmii via the 9P2000 protocol and features an interactive Ruby shell for live experimentation) and offers a near "Desktop Environment" experience:

  • Status bar applets with mouse, keyboard, and menu access.
  • System, dialog, and menu (with history) integration.
  • Client grouping and mass manipulation thereof.
  • View and client access by menu and alphanumeric keys.
  • Automated client arrangements with optional persistence.
  • Detaching clients from current view and restoring them.
  • Zooming clients to temporary views and restoring them.
  • Closing all clients before exiting the window manager.
  • Script and stdout/err logging with automatic rotation.
  • Crash handling with error trace and recovery console.
  • Session state propagation between wmiirc instances.
  • And oh so much more... :-]

All of this can be configured to suit your needs, of course. This wmii configuration was also described in the following articles in the past:

API documentation for Ruby code that powers this configuration is here:


Requirements

  • wmii 3.9 or newer. I recommend that you use my personal fork of wmii-hg for best results.

    Note that the display/status/arrange status bar applet requires a patched version of wmii-hg revision 2758 or greater in order to persist automated client arrangements.

  • Ruby 2 or newer.

  • If you want to use the status/weather.yaml status bar applet, uncomment the following line in the Gemfile and restart wmii:

    gem 'barometer'
    
  • If you want to use the status/music/mpd.yaml status bar applet, uncomment the following line in the Gemfile and restart wmii:

    gem 'librmpd'
    

Installing

Backup:

mv ~/.wmii ~/.wmii.backup
mv ~/.wmii-hg ~/.wmii-hg.backup

Install:

git clone https://github.com/sunaku/wmiirc.git ~/.wmii
ln -s ~/.wmii ~/.wmii-hg

Branch:

cd ~/.wmii
make branch

Configuring

  • Edit the ~/.wmii/config.yaml file (see the "Configuration File Format" section below) to suit your needs. See my personal configuration file for example.

  • If wmii is already running, run ~/.wmii/wmiirc or invoke the "reload" action from within an existing wmiirc instance to apply your changes.

Configuration File Format

All Ruby code snippets in the configuration file have access to a CONFIG constant which contains the data from the fully expanded configuration. They also have access to a SESSION constant which is a hash that is automatically persisted across multiple instances of the wmiirc.

  • custom: Any value of your own choosing to use in your configuration. For example, you can define a list of applications to always launch (unless they're already running) whenever your configuration starts:

    custom:
      startup:
        - wpa_gui -t   # network manager
        - claws-mail   # e-mail client
        - redshift-gtk # color temperature
    
    script:
      after: |
        Array(CONFIG['custom']['startup']). # <== NOTICE THE KEYS HERE !!!
        each {|app| launch! app unless system 'pgrep', '-f', app }
    
  • import: A list of files to inject into this one before evaluating it. Imported files may themselves import other files, recursively. The contents of each successive imported file are merged with the previous one while overwriting the imported content in the following manner:

    • If the object being overwritten is a hash, then:

      • For keys that are present in the old hash but absent in the new hash, key-value pairs from the old hash are retained.

      • For keys that are present in the new hash but absent in the old hash, key-value pairs from the new hash are added.

      • For keys in common between the old and new hashes, key-value pairs from the old hash are replaced by key-value pairs from the new hash.

    • If the object being overwritten is an array, then items from the new array are appended to end of the old array.

    • If the object being overwritten is a scalar value such as a string, integer, or boolean, then the old value is replaced by the new value.

  • ignore: A list of files to remove from the import statement above.

  • require: A list of Ruby libraries to load before evaluating this configuration file. If a library is a RubyGem, you can constrain its version number like this:

      require:
        - some_gem
        - another_gem: '>= 1.0.9'
        - yet_another_gem: ['>= 1.0.9', '< 2']
        - some_ruby_library
    
  • script: Arbitrary logic to evaluate while processing this file.

    • before: Array of Ruby code snippets to evaluate before processing the overall configuration.

    • after: Array of Ruby code snippets to evaluate after processing the overall configuration.

  • status: Status bar applet definitions.

    All Ruby code snippets that are evaluated inside a Wmiirc::Status object have access to a refresh method that triggers redrawing of the label of that status bar applet. They also have access to a @id variable which is a sequence number counting the number of instances of this particular status bar applet that have been created thus far.

    • name of the status bar applet that you want to define:

      • params: Hash of parameters to pass to the constructor. These are later available as instance variables in the Ruby code snippets that are evaluated inside this status bar applet.

      • refresh: Number of seconds to wait before updating the label. To disable automatic refreshing, set this parameter to 0 (zero).

      • script: Ruby code to evaluate in the Wmiirc::Status object.

      • label: Ruby code whose result is displayed as the content. This code is placed in a label() method in the Wmiirc::Status object.

      • control:

        • event: Hash of event name to Ruby code to evaluate in the Wmiirc::Status object.

        • action: Hash of action name to Ruby code to evaluate in the Wmiirc::Status object.

        • mouse_action: Hash of mouse event name to action name.

  • display: Appearance settings.

    • bar: Where to display the horizontal status bar?

    • font: Font to use in all text drawn by wmii.

    • border: Thickness of client border (measured in pixels).

    • color: Color schemes for everything drawn by wmii. These are expressed in #foreground #background #border format, where foreground, background, and border are 6-digit HEX values.

      • desktop: Color of the desktop background (single color only).

      • focus: Colors of things that have focus.

      • normal: Colors of things that do not have focus.

    • columns: Settings for columns drawn by wmii.

      • mode: The wmii "colmode" setting.

      • rule: The wmii "colrules" setting.

    • client: Settings for clients handled by wmii. See the documentation for the underlying wmii "rules" setting for more information.

      • rule to apply: Array of strings that represent regular expressions to match against a string containing a newly created client's WM_CLASS and WM_NAME attributes separated by a colon (:).
    • refresh: Refresh rate for status bar applets (measured in seconds).

    • status: Status bar applet instances.

      All Ruby code snippets that are evaluated inside a Wmiirc::Status object have access to a refresh method that triggers redrawing of the label of that status bar applet. They also have access to a @id variable which is a sequence number counting the number of instances of this particular status bar applet that have been created thus far.

      • - name of the status bar applet that you want to instantiate:

        • params: Hash of parameters to pass to the constructor. These are later available as instance variables in the Ruby code snippets that are evaluated inside this status bar applet.

        • refresh: Number of seconds to wait before updating the label. To disable automatic refreshing, set this parameter to 0 (zero).

        • script: Ruby code to evaluate in the Wmiirc::Status object.

        • label: Ruby code whose result is displayed as the content. This code is placed in a label() method in the Wmiirc::Status object.

          • control:

            • event: Hash of event name to Ruby code to evaluate in the Wmiirc::Status object.

            • action: Hash of action name to Ruby code to evaluate in the Wmiirc::Status object.

            • mouse_action: Hash of mouse event name to action name.

  • control: Interaction settings.

    • action: Hash of action name to Ruby code to evaluate.

    • event: Hash of event name to Ruby code to evaluate.

      The Ruby code has access to an "argv" variable which is a list of arguments that were passed to the event.

      Keep in mind that these event handlers block the wmiirc event loop. In other words, no new events can be handled until the current one finishes. So try to keep your event handlers short and quick.

      If your event handler needs to perform a long-running operation, then be sure to wrap that operation inside a Ruby thread.

    • mouse: Mapping from X mouse codes to event names.

      • grab: The wmii "grabmod" setting.
    • keyboard: Hash of shortcut prefix name to shortcut key sequence.

    • keyboard_action: Hash of shortcut key sequence to action name.

      A key sequence may contain ${...} expressions which are replaced with the value corresponding to ... in the "control:keyboard" section of this configuration.

      For example, if the "control:keyboard" section was defined as follows, then the ${d},${c} key sequence would be expanded into Mod4-y,y.

        control:
          keyboard:
            a: 4
            b: Mod${a}
            c: y
            d: ${b}-${c}
      

Running

  • Ensure that your ~/.xinitrc allows you to restart wmii without having to lose your running applications if wmii crashes or is accidentally killed:

    xterm -e tail -f ~/.wmii/wmiirc.log &
    while true; do wmii
      xmessage 'INSERT COIN TO CONTINUE' \
      -buttons 'Insert Coin:0,Game Over' \
      -default 'Insert Coin' -timeout 30 \
      -center || break
    done
    

    For a working example, see my personal configuration file.

  • Run startx and wmii will automatically find and load this configuration.


Upgrading

cd ~/.wmii
make rebase

If this fails because Git reports that you have unstaged changes, you can stash your changes away temporarily and restore them after the upgrade:

git stash
make rebase # now it works
git stash apply

Hacking

To use the development version of Rumai directly from its source code repository (instead of the currently published gem version), run this:

cd ~/.wmii
make rumai

Contributing

Fork this project on GitHub and send pull requests.


Bugs, Features, Issues, Questions

File a report on the issue tracker.


License

Like my work? ๐Ÿ‘ Please spare a life today as thanks! :cow::pig::chicken::fish::speak_no_evil::v::revolving_hearts:

Copyright 2006 Suraj N. Kurapati https://github.com/sunaku

Released under the ISC license. See the LICENSE file for details.

wmiirc's People

Contributors

0x64746b avatar adityam avatar centyx avatar dependabot[bot] avatar ghedamat avatar koiuo avatar nikki93 avatar niklas avatar nougad avatar reactormonk avatar skirge avatar sunaku avatar tomka avatar yhager avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wmiirc's Issues

mouse wheel doesn't work on spacer barlet

I added a spacer barlet in front of my volume barlet (to delimit the latter. else muting my system would soak basically my whole status bar in read ;P). It acts as expected, but the default mouse bindings don't seem to have any effect. The mouse wheel does work on the volume barlet, though.

refresh: 0 should disable refreshing

In your comment1 you suggest a refresh rate of 0. But at the moment a refresh rate of 0 will course 100% CPU load because the refresh threads loops with sleep 0.

See my fix here2.

Moving from TOPLEVEL_BINDING to Button#instance_eval in commit 71bb5a57668ac54c00866c8857e36f2daea09c27 doesn't work

Minimal setup:

display:
  status:
    - test:
      click: status 'test'

Fails with "wrong number of arguments (1 for 0) (ArgumentError)" because it wants to call Button(Thread)#status not status on TOPLEVEL_BINDING.

If you using status_click instead of status for example the method is found correctly but all instance-variables are nil because they are only defined in TOPLEVEL_BINDING not in Button-scope.

wmiirc freezes upon complex shortcuts

On Fri, Nov 6, 2009 at 6:14 PM, Nathan Neff wrote:

Wmii doesn't crash that often. However, if I have something odd in my
config files, it will stop responding to keyboard events. The applications
/clients will still respond, so I can switch windows with the mouse, but not
the keyboard.

Now that you mention it, I've been experiencing this occasionally,
ever since they switched from Ruby 1.8 to Ruby 1.9 as the default for
the Linux distro I use: ArchLinux.

The problem just happened again now --- seems to be triggered by key
chording (lots of Control/Alt/Shift pressed together) --- and I went
to a virtual console and ran wmiir read /event. It was reading
events just fine. Then I went back to my X session and wmii was not
frozen anymore.

I think it's a fault with the IXP implementation in Rumai. I may have
over-engineered that library in the name of thread-safety. I'll have
to cut it back down to size someday.

Cheers.

Caching complete config in one file

I thought a little bit about using yaml-references in config file. e.g.:

display:
  status:
    wlan0:
      label: &geninit
         .. display status of init script ...
      path: /etc/init.d/net.wlan0
    eth0:
      label: *geninit
      path: /etc/init.d/net.wlan0

But this would make it necessary to load complete config at once. Perhaps it would be a nice Idea to cache the complete config in an special file and only diff the timestamps of both files. If config is newer rebuild cache and load it else load only cache.

I tested the cofnig with references and it works pretty well if whole config is in one file of course.

Caching the config is a little bit ugly (I think the performance improvement will be minimal) but perhaps references can make some pretty things possible. What do you think?

Cooperative Multithreading

I measured battery usage with and without X and found a big difference (6W vs 11W). Of course my wmii config causes only a small part but I mentioned many wakeups by it. So I try a short profiling and see many time are consumed for all the thread stuff (synchronize, pass, etc). I thought about Cooperative Multithreading and want to know what you think about.

I would try it with two threads: One Thread waits that an event occurs and sleeps meanwhile. The other handles the status bar updates. This scheduler used a queue for update events (e.g two buttons A updates every 2 and B every 5 secs): | A | A | B | A | -- first sleep 2 secs, execute update method for A, sleep another 2 secs, call A, sleep one sec, call B, sleep one sec, call A. Of course some corrections required because update needs some time too.

I don't know if this effects any performance improvements but I give it a try. What do you think?

add persistent view arrangements

Add the ability to make view arrangements persistent, so that if new clients appear on the current view, or existing clients are removed from it, then the persistent arrangement is automatically re-applied to the current view.

improve client tagging & syntax

  • Accept plain regexp bodies rather than literal regexps (with enclosing //).
  • Join regexps together based on target (invert the client tags hash).
  • Make client tag application faster: tell wmii to keep all clients in floating area, until wmiirc moves them to managed area? Seems to be less flickery than the other way around.

Some problems with my spacer barlet

Hi,

nice! You take some of my changes. Thanks

But I have to warn you: There are some problems if you take only this commit[1]. I want the spacer between my rbar and the tabs. But if a notification is displayed this space is used by the notification and my spacer for switching tabs is only some pixels in width. Everytime I switch Tags with my wheel and a notification occurs I get an exception because the notify barlet have no mouse action for wheel (perhaps this is fixed, I doesn't test everything with your changes recent changes).

I changed my spacer into the notification barlet. So always the notify barlet is displayed and reacts on mouse actions but only if a notification occurs it shows some text.

So I renamed the barlet[2] and prevent it from removing if it exists in Status-Hash [3].
But I have some problems to get the Button in Notice#display:
button = StatusBarlet.new('!notice')

Solution 1:
Doesn't add a position number to button filename if name starts with "!" [4]. This will prevent "StatusBarlet.new" to create a new field (without the number) and the existing is used.

Solution 2:
Make Status#button accessible so I can use:
button = Status['!notice'].button || StatusBarlet.new('!notice')

What do you think? Is this a useful change? Should I make you a pretty commit?

[1] http://github.com/sunaku/wmiirc/commit/88a3d79291e5a2b08c714e4ec6e59d3762346cef

[2] http://github.com/nougad/wmiirc/commit/2faea8b17f489aae73e7628902ff2d190cf7cd61

[3] http://github.com/nougad/wmiirc/commit/39de6a6e98322311df535561e2e4411f6da7548a

[4] http://github.com/nougad/wmiirc/commit/a45fd52260cdda9e29a5164840a4794051ead778

Better error reporting in import

Hi,

The new import mechanism is amazing. Thanks a lot for implementing it. However, I think that the error messages can be improved.

Consider a config.yaml file that contains

import:
- name-of-file-that-does-not-exist

wmii gives an error

#<TypeError: can't convert nil into String>
/usr/lib/ruby/1.9.1/yaml.rb:143:in `initialize'
/usr/lib/ruby/1.9.1/yaml.rb:143:in `open'
/usr/lib/ruby/1.9.1/yaml.rb:143:in `load_file'
/home/adityam/.wmii-hg/lib/wmiirc/config.rb:112:in `block in import'
/home/adityam/.wmii-hg/lib/wmiirc/config.rb:110:in `each'
/home/adityam/.wmii-hg/lib/wmiirc/config.rb:110:in `import'
/home/adityam/.wmii-hg/lib/wmiirc/config.rb:122:in `block in import'
/home/adityam/.wmii-hg/lib/wmiirc/config.rb:110:in `each'
/home/adityam/.wmii-hg/lib/wmiirc/config.rb:110:in `import'
/home/adityam/.wmii-hg/lib/wmiirc/config.rb:14:in `initialize'
/home/adityam/.wmii-hg/lib/wmiirc/loader.rb:85:in `new'
/home/adityam/.wmii-hg/lib/wmiirc/loader.rb:85:in `load_user_config'
/home/adityam/.wmii-hg/lib/wmiirc/loader.rb:19:in `run'
/home/adityam/.wmii-hg/wmiirc:9:in `<main>'

The message can't convert nil to string is misleading. It will be better if the error message said that file was not found, or simply give a warning rather than an error.

Document dependency on libxft2-dev

Without that package, loading ttf (which is the default) will fail.
This will lead to client rules not working (group, tags)

I think noting this somewhere would be nice, since debugging that was nasty ;)
tia
dtk

removing imported keyboard shortcats

when importing a keyboard files, one can customize some shortcuts by overriding them, but removing an imported shortcut is impossible, as the yaml merge algorithm ignores nil values.

Name of first tag

Hi,

Right now, the first tag is named "1". Can you add a feature so that the name of the default tag can be changed in config.yaml?

Thanks,
Aditya

launch.yaml overrides script:after

WARN -- : value ["action 'launch_menu_rehash'"] from "/home/dtk/.wmii-hg/control/action/launch.yaml" overrides "action 'autostart_programs'\n" from "/home/dtk/.wmii-hg/config.yaml" in section "script:after"
  1. I'd like to be able to use the (no question) useful launch_menu_rehash action that is the default for script:after as well as append my own actions (preferably without cnp'ing it ;))
  2. User config settings should override defaults (usually they do?)

wmiirc crashes

I'm just getting started with wmii, so I thought I use your config to make it a little nicer... but I can't seem to get anything to work.
Every-time I launch wmii or run wmiirc it crashes with the following error:

ERROR -- : undefined method `[]' for nil:NilClass (NoMethodError)
/home/jon/.wmii-hg/lib/wmiirc/config.rb:53:in `display'
/home/jon/.wmii-hg/lib/wmiirc/config.rb:14:in `apply'
/home/jon/.wmii-hg/lib/wmiirc/loader.rb:111:in `load_user_config'
/home/jon/.wmii-hg/lib/wmiirc/loader.rb:15:in `run'
/home/jon/.wmii-hg/wmiirc:5:in `<main>'

I'm running: wmii-hg2788, ยฉ2010 Kris Maglione, ruby 1.9.2, rumai 4.1.2 on ArchLinux.
The only thing I'm doing is following the install instructions on the main page: "git clone..... etc.". And it crashes even if I don't modify the config.yaml file.

Sorry, but I don't know any ruby to even begin to guess the problem.

wmii dies due to dead links in $PATH

I assume 6018bff introduces a problem that causes wmii to die when there are dead links in the $PATH. That sucks. The window manager shouldn't depend on a cleaned up path.

In addition, the error message is misleading and might make the user believe he's missing a dependency ('dependencies' on javaws and pluginappletviewer really got my blood boilin' -.-)

#<Errno::ENOENT: No such file or directory - /usr/bin/javaws>
/home/dtk/.wmii-hg/control/action/launch.yaml:control:action:launch_menu_rehash:3:in `stat'
/home/dtk/.wmii-hg/control/action/launch.yaml:control:action:launch_menu_rehash:3:in `block (5 levels) in control'
/home/dtk/.wmii-hg/control/action/launch.yaml:control:action:launch_menu_rehash:2:in `select'
/home/dtk/.wmii-hg/control/action/launch.yaml:control:action:launch_menu_rehash:2:in `block (4 levels) in control'
/home/dtk/.wmii-hg/control/action/launch.yaml:control:action:launch_menu_rehash:1:in `map'
/home/dtk/.wmii-hg/control/action/launch.yaml:control:action:launch_menu_rehash:1:in `block (3 levels) in control'
/home/dtk/.wmii-hg/lib/wmiirc/handler.rb:20:in `call'
/home/dtk/.wmii-hg/lib/wmiirc/handler.rb:20:in `block in handle'
/home/dtk/.wmii-hg/lib/wmiirc/handler.rb:19:in `each'
/home/dtk/.wmii-hg/lib/wmiirc/handler.rb:19:in `handle'
/home/dtk/.wmii-hg/lib/wmiirc/handler.rb:61:in `action'
/home/dtk/.wmii-hg/control/action/launch.yaml:script:after:1:in `block in script'
/home/dtk/.wmii-hg/lib/wmiirc/config.rb:38:in `instance_eval'
/home/dtk/.wmii-hg/lib/wmiirc/config.rb:38:in `block in script'
/home/dtk/.wmii-hg/lib/wmiirc/config.rb:37:in `each'
/home/dtk/.wmii-hg/lib/wmiirc/config.rb:37:in `script'
/home/dtk/.wmii-hg/lib/wmiirc/config.rb:17:in `apply'
/home/dtk/.wmii-hg/lib/wmiirc/loader.rb:118:in `load_user_config'
/home/dtk/.wmii-hg/lib/wmiirc/loader.rb:23:in `run'
/home/dtk/.wmii-hg/wmiirc:5:in `<main>'

I don't know what the responsible patch is doin', but it would be great if he wouldn't crash WMII.

Honor multiple thermal devices

$ acpi -t
Thermal 0: ok, 84.0 degrees C
Thermal 1: ok, 87.0 degrees C

patch:

--- a/status/thermal.yaml
+++ b/status/thermal.yaml
@@ -8,18 +8,26 @@ status:
       high: 70

     label: |
-      device, status = `acpi -t`.chomp.split(/: */, 2)
-      status, level = status.split(/, */)
+      max_status, max_temperature, unit = nil, 0, nil
+
+      `acpi -t`.each_line do |l|
+        device, status = l.chomp.split(/: */, 2)
+        status, level = status.split(/, */)
+        temperature, unit = level.split(" degrees")
+        temperature = temperature.to_f
+
+        max_status, max_temperature = status, temperature if temperature > max_temperature
+      end

       color =
-        case [level.to_f, @high, @critical].min
+        case [max_temperature, @high, @critical].min
        when @critical then :error
         when @high then :notice
        end

-      temperature = level.sub(' degrees', '').tr('CF', "\u2103\u2109")
+      temperature = "#{max_temperature} #{unit.tr('CF', "\u2103\u2109")}"

-      [color, "\u2622", temperature, status]
+      [color, "\u2622", temperature, max_status]

     control:
       action:

It shows the maximal temperature

Change display:status from Array into Hash

Hi,

today I had some time to look at the new version. It works really well. The idea of splitting the config files into multiple parts makes the whole config more reusable. Especially the possibility to overwrite config settings from imports at config.yaml file is great. But there is a limitation for status buttons. In the merge method you append items into an array. This is ok but makes it impossible to overwrite settings from status buttons.

Example:

FILE display/status/music/mpd.yaml:

display:
  status:
    - mpd:
      mouse_action:
        right_click: stop_playing_song

FILE config.yaml:

display:
  status:
    - mpd:
      mouse_action:
        right_click: launch_gmpc

This won't work because mpd is an item of an array. If I want to overwrite part of this it added a new Item:
"status" => [{"mpd" => .... }, {"mpd" => ... }]

This will end in an Exception because the "label"-method is not found in one of these items.

MY SOLUTION:
I changed all buttons into an Hash:
"status" => {"mpd" => ..., "acpi" => ...}

FILE: display/status.yaml:

CONFIG['display']['status'].each_pair do |name, definition|
  Status.new name, definition
end

Now it's possible to overwrite settings. But now a new position field is necessary. I solved this in config.yaml:

status:
  mpd:
    position: 2
      mouse_action:
        right_click: launch_gmpc
  vpn:
    position: 3

And used the position field as filename:
file = "#{@Definition['position']||0}-#{name}"

What do you think about that? Any better ideas for the position?

(see commits at http://github.com/nougad/wmiirc)

rumai ipx problems

Not sure that I've to post here my issue but i'm going to try :)

Rumai::IXP is giving me some issues..
issues are present using your wmiirc git project and also using the irb-rumai console following your tutorial

for example at this point

irb:> curr_view.areas[2].unshift terms
Rumai::IXP::Error: bad value -- in reply to #<Rumai::IXP.................

I get the same kind of error when I try to change the layout (stacked, default, etc) with the appropriate keyboard binding...

I'm not really understanding what's going on here.. Maybe you can help me...

By the way, thanks for this great project! I'm a ruby-wmii lover and this seems great to me!

Encoding error! ascii8 utf8 == xterm?

Wel.. i'm here again..

another issue raised up...

i've turned my xterm to utf8+256 colors and something strange happens..

when i'm on a gtk/qt application particularity skype...

I have no idea about that but trying to rise up an xterm with mod4+x as I'm used to
causes wmii to crash giving this error...

<Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and UTF-8>

/home/tha/.wmii/control/action/launch.yaml:control:keyboard_action:launch_terminal:13:in expand_path' /home/tha/.wmii/control/action/launch.yaml:control:keyboard_action:launch_terminal:13:inblock (4 levels) in control'
/home/tha/.wmii/control/action/launch.yaml:control:keyboard_action:launch_terminal:12:in reverse_each' /home/tha/.wmii/control/action/launch.yaml:control:keyboard_action:launch_terminal:12:inblock (3 levels) in control'
/home/tha/.wmii/lib/wmiirc/handler.rb:20:in call' /home/tha/.wmii/lib/wmiirc/handler.rb:20:inblock in handle'
/home/tha/.wmii/lib/wmiirc/handler.rb:19:in each' /home/tha/.wmii/lib/wmiirc/handler.rb:19:inhandle'
/home/tha/.wmii/lib/wmiirc/handler.rb:73:in key' /home/tha/.wmii/lib/wmiirc/config.rb:99:inblock (2 levels) in control'
/home/tha/.wmii/lib/wmiirc/handler.rb:20:in call' /home/tha/.wmii/lib/wmiirc/handler.rb:20:inblock in handle'
/home/tha/.wmii/lib/wmiirc/handler.rb:19:in each' /home/tha/.wmii/lib/wmiirc/handler.rb:19:inhandle'
/home/tha/.wmii/lib/wmiirc/handler.rb:39:in event' /home/tha/.wmii/lib/wmiirc/loader.rb:94:inblock (2 levels) in enter_event_loop'
/home/tha/.wmii/lib/wmiirc/loader.rb:90:in each' /home/tha/.wmii/lib/wmiirc/loader.rb:90:inblock in enter_event_loop'
/usr/local/rvm/gems/ruby-1.9.2-p0/gems/rumai-3.3.1/lib/rumai/fs.rb:105:in each_line' /usr/local/rvm/gems/ruby-1.9.2-p0/gems/rumai-3.3.1/lib/rumai/fs.rb:105:inblock in each_line'

i'm running funtoo linux
ruby 1.9.2 with rvm
wmii-hg with libixp-hg

thank you very much for your help as usual!

let me know if i can be useful

Mattia

ability to save & load sessions

Add the ability to save and load sessions to a YAML file. A "session" action in the wmiirc can be used to script the loading of a default session on startup.

Can't start your wmiirc with latest wmii tip

Hi Sunaku,

I use your wmiirc all the time and find it very useful. Yesterday I updated all wmii related things (had some problems with rumai gem - which did not disappear, don't know how to upgrade it), but unfortunatelym after this your whole wmiirc does not start anymore. This is the output:

/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /home/tom/.wmii-hg/lib/wmiirc/system.rb:38: syntax error, unexpected ',', expecting '=' (SyntaxError)
*arguments, wihack_options = arguments_then_wihack_options
           ^
/home/tom/.wmii-hg/lib/wmiirc/system.rb:72: syntax error, unexpected tIDENTIFIER, expecting tAMPER
...earmouse', *arguments, message, :type => 'DIALOG'
                          ^
/home/tom/.wmii-hg/lib/wmiirc/system.rb:72: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
... *arguments, message, :type => 'DIALOG'
                          ^
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /home/tom/.wmii-hg/lib/wmiirc.rb:33
from /home/tom/.wmii-hg/lib/wmiirc/loader.rb:1:in `require'
from /home/tom/.wmii-hg/lib/wmiirc/loader.rb:1
from ./wmiirc:4:in `require'
from ./wmiirc:4

Do you have any suggestion on what to do?

Thanks in advance,
Tom

bar applets not shown

display:
  [...]
  status:
    - volume:
    - clock:

No problems are indicated in wmiirc.log:

I, [2012-01-09T10:18:39.547018 #17072]  INFO -- : reload
I, [2012-01-09T10:18:39.548205 #17072]  INFO -- : stop
I, [2012-01-09T10:18:39.637789 #17135]  INFO -- : start

modes for keybindings

Keybinding modes are basically a different set of keybindings for different tasks (e.g. no interference; client growing; client positioning; and other uses). They should have a common escape sequence (like Control-Alt-Esc) which returns you to the normal keybindings.

Also add a status bar applet that shows the current keybinding mode. You should be able to right-click it to see a menu of all modes (and switch to the clicked one).

client rule not workiing

Hi sunaku!

Always ghedamat here!

I've updated my personal fork to your last wmiirc

and noticed a few changes..

in particular
I see from your personal config.yaml
that
client:
rule:

has changed...

I've updated my personal config to reflect your changes.
but autotagging for new windows no longer works here...

dunno' if it can help but
wmiirc.log says:

Logfile created on 2011-02-25 10:49:55 +0100 by logger.rb/25413

I, [2011-02-25T10:49:55.174292 #4936] INFO -- : start
W, [2011-02-25T10:49:55.387848 #4936] WARN -- : could not apply some wmii settings: #<Rumai::IXP::Error: file not found -- in reply to #<Rumai::IXP::Twalk:0xa13bcd0 @fields=[#<Rumai::IXP::Struct::Field:0x9f279f8 @name=:tag, @Format=2, @countee=nil, @counter=nil>, #<Rumai::IXP::Struct::Field:0x9f19150 @name=:fid, @Format=4, @countee=nil, @counter=nil>, #<Rumai::IXP::Struct::Field:0x9f18ac0 @name=:newfid, @Format=4, @countee=nil, @counter=nil>, #<Rumai::IXP::Struct::Field:0x9f17d00 @name=:nwname, @Format=2, @countee=#<Rumai::IXP::Struct::StringField:0x9f1760c @name=:wname, @Format=String, @countee=nil, @counter=#<Rumai::IXP::Struct::Field:0x9f17d00 ...>>, @counter=nil>, #<Rumai::IXP::Struct::StringField:0x9f1760c @name=:wname, @Format=String, @countee=nil, @counter=#<Rumai::IXP::Struct::Field:0x9f17d00 @name=:nwname, @Format=2, @countee=#<Rumai::IXP::Struct::StringField:0x9f1760c ...>, @counter=nil>>], @values={:fid=>0, :newfid=>7, :wname=>["rules"], :tag=>8}>>

thank you as usual for your great work and help :)

Opening a terminal (or else) in a client with non ascii label fails

Apply this patch on lib/wmiirc/system.rb:

+++ system.rb.new 2012-11-14 13:39:42.876780962 +0100
@@ -7,7 +7,7 @@
def launch *args
if label = curr_client.label.read rescue nil
label.split(/[\s[]{}()<>"':]+/).reverse_each do |word|

  •    if File.exist? path = File.expand_path(word)
    
  •    if File.exist? path = File.expand_path(word.force_encoding("UTF-8"))
       path = File.dirname(path) unless File.directory? path
       Dir.chdir(path){ launch! *args }
       return
    

Error in launching a terminal when directory does not exist

I use wmii with zsh. Zsh allows one to create named directories. I have a directory called ecse321 in my .zshrc. This allows me to use

cd ~ecse321

to cd to the path that ecse321 points to. Of course, other programs, like wmii and Ruby do not know about these path. This however causes wmii to hang. To reproduce this:

  1. Launch an xterm with title "Terminal: ~ecse321". (This will depend on your setup ...). Make sure that there is no user with the name "ecse321".
  2. Use Mod+Enter to launch a new terminal.

Wmii stops responding to all keyboard events. You can still use the mouse to move to different clients on the current view, but cannot change the view. The wmiirc.log file says

E, [2011-02-28T15:41:21.696664 #32706] ERROR -- : user ecse321 doesn't exist (ArgumentError)
/home/adityam/.wmii-hg/control/action/launch.yaml:control:keyboard_action:launch_terminal:23:in `expand_path'
/home/adityam/.wmii-hg/control/action/launch.yaml:control:keyboard_action:launch_terminal:23:in `block (4 levels) in control'
/home/adityam/.wmii-hg/control/action/launch.yaml:control:keyboard_action:launch_terminal:12:in `reverse_each'
/home/adityam/.wmii-hg/control/action/launch.yaml:control:keyboard_action:launch_terminal:12:in `block (3 levels) in control'
/home/adityam/.wmii-hg/lib/wmiirc/handler.rb:20:in `call'
/home/adityam/.wmii-hg/lib/wmiirc/handler.rb:20:in `block in handle'
/home/adityam/.wmii-hg/lib/wmiirc/handler.rb:19:in `each'
/home/adityam/.wmii-hg/lib/wmiirc/handler.rb:19:in `handle'
/home/adityam/.wmii-hg/lib/wmiirc/handler.rb:73:in `key'
/home/adityam/.wmii-hg/lib/wmiirc/config.rb:100:in `block (2 levels) in control'
/home/adityam/.wmii-hg/lib/wmiirc/handler.rb:20:in `call'
/home/adityam/.wmii-hg/lib/wmiirc/handler.rb:20:in `block in handle'
/home/adityam/.wmii-hg/lib/wmiirc/handler.rb:19:in `each'
/home/adityam/.wmii-hg/lib/wmiirc/handler.rb:19:in `handle'
/home/adityam/.wmii-hg/lib/wmiirc/handler.rb:39:in `event'
/home/adityam/.wmii-hg/lib/wmiirc/loader.rb:94:in `block (2 levels) in enter_event_loop'
/home/adityam/.wmii-hg/lib/wmiirc/loader.rb:90:in `each'
/home/adityam/.wmii-hg/lib/wmiirc/loader.rb:90:in `block in enter_event_loop'
/usr/lib/ruby/gems/1.9.1/gems/rumai-4.0.0/lib/rumai/fs.rb:105:in `each_line'
/usr/lib/ruby/gems/1.9.1/gems/rumai-4.0.0/lib/rumai/fs.rb:105:in `block in each_line'
/usr/lib/ruby/gems/1.9.1/gems/rumai-4.0.0/lib/rumai/ixp/transport.rb:220:in `open'
/usr/lib/ruby/gems/1.9.1/gems/rumai-4.0.0/lib/rumai/fs.rb:84:in `open'
/usr/lib/ruby/gems/1.9.1/gems/rumai-4.0.0/lib/rumai/fs.rb:103:in `each_line'
/home/adityam/.wmii-hg/lib/wmiirc/loader.rb:89:in `enter_event_loop'
/home/adityam/.wmii-hg/lib/wmiirc/loader.rb:15:in `run'
/home/adityam/.wmii-hg/wmiirc:5:in `'
I, [2011-02-28T15:41:21.758462 #32706]  INFO -- : stop

Any ideas on how to avoid this?

persistent arrangements

Allow per-view arrangements to be persistent, so that when new clients enter the view or existing clients leave it, the current arrangement is re-applied.

Also create a status barlet that shows the currently applied persistent view. You should be able to click it to choose a different arrangement (click_menu like volume barlet).

A problem

/usr/lib/ruby/1.9.1/psych.rb:203:in parse' /usr/lib/ruby/1.9.1/psych.rb:203:inparse_stream'
/usr/lib/ruby/1.9.1/psych.rb:151:in parse' /usr/lib/ruby/1.9.1/psych.rb:127:inload'
/usr/lib/ruby/1.9.1/psych.rb:297:in block in load_file' /usr/lib/ruby/1.9.1/psych.rb:297:inopen'
/usr/lib/ruby/1.9.1/psych.rb:297:in load_file' /home/aksr/.wmii-hg/lib/wmiirc/loader.rb:80:inload_user_session'
/home/aksr/.wmii-hg/lib/wmiirc/loader.rb:117:in load_user_config' /home/aksr/.wmii-hg/lib/wmiirc/loader.rb:23:inrun'
/home/aksr/.wmii-hg/wmiirc:5:in `

'

can't convert symbol to string

Hi sunaku!

It's always me :P

recently I've installed wmii on another computer that I use @ work..

and a new issue has raised up...

when I try to use the bindings to invoke the program or action launcer

an error rises up...

it seems that the my wmii/rumai/ruby version doesn't like that much the fact that
in the menu.yaml file

the words

program
action
etc..

are simbols..

editing the yaml file and set them as strings solved the problem but this seems strange to me..
I did not dig that much into this issue 'cause I've a lot of work to do these days, and I also think that this is caused by some error in my configuration

but maybe you can give me an hint...

wmii version: hg
distro: ubuntu 10.04
ruby version: 1.9.1

thank you another time for your help...

ghedamat

file not found - tags.yaml

Hi, I'm new to wmii and wmiirc and I'm getting the following error:

https://gist.github.com/1554351

The rest seems to work fine if I comment out tags.yaml in my config.yaml:

https://github.com/jpablobr/wmiirc/blob/personal/config.yaml

I'm I missing something obvious? :/ I build wmii from:

http://hg.suckless.org/wmii/rev/f3d88385ea7c

$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
$ gem list
*** LOCAL GEMS ***
barometer (0.7.3)
bundler (1.0.21 ruby)
httparty (0.8.1)
kwalify (0.7.2)
librmpd (0.1.1)
multi_json (1.0.4)
multi_xml (0.4.1)
nokogiri (1.5.0)
rake (0.9.2)
rumai (4.1.3)
tzinfo (0.3.31)
$ uname -a
Linux dell-17 3.1.5-1-ARCH #1 SMP PREEMPT Sun Dec 11 06:26:14 UTC 2011 i686 Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz GenuineIntel GNU/Linux

get (TypeError) when script: is set in config.yaml

I'm trying to get wmii and wmiirc-ruby working again after not using it for a while. I downloaded the qwerty branch config.yaml as a basis, but when I try to run wmiirc, it dies with:

E, [2011-06-24T00:36:08.336119 #11155] ERROR -- : can't convert String into Integer (TypeError)
/home/westneat/.wmii/lib/wmiirc/config.rb:38:in `[]'
/home/westneat/.wmii/lib/wmiirc/config.rb:38:in `block in script'
/home/westneat/.wmii/lib/wmiirc/config.rb:36:in `each'
/home/westneat/.wmii/lib/wmiirc/config.rb:36:in `script'
/home/westneat/.wmii/lib/wmiirc/config.rb:13:in `apply'
/home/westneat/.wmii/lib/wmiirc/loader.rb:111:in `load_user_config'
/home/westneat/.wmii/lib/wmiirc/loader.rb:15:in `run'

I am not too familiar with ruby, but it looks like that code converts the script hash table into an array and then tries to index it with the 'before' key. Since it's an array at that point, it fails. Again I don't really understand the code, so I may be misreading it. It seems strange to loop through a hash table when the key is provided. Unless it is supposed to be looping through an array of hash tables, but from what I can tell from dumping self['script'], that is not what is going on. I feel like I must be doing something wrong, but I can't figure it out. TIA for your help.

self['script']: 
{"before"=>"DETACHED_TAG  = '|'\nZOOMED_SUFFIX = /~(\\d+)$/\n\n# keep track of most recently focused view\n$last_view = nil\n\nclass Rumai::View\n  alias __focus__ focus\n\n  def focus\n    $last_view = View.curr\n    __focus__\n  end\nend\n", "after"=>"# desktop wallpaper\nsystem 'test -f ~/.fehbg && sh ~/.fehbg'\n"}

hash (within the each block):
["before", "DETACHED_TAG  = '|'\nZOOMED_SUFFIX = /~(\\d+)$/\n\n# keep track of most recently focused view\n$last_view = nil\n\nclass Rumai::View\n  alias __focus__ focus\n\n  def focus\n    $last_view = View.curr\n    __focus__\n  end\nend\n"]

I also have the config_partial from import for the config.yaml but it's very long, so I won't post it unless you need it.

Compatibility changes for ['script']['before'] section ?

Hi,

I did updated wmiirc scripts to git version but my initialization code in ['script']['before'] key of config.yaml fails to:

  • set global variables. The following code runs but $trans is then invisible for monitors ('display/status').
    require 'r18n-core'
    $trans = R18n::I18n.new(ENV['LANG'])
    ...
  • running threads. Following code runs, ie. creates thread but it's immediately terminated:
    Thread.new do
    ... code of the thread ...
    end

My initialization code of 'script/before' and 'script/after' did worked in wmiirc scripts distributed with wmii upto version 3.9.2 .

Are there some sandboxing techniques to prevent spread of global vars and threads ?!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.