]> git.rmz.io Git - dotfiles.git/commitdiff
Merge branch 'master' of tardis:dotfiles
authorSamir Benmendil <samir.benmendil@gmail.com>
Mon, 9 Feb 2015 14:33:27 +0000 (14:33 +0000)
committerSamir Benmendil <samir.benmendil@gmail.com>
Mon, 9 Feb 2015 14:33:27 +0000 (14:33 +0000)
28 files changed:
dwb/default/bookmarks
dwb/userstyles/reddit.com.css
flexget/config.yml
flexget/plugins/my_exists_movie.py [deleted file]
ranger/rc.conf
systemd/user/sabnzbd.service [new file with mode: 0644]
systemd/user/sickrage.service [new file with mode: 0644]
systemd/user/weechat.service [new file with mode: 0644]
vim/vimrc
weechat/alias.conf
weechat/aspell.conf
weechat/buffer_autoset.conf
weechat/buffers.conf
weechat/charset.conf
weechat/exec.conf
weechat/iset.conf
weechat/logger.conf
weechat/plugins.conf
weechat/python/autoload/screen_away.py [new symlink]
weechat/python/grep.py
weechat/python/screen_away.py [new file with mode: 0644]
weechat/relay.conf
weechat/script.conf
weechat/sec.conf
weechat/trigger.conf
weechat/weechat.conf
weechat/xfer.conf
zsh/lib/completion.zsh

index 19ec207d3d86c214613d6c2ef33e1d2bd0a6a19a..fba02a8af468ec3e823fecb20c33242c12e9c098 100644 (file)
@@ -19,3 +19,4 @@ https://www.facebook.com/ Facebook
 https://www.humblebundle.com/ Humble Bundle
 https://www.loomio.org/ Loomio
 https://www.usenet-crawler.com/ Welcome back - usenet-crawler - A dark place to download nzbs
+http://192.168.1.1/ DD-WRT (build 18007) - Info
index 7d029a772702edc0f9277e38f3c9b2b1f05c797c..469f5a7ec032712c2457f39f71c1bd2147c19d37 100644 (file)
@@ -361,6 +361,11 @@ blockquote p {
   background : #1c1c1c !important
 }
 
+.md code, .md pre, .usertext-edit textarea code, .usertext-edit textarea pre {
+    background-color: #1c1c1c !important;
+    border-color: #2c2c2c !important;
+}
+
 .link.self.md {
   border : 1px solid #333 !important
 }
@@ -398,11 +403,12 @@ blockquote p {
   border : 1px solid #333 !important
 }
 
-.usertext-body.md {
+.link .usertext .md {
   background : #222 !important;
-  border-left : 2px solid #333 !important;
+  border-left : 2px solid !important;
   -webkit-border-radius : 5px !important;
   border-radius : 5px !important;
+  border-color: #333 !important;
   margin-top : 1em !important
 }
 
index 6874e6510cf061e068eb2d7d438aa71fdea59088..ecde19050d328e9e9add1a8a1ce26c28a6899549 100644 (file)
@@ -117,11 +117,12 @@ templates: # {{{1
       min_score: 7.5
       min_votes: 30000
     imdb_required: on
-    my_exists_movie:
+    exists_movie:
       path:
         - '/mnt/Skaro/Movies'
       allow_different_qualities: better
       type: files
+      lookup: imdb
 
 
 tasks: # {{{1
@@ -181,7 +182,8 @@ tasks: # {{{1
     priority: 2
 
     seen: local
-    disable_builtins: [retry_failed]
+    disable:
+      - retry_failed
     no_entries_ok: yes
 
     find:
@@ -220,7 +222,8 @@ tasks: # {{{1
     priority: 3
 
     seen: local
-    disable_builtins: [retry_failed]
+    disable:
+      - retry_failed
     no_entries_ok: yes
 
     find:
diff --git a/flexget/plugins/my_exists_movie.py b/flexget/plugins/my_exists_movie.py
deleted file mode 100644 (file)
index 92d6e12..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-from __future__ import unicode_literals, division, absolute_import
-import os
-import re
-import logging
-
-from flexget import plugin
-from flexget.event import event
-from flexget.config_schema import one_or_more
-from flexget.plugin import get_plugin_by_name
-from flexget.utils.tools import TimedDict
-
-log = logging.getLogger('my_exists_movie')
-
-
-class FilterExistsMovie(object):
-    """
-    Reject existing movies.
-
-    Example::
-
-      exists_movie: /storage/movies/
-    """
-
-    schema = {
-        'anyOf': [
-            one_or_more({'type': 'string', 'format': 'path'}),
-            {
-                'type': 'object',
-                'properties': {
-                    'path': one_or_more({'type': 'string', 'format': 'path'}),
-                    'allow_different_qualities': {'enum': ['better', True, False], 'default': False},
-                    'type': {'enum': ['files', 'dirs'], 'default': 'files'}
-                },
-                'required': ['path'],
-                'additionalProperties': False
-            }
-        ]
-    }
-
-    def __init__(self):
-        self.cache = TimedDict(cache_time='1 hour')
-
-    def prepare_config(self, config):
-        # if config is not a dict, assign value to 'path' key
-        if not isinstance(config, dict):
-            config = {'path': config}
-        # if only a single path is passed turn it into a 1 element list
-        if isinstance(config['path'], basestring):
-            config['path'] = [config['path']]
-        return config
-
-    @plugin.priority(-1)
-    def on_task_filter(self, task, config):
-        # if not task.accepted:
-        #     log.debug('nothing accepted, aborting')
-        #     return
-
-        config = self.prepare_config(config)
-        imdb_lookup = plugin.get_plugin_by_name('imdb_lookup').instance
-
-        incompatible_files = 0
-        incompatible_entries = 0
-        count_entries = 0
-        count_files = 0
-
-        # list of imdb ids gathered from paths / cache
-        qualities = {}
-
-        for folder in config['path']:
-            folder = os.path.expanduser(folder)
-            # see if this path has already been scanned
-            if folder in self.cache:
-                log.verbose('Using cached scan for %s ...' % folder)
-                qualities.update(self.cache[folder])
-                continue
-
-            path_ids = {}
-
-            if not os.path.isdir(folder):
-                log.critical('Path %s does not exist' % folder)
-                continue
-
-            log.verbose('Scanning path %s ...' % folder)
-
-            # Help debugging by removing a lot of noise
-            #logging.getLogger('movieparser').setLevel(logging.WARNING)
-            #logging.getLogger('imdb_lookup').setLevel(logging.WARNING)
-
-            # scan through
-            for root, dirs, files in os.walk(folder):
-                for item in eval(config['type']):
-                    log.debug("item: %s" % item)
-                    pattern = re.compile(".*\.(avi|mkv|mp4|mpg|webm)")
-                    if not re.search(pattern, item):
-                        continue
-                    count_files += 1
-
-                    movie = get_plugin_by_name('parsing').instance.parse_movie(item)
-
-                    try:
-                        imdb_id = imdb_lookup.imdb_id_lookup(movie_title=movie.name,
-                                                            raw_title=item,
-                                                            session=task.session)
-                        if imdb_id in path_ids:
-                            log.trace('duplicate %s' % item)
-                            continue
-                        if imdb_id is not None:
-                            log.trace('adding: %s' % imdb_id)
-                            path_ids[imdb_id] = movie.quality
-                    except plugin.PluginError as e:
-                        log.trace('%s lookup failed (%s)' % (item, e.value))
-                        incompatible_files += 1
-
-            # store to cache and extend to found list
-            self.cache[folder] = path_ids
-            qualities.update(path_ids)
-
-        log.debug('qualities: %s' % qualities)
-
-        log.debug('-- Start filtering entries ----------------------------------')
-
-        # do actual filtering
-        for entry in task.accepted:
-            count_entries += 1
-            if not entry.get('imdb_id', eval_lazy=False):
-                try:
-                    imdb_lookup.lookup(entry)
-                except plugin.PluginError as e:
-                    log.trace('entry %s imdb failed (%s)' % (entry['title'], e.value))
-                    incompatible_entries += 1
-                    continue
-
-            entry.trace("msg")
-            # actual filtering
-            if entry['imdb_id'] in qualities:
-                if config.get('allow_different_qualities') == 'better':
-                    if entry['quality'] > qualities[entry['imdb_id']]:
-                        log.trace('better quality')
-                        continue
-                elif config.get('allow_different_qualities'):
-                    if entry['quality'] != qualities[entry['imdb_id']]:
-                        log.trace('wrong quality')
-                        continue
-
-                entry.reject('movie exists')
-
-        if incompatible_files or incompatible_entries:
-            log.verbose('There were some incompatible items. %s of %s entries '
-                        'and %s of %s directories could not be verified.' %
-                (incompatible_entries, count_entries, incompatible_files, count_dirs))
-
-        log.debug('-- Finished filtering entries -------------------------------')
-
-@event('plugin.register')
-def register_plugin():
-    plugin.register(FilterExistsMovie, 'my_exists_movie', groups=['exists'], api_ver=2)
index 6532db861401ddb3871fffaf31d24d74e7a50ed3..15694926d310704f02a7d486d84fa189f5765373 100644 (file)
@@ -348,7 +348,7 @@ setlocal path=~/downloads sort mtime
 #map <A-Left>  tab_move -1
 #map gt        tab_move 1
 #map gT        tab_move -1
-#map gn        tab_new ~
+map gn        tab_new
 #map gc        tab_close
 #map uq        tab_restore
 map <a-!>     tab_open 1
diff --git a/systemd/user/sabnzbd.service b/systemd/user/sabnzbd.service
new file mode 100644 (file)
index 0000000..5ef576d
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=SABnzbd binary newsreader
+
+[Service]
+ExecStart=/opt/sabnzbd/SABnzbd.py --config-file %h/.config/sabnzbd/sabnzbd.conf
+
+[Install]
+WantedBy=default.target
diff --git a/systemd/user/sickrage.service b/systemd/user/sickrage.service
new file mode 100644 (file)
index 0000000..d761136
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=SickRage Daemon
+
+[Service]
+ExecStart=/usr/bin/env python2 /opt/sickrage/SickBeard.py --quiet --config %h/.config/sickrage/config.ini --datadir %h/.local/share/sickrage
+
+[Install]
+WantedBy=default.target
diff --git a/systemd/user/weechat.service b/systemd/user/weechat.service
new file mode 100644 (file)
index 0000000..618fd18
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Start weechat in detached tmux session
+
+[Service]
+Type=forking
+Restart=on-failure
+ExecStart=/usr/bin/tmux -f %h/.config/tmux.conf new-session -s weechat -d weechat
+ExecStop=/usr/bin/tmux kill-session -t weechat
+
+[Install]
+WantedBy=default.target
index 14ebec3c88ced741c33610555cc35bf75507eb83..810f2f58f686c199a8ccd84bd7aeb3aaf4ba2783 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -438,6 +438,7 @@ autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTree
 " python-mode {{{2
 
 let g:pymode_rope_completion = 0
+let g:pymode_rope = 0
 let g:pymode_folding = 1
 
 " synastic {{{2
index 51a5bb0dbdf10d67b0aade05d1ee1acca2a35164..c5a5b1f54bc78f3621b19e2fb1d9c9fcf08d22f7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# alias.conf -- weechat v1.1
+# alias.conf -- weechat v1.1.1
 #
 
 [cmd]
index 4fbeb6ee03e6f0eda3c5ac91be8f606267f93df3..0f352411c0d265cb6674a4c1d517ff5332a633af 100644 (file)
@@ -1,5 +1,5 @@
 #
-# aspell.conf -- weechat v1.1
+# aspell.conf -- weechat v1.1.1
 #
 
 [color]
index 301fe654e445b533c033cd451754232668ece4d4..92ccf11f65c89196f3793469b9b7b92465afb2ff 100644 (file)
@@ -1,5 +1,5 @@
 #
-# buffer_autoset.conf -- weechat v1.1
+# buffer_autoset.conf -- weechat v1.1.1
 #
 
 [buffer]
index d04517fd23d0976cf0448165b4da6b291f7b04c7..4d2546992ede6f37bab24780d9f2b10153bbdeee 100644 (file)
@@ -1,5 +1,5 @@
 #
-# buffers.conf -- weechat v1.1
+# buffers.conf -- weechat v1.1.1
 #
 
 [color]
index ccb87aada5cc6b05a27572a412f1b7c6b7b87689..c319dd333c9871182732b732791e3ee9c23eb77b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# charset.conf -- weechat v1.1
+# charset.conf -- weechat v1.1.1
 #
 
 [default]
index 895c99ee6c8ced148d972b8d8687a628fcbc444a..f7f62123345dcf32dfdfbe348fe4cc679a540384 100644 (file)
@@ -1,5 +1,5 @@
 #
-# exec.conf -- weechat v1.1
+# exec.conf -- weechat v1.1.1
 #
 
 [command]
index 8d6e31891b93831702031305b7d6690d876e158c..32f3c616d7c63a90ac21cf20551b996782c555a7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# iset.conf -- weechat v1.1
+# iset.conf -- weechat v1.1.1
 #
 
 [color]
index c98c4a01f0e3c207ed50896757bab25ea0ebe80c..82a5cfd343040c87e663c511471d1859acf5643d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# logger.conf -- weechat v1.1
+# logger.conf -- weechat v1.1.1
 #
 
 [look]
index 4d23b882319ea7118ac2b87432988119078ebab3..42ba279e58d492add0bbbd3efc598b3a6a977b69 100644 (file)
@@ -1,5 +1,5 @@
 #
-# plugins.conf -- weechat v1.1
+# plugins.conf -- weechat v1.1.1
 #
 
 [var]
@@ -45,6 +45,15 @@ python.grep.log_filter = ""
 python.grep.max_lines = "4000"
 python.grep.show_summary = "on"
 python.grep.size_limit = "2048"
+python.screen_away.away_suffix = ""
+python.screen_away.command_on_attach = ""
+python.screen_away.command_on_detach = ""
+python.screen_away.ignore = ""
+python.screen_away.ignore_relays = "off"
+python.screen_away.interval = "5"
+python.screen_away.message = "Detached from tmux"
+python.screen_away.set_away = "on"
+python.screen_away.time_format = "since %Y-%m-%d %H:%M:%S%z"
 ruby.check_license = "off"
 tcl.check_license = "off"
 
@@ -66,3 +75,12 @@ perl.beep.bell_always = "use $bell on private messages and/or highlights regardl
 perl.beep.blacklist_nicks = "comma-separated list of "server.nick": if not empty, these nicks will not be able to trigger execution of commands. Cannot be used in conjuction with whitelist (example: "freenode.nick1,freenode.nick2") (default: "")"
 perl.beep.whitelist_channels = "comma-separated list of "server.#channel": if not empty, only these channels will trigger execution of commands (example: "freenode.#weechat,freenode.#channel2") (default: "")"
 perl.beep.whitelist_nicks = "comma-separated list of "server.nick": if not empty, only these nicks will trigger execution of commands (example: "freenode.nick1,freenode.nick2") (default: "")"
+python.screen_away.away_suffix = "What to append to your nick when you're away."
+python.screen_away.command_on_attach = "Commands to execute on attach, separated by semicolon"
+python.screen_away.command_on_detach = "Commands to execute on detach, separated by semicolon"
+python.screen_away.ignore = "Comma-separated list of servers to ignore."
+python.screen_away.ignore_relays = "Only check screen status and ignore relay interfaces"
+python.screen_away.interval = "How often in seconds to check screen status"
+python.screen_away.message = "Away message"
+python.screen_away.set_away = "Set user as away."
+python.screen_away.time_format = "time format append to away message"
diff --git a/weechat/python/autoload/screen_away.py b/weechat/python/autoload/screen_away.py
new file mode 120000 (symlink)
index 0000000..e485b70
--- /dev/null
@@ -0,0 +1 @@
+../screen_away.py
\ No newline at end of file
index 6d08ecdc1063961ac09b267700c2cb761e320172..fd9ca2bbd56d18d0430afc88f055086aed9c5f49 100644 (file)
@@ -65,6 +65,9 @@
 #
 #
 #   History:
+#   2015-01-14, nils_2
+#   version 0.7.4: make q work to quit grep buffer (requested by: gb)
+#
 #   2014-03-29, Felix Eckhofer <felix@tribut.de>
 #   version 0.7.3: fix typo
 #
@@ -191,7 +194,7 @@ except ImportError:
 
 SCRIPT_NAME    = "grep"
 SCRIPT_AUTHOR  = "Elián Hanisch <lambdae2@gmail.com>"
-SCRIPT_VERSION = "0.7.3"
+SCRIPT_VERSION = "0.7.4"
 SCRIPT_LICENSE = "GPL3"
 SCRIPT_DESC    = "Search in buffers and logs"
 SCRIPT_COMMAND = "grep"
@@ -1144,7 +1147,7 @@ def buffer_update():
         note = ' (last %s lines shown)' %len(matched_lines)
     else:
         note = ''
-    title = "Search in %s%s%s %s matches%s | pattern \"%s%s%s\"%s %s | %.4f seconds (%.2f%%)" \
+    title = "'q': close buffer | Search in %s%s%s %s matches%s | pattern \"%s%s%s\"%s %s | %.4f seconds (%.2f%%)" \
             %(color_title, matched_lines, color_reset, matched_lines.get_matches_count(), note,
               color_title, pattern_tmpl, color_reset, invert and ' (inverted)' or '', format_options(),
               time_total, time_grep_pct)
@@ -1239,6 +1242,9 @@ def buffer_input(data, buffer, input_data):
         cmd_grep_stop(buffer, input_data)
     except:
         return WEECHAT_RC_OK
+    if input_data in ('q', 'Q'):
+        weechat.buffer_close(buffer)
+        return weechat.WEECHAT_RC_OK
 
     global search_in_buffers, search_in_files
     global pattern
diff --git a/weechat/python/screen_away.py b/weechat/python/screen_away.py
new file mode 100644 (file)
index 0000000..8f68505
--- /dev/null
@@ -0,0 +1,197 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2009 by xt <xt@bash.no>
+# Copyright (c) 2009 by penryu <penryu@gmail.com>
+# Copyright (c) 2010 by Blake Winton <bwinton@latte.ca>
+# Copyright (c) 2010 by Aron Griffis <agriffis@n01se.net>
+# Copyright (c) 2010 by Jani Kesänen <jani.kesanen@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+#
+# (this script requires WeeChat 0.3.0 or newer)
+#
+# History:
+# 2014-08-02, Nils Görs <weechatter@arcor.de>
+#  version 0.14: add time to detach message. (idea by Mikaela)
+# 2014-06-19, Anders Bergh <anders1@gmail.com>
+#  version 0.13: Fix a simple typo in an option description.
+# 2014-01-12, Phyks (Lucas Verney) <phyks@phyks.me>
+#  version 0.12: Added an option to check status of relays to set unaway in
+#                   case of a connected relay.
+# 2013-08-30, Anders Einar Hilden <hildenae@gmail.com>
+#  version: 0.11: Fix reading of set_away
+# 2013-06-16, Renato Botelho <rbgarga@gmail.com>
+#  version 0.10: add option to don't set away, only change nick
+#                   allow multiple commands on attach/dettach
+#                   do not add suffix if nick already have it
+# 2012-12-29, David Flatz <david@upcs.at>
+#  version 0.9: add option to ignore servers and don't set away status for them
+#               add descriptions to config options
+# 2010-08-07, Filip H.F. "FiXato" Slagter <fixato@gmail.com>
+#  version 0.8: add command on attach feature
+# 2010-05-07, Jani Kesänen <jani.kesanen@gmail.com>
+#  version 0.7: add command on detach feature
+# 2010-03-07, Aron Griffis <agriffis@n01se.net>
+#  version 0.6: move socket check to register,
+#               add hook_config for interval,
+#               reduce default interval from 60 to 5
+# 2010-02-19, Blake Winton <bwinton@latte.ca>
+#  version 0.5: add option to change nick when away
+# 2010-01-18, xt
+#  version 0.4: only update servers that are connected
+# 2009-11-30, xt <xt@bash.no>
+#  version 0.3: do not touch servers that are manually set away
+# 2009-11-27, xt <xt@bash.no>
+#  version 0.2: code for TMUX from penryu
+# 2009-11-27, xt <xt@bash.no>
+#  version 0.1: initial release
+
+import weechat as w
+import re
+import os
+import datetime, time
+
+SCRIPT_NAME    = "screen_away"
+SCRIPT_AUTHOR  = "xt <xt@bash.no>"
+SCRIPT_VERSION = "0.14"
+SCRIPT_LICENSE = "GPL3"
+SCRIPT_DESC    = "Set away status on screen detach"
+
+settings = {
+        'message': ('Detached from screen', 'Away message'),
+        'time_format': ('since %Y-%m-%d %H:%M:%S%z', 'time format append to away message'),
+        'interval': ('5', 'How often in seconds to check screen status'),
+        'away_suffix': ('', 'What to append to your nick when you\'re away.'),
+        'command_on_attach': ('', 'Commands to execute on attach, separated by semicolon'),
+        'command_on_detach': ('', 'Commands to execute on detach, separated by semicolon'),
+        'ignore': ('', 'Comma-separated list of servers to ignore.'),
+        'set_away': ('on', 'Set user as away.'),
+        'ignore_relays': ('off', 'Only check screen status and ignore relay interfaces'),
+}
+
+TIMER = None
+SOCK = None
+AWAY = False
+CONNECTED_RELAY = False
+
+def set_timer():
+    '''Update timer hook with new interval'''
+
+    global TIMER
+    if TIMER:
+        w.unhook(TIMER)
+    TIMER = w.hook_timer(int(w.config_get_plugin('interval')) * 1000,
+            0, 0, "screen_away_timer_cb", '')
+
+def screen_away_config_cb(data, option, value):
+    if option.endswith(".interval"):
+        set_timer()
+    return w.WEECHAT_RC_OK
+
+def get_servers():
+    '''Get the servers that are not away, or were set away by this script'''
+
+    ignores = w.config_get_plugin('ignore').split(',')
+    infolist = w.infolist_get('irc_server','','')
+    buffers = []
+    while w.infolist_next(infolist):
+        if not w.infolist_integer(infolist, 'is_connected') == 1 or \
+               w.infolist_string(infolist, 'name') in ignores:
+            continue
+        if not w.config_string_to_boolean(w.config_get_plugin('set_away')) or \
+                not w.infolist_integer(infolist, 'is_away') or \
+                    w.config_get_plugin('message') in w.infolist_string(infolist, 'away_message'):
+#                    w.infolist_string(infolist, 'away_message') == \
+#                    w.config_get_plugin('message'):
+            buffers.append((w.infolist_pointer(infolist, 'buffer'),
+                w.infolist_string(infolist, 'nick')))
+    w.infolist_free(infolist)
+    return buffers
+
+def screen_away_timer_cb(buffer, args):
+    '''Check if screen is attached, update awayness'''
+
+    global AWAY, SOCK, CONNECTED_RELAY
+
+    set_away = w.config_string_to_boolean(w.config_get_plugin('set_away'))
+    check_relays = not w.config_string_to_boolean(w.config_get_plugin('ignore_relays'))
+    suffix = w.config_get_plugin('away_suffix')
+    attached = os.access(SOCK, os.X_OK) # X bit indicates attached
+
+    # Check wether a client is connected on relay or not
+    CONNECTED_RELAY = False
+    if check_relays:
+        infolist = w.infolist_get('relay', '', '')
+        if infolist:
+            while w.infolist_next(infolist):
+                status = w.infolist_string(infolist, 'status_string')
+                if status == 'connected':
+                    CONNECTED_RELAY = True
+                    break
+            w.infolist_free(infolist)
+
+    if (attached and AWAY) or (check_relays and CONNECTED_RELAY and not attached and AWAY):
+        w.prnt('', '%s: Screen attached. Clearing away status' % SCRIPT_NAME)
+        for server, nick in get_servers():
+            if set_away:
+                w.command(server,  "/away")
+            if suffix and nick.endswith(suffix):
+                nick = nick[:-len(suffix)]
+                w.command(server,  "/nick %s" % nick)
+        AWAY = False
+        for cmd in w.config_get_plugin("command_on_attach").split(";"):
+            w.command("", cmd)
+
+    elif not attached and not AWAY:
+        if not CONNECTED_RELAY:
+            w.prnt('', '%s: Screen detached. Setting away status' % SCRIPT_NAME)
+            for server, nick in get_servers():
+                if suffix and not nick.endswith(suffix):
+                    w.command(server, "/nick %s%s" % (nick, suffix));
+                if set_away:
+                    w.command(server, "/away %s %s" % (w.config_get_plugin('message'), time.strftime(w.config_get_plugin('time_format'))))
+            AWAY = True
+            for cmd in w.config_get_plugin("command_on_detach").split(";"):
+                w.command("", cmd)
+
+    return w.WEECHAT_RC_OK
+
+
+if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
+                    SCRIPT_DESC, "", ""):
+    version = w.info_get('version_number', '') or 0
+    for option, default_desc in settings.iteritems():
+        if not w.config_is_set_plugin(option):
+            w.config_set_plugin(option, default_desc[0])
+        if int(version) >= 0x00030500:
+            w.config_set_desc_plugin(option, default_desc[1])
+
+    if 'STY' in os.environ.keys():
+        # We are running under screen
+        cmd_output = os.popen('env LC_ALL=C screen -ls').read()
+        match = re.search(r'Sockets? in (/.+)\.', cmd_output)
+        if match:
+            SOCK = os.path.join(match.group(1), os.environ['STY'])
+
+    if not SOCK and 'TMUX' in os.environ.keys():
+        # We are running under tmux
+        socket_data = os.environ['TMUX']
+        SOCK = socket_data.rsplit(',',2)[0]
+
+    if SOCK:
+        set_timer()
+        w.hook_config("plugins.var.python." + SCRIPT_NAME + ".*",
+            "screen_away_config_cb", "")
index dbd6b8c44ef90b08ba8b157e8e204c6250b41a99..f5de35059e6a1f97dd6b5532430613708c06220a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# relay.conf -- weechat v1.1
+# relay.conf -- weechat v1.1.1
 #
 
 [look]
index 59fc23a97fecf9ab7b38c33b31234b6a1acd7f29..866bb1d53521007a5a83aafe7fb407f79f33ad32 100644 (file)
@@ -1,5 +1,5 @@
 #
-# script.conf -- weechat v1.1
+# script.conf -- weechat v1.1.1
 #
 
 [look]
index 899f2a1c6fc8564be1a6f0ea8d759a10e6c4d3e8..53c1e2f787ff8ae24484c5d4079eaaa09cf4e1dc 100644 (file)
@@ -1,5 +1,5 @@
 #
-# sec.conf -- weechat v1.1
+# sec.conf -- weechat v1.1.1
 #
 
 [crypt]
index da3156759d3db0416b9525035ca41421ae9e45eb..2f638e307d0f861d50f42fbcacf93d5195573576 100644 (file)
@@ -1,5 +1,5 @@
 #
-# trigger.conf -- weechat v1.1
+# trigger.conf -- weechat v1.1.1
 #
 
 [look]
index a3d62880130cd1a96e3a7a3da00461e660d24737..fd924111fbcc63f3c797308334721f84dfaeb6c9 100644 (file)
@@ -1,5 +1,5 @@
 #
-# weechat.conf -- weechat v1.1
+# weechat.conf -- weechat v1.1.1
 #
 
 [debug]
index 43ec7b2486c5e09a7ca7bc1f0ab08ba3d92d922c..43d14444c669e8b23197100182a5565e3011710c 100644 (file)
@@ -1,5 +1,5 @@
 #
-# xfer.conf -- weechat v1.1
+# xfer.conf -- weechat v1.1.1
 #
 
 [look]
index 2acc0b071a1962e83ab95902e7ce95e59841bdbd..5e852867f904872be9387a92d30f250adb639192 100644 (file)
@@ -27,19 +27,6 @@ zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm
 zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
 cdpath=(.)
 
-# use /etc/hosts and known_hosts for hostname completion
-[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
-[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
-[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
-hosts=(
-  "$_global_ssh_hosts[@]"
-  "$_ssh_hosts[@]"
-  "$_etc_hosts[@]"
-  "$HOST"
-  localhost
-)
-zstyle ':completion:*:hosts' hosts $hosts
-
 # Use caching so that commands like apt and dpkg complete are useable
 zstyle ':completion::complete:*' use-cache 1
 zstyle ':completion::complete:*' cache-path $ZSH_CACHE/complete