From cbd69458ae95c104867d7e1d748f25b9725cf845 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 5 Feb 2017 12:48:11 +0100 Subject: [PATCH 01/16] awesome: update net_widgets fix deprecated functions --- awesome/widgets/net_widgets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awesome/widgets/net_widgets b/awesome/widgets/net_widgets index 6f86968..14ddf2e 160000 --- a/awesome/widgets/net_widgets +++ b/awesome/widgets/net_widgets @@ -1 +1 @@ -Subproject commit 6f869684f7745c7e7aae9336facdc47d2896cc30 +Subproject commit 14ddf2e767ab2f4be8b032f51f7d37cafadf2d9a -- 2.49.0 From 59131641038082e0afc0e76a9ef8dd86b965c1d3 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 5 Feb 2017 13:07:24 +0100 Subject: [PATCH 02/16] awesome: update awesompd submodule fix depcretaded functions --- awesome/widgets/awesompd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awesome/widgets/awesompd b/awesome/widgets/awesompd index 3157a1c..d9a2e4b 160000 --- a/awesome/widgets/awesompd +++ b/awesome/widgets/awesompd @@ -1 +1 @@ -Subproject commit 3157a1c765ce4ae9130ee472d162bcf4026965d1 +Subproject commit d9a2e4b2d274eab33e09bd1544f0ed0b94a488c2 -- 2.49.0 From 3910639f1a69138a73e072da946e056e31de76ef Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 5 Feb 2017 13:22:38 +0100 Subject: [PATCH 03/16] awesome: use wibox.widget.textclock --- awesome/widgets/calendar.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awesome/widgets/calendar.lua b/awesome/widgets/calendar.lua index 9663872..565e390 100644 --- a/awesome/widgets/calendar.lua +++ b/awesome/widgets/calendar.lua @@ -9,6 +9,7 @@ local awful = require("awful") local beautiful = require("beautiful") local naughty = require("naughty") +local wibox = require("wibox") local io = { popen = io.popen } local os = { date = os.date } @@ -22,7 +23,7 @@ calendar.bg = beautiful.bg_normal or "#FFFFFF" calendar.position = "top_right" calendar.offset = 0 -local calwidget = awful.widget.textclock(" %a %b %d, %H:%M ", 10) +local calwidget = wibox.widget.textclock(" %a %b %d, %H:%M ", 10) calwidget:connect_signal("mouse::enter", function () calendar:show(0) end) calwidget:connect_signal("mouse::leave", function () calendar:hide() end) -- 2.49.0 From 240b794352afb2dd71f3a2299c5735d3a1e1a825 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sat, 25 Feb 2017 18:37:56 +0100 Subject: [PATCH 04/16] awesome: fix battery_widget Turns out it was not an actual '-' char that is returned by vicious, but a m-dash or something. --- awesome/widgets/battery_widget.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/awesome/widgets/battery_widget.lua b/awesome/widgets/battery_widget.lua index 3cdcb3e..dceaacd 100644 --- a/awesome/widgets/battery_widget.lua +++ b/awesome/widgets/battery_widget.lua @@ -33,7 +33,7 @@ local function batclosure () return function (_, args) local state, charge = args[1], args[2] if not charge then return end - if state ~= "-" then + if state == "−" then dirsign = "↓" if charge <= nextlim then naughty.notify({title = "⚡ Warning! ⚡", @@ -45,7 +45,7 @@ local function batclosure () }) nextlim = getnextlim(charge) end - elseif state ~= "+" then + elseif state == "+" then dirsign = "↑" nextlim = limits[1][1] else @@ -57,6 +57,6 @@ local function batclosure () end batterywidget = wibox.widget.textbox() -vicious.register(batterywidget, vicious.widgets.bat, batclosure(), 31, "BAT0") +vicious.register(batterywidget, vicious.widgets.bat, batclosure(), 5, "BAT0") return batterywidget -- 2.49.0 From a7a81febd20e17ca98b6724238928e7f8fd7c501 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 26 Feb 2017 15:15:08 +0000 Subject: [PATCH 05/16] bin: diary should not open a new terminal the caller needs to handle this. --- bin/diary | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/diary b/bin/diary index 6cd2a7a..e6ec3a2 100755 --- a/bin/diary +++ b/bin/diary @@ -1,8 +1,6 @@ #!/usr/bin/env bash -name=diary - -/usr/bin/urxvt -name $name -e vim \ +vim \ -c "call vimwiki#diary#make_note(v:count1)" \ + \ -c 'r !date +"\%n== \%H:\%M ==\%n * "' \ -- 2.49.0 From 625b3de22d66db246e05176abd50730e60bfa40b Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 26 Feb 2017 17:57:42 +0000 Subject: [PATCH 06/16] awesome: update pomodoro submodule --- awesome/widgets/pomodoro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awesome/widgets/pomodoro b/awesome/widgets/pomodoro index c2f8eae..b7aca69 160000 --- a/awesome/widgets/pomodoro +++ b/awesome/widgets/pomodoro @@ -1 +1 @@ -Subproject commit c2f8eae0f97f66206cf6999eadbb6d18c21f5970 +Subproject commit b7aca69dd5c74df33f6cc7e3902578cc71f582ce -- 2.49.0 From 25631bd727142af9b8d7e2b67170f3aff7140e60 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Mon, 27 Feb 2017 01:12:15 +0000 Subject: [PATCH 07/16] awesome: update pomodoro module and config --- awesome/widgets/pomodoro | 2 +- awesome/widgets/pomodoro.lua | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/awesome/widgets/pomodoro b/awesome/widgets/pomodoro index b7aca69..2b02f66 160000 --- a/awesome/widgets/pomodoro +++ b/awesome/widgets/pomodoro @@ -1 +1 @@ -Subproject commit b7aca69dd5c74df33f6cc7e3902578cc71f582ce +Subproject commit 2b02f66d1ee0f99a3a084d918cabb3bdfd8d4f19 diff --git a/awesome/widgets/pomodoro.lua b/awesome/widgets/pomodoro.lua index 46ca538..7e7a5c1 100644 --- a/awesome/widgets/pomodoro.lua +++ b/awesome/widgets/pomodoro.lua @@ -8,6 +8,7 @@ pomodoro.work_duration = 25 * 60 -- format string pomodoro.format = function (t) return " "..t.."" end +pomodoro.auto_start_pomodoro = false pomodoro.init() @@ -19,12 +20,12 @@ pombox:add(pomodoro.widget) -- pomodoro:connect_signal("stop_working", function () naughty.notify{ text = "stop_working", timeout = 10 } end) -- pomodoro:connect_signal("stop_pause", function () naughty.notify{ text = "stop_pause", timeout = 10 } end) -- pomodoro:connect_signal("start_working", function () naughty.notify{ text = "start_working", timeout = 10 } end) -pomodoro:connect_signal("start_pause", function () +pomodoro:connect_signal("work_stop", function () awful.spawn(terminal.." -name diary -e diary") end) globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey, "Shift" }, "p", function() pomodoro:start() end) + awful.key({ modkey, "Shift" }, "p", function() pomodoro:toggle() end) ) return pombox -- 2.49.0 From 2baa43495669f83adbcf15655c3f2685b9455ec2 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 28 Feb 2017 14:28:50 +0000 Subject: [PATCH 08/16] weechat: update wee-slack --- weechat/python/wee-slack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weechat/python/wee-slack b/weechat/python/wee-slack index 1bc423a..01beb42 160000 --- a/weechat/python/wee-slack +++ b/weechat/python/wee-slack @@ -1 +1 @@ -Subproject commit 1bc423a87baf4f2eede8974cd7a2f3f6b29aaebf +Subproject commit 01beb42fec5c6dbfc0d8c53ce1de88b48b48f6db -- 2.49.0 From 5b5de3e1601c75bbc9c26cc80f9d0e55882385ff Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 28 Feb 2017 14:32:56 +0000 Subject: [PATCH 09/16] weechat: update settings --- weechat/alias.conf | 7 +++++++ weechat/aspell.conf | 7 +++++++ weechat/buffer_autoset.conf | 7 +++++++ weechat/buffers.conf | 7 +++++++ weechat/charset.conf | 7 +++++++ weechat/exec.conf | 7 +++++++ weechat/iset.conf | 7 +++++++ weechat/logger.conf | 7 +++++++ weechat/plugins.conf | 7 +++++++ weechat/relay.conf | 7 +++++++ weechat/script.conf | 7 +++++++ weechat/sec.conf | 7 +++++++ weechat/trigger.conf | 7 +++++++ weechat/weechat.conf | 8 ++++++++ weechat/xfer.conf | 7 +++++++ 15 files changed, 106 insertions(+) diff --git a/weechat/alias.conf b/weechat/alias.conf index d2cabe4..d0687c2 100644 --- a/weechat/alias.conf +++ b/weechat/alias.conf @@ -1,6 +1,13 @@ # # weechat -- alias.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [cmd] AAWAY = "allserv /away" diff --git a/weechat/aspell.conf b/weechat/aspell.conf index c3d12dc..5b2a417 100644 --- a/weechat/aspell.conf +++ b/weechat/aspell.conf @@ -1,6 +1,13 @@ # # weechat -- aspell.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [color] misspelled = lightred diff --git a/weechat/buffer_autoset.conf b/weechat/buffer_autoset.conf index 0cc0b92..519613c 100644 --- a/weechat/buffer_autoset.conf +++ b/weechat/buffer_autoset.conf @@ -1,6 +1,13 @@ # # weechat -- buffer_autoset.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [look] instant = on diff --git a/weechat/buffers.conf b/weechat/buffers.conf index 633fc6b..2dd82b8 100644 --- a/weechat/buffers.conf +++ b/weechat/buffers.conf @@ -1,6 +1,13 @@ # # weechat -- buffers.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [color] current_bg = 31 diff --git a/weechat/charset.conf b/weechat/charset.conf index 99a90d5..00d304c 100644 --- a/weechat/charset.conf +++ b/weechat/charset.conf @@ -1,6 +1,13 @@ # # weechat -- charset.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [default] decode = "iso-8859-1" diff --git a/weechat/exec.conf b/weechat/exec.conf index 39f1929..519ccc1 100644 --- a/weechat/exec.conf +++ b/weechat/exec.conf @@ -1,6 +1,13 @@ # # weechat -- exec.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [command] default_options = "" diff --git a/weechat/iset.conf b/weechat/iset.conf index cafe04f..35e1653 100644 --- a/weechat/iset.conf +++ b/weechat/iset.conf @@ -1,6 +1,13 @@ # # weechat -- iset.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [color] bg_selected = red diff --git a/weechat/logger.conf b/weechat/logger.conf index 0b8b96b..9701311 100644 --- a/weechat/logger.conf +++ b/weechat/logger.conf @@ -1,6 +1,13 @@ # # weechat -- logger.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [look] backlog = 20 diff --git a/weechat/plugins.conf b/weechat/plugins.conf index d640621..f9334ae 100644 --- a/weechat/plugins.conf +++ b/weechat/plugins.conf @@ -1,6 +1,13 @@ # # weechat -- plugins.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [var] fifo.fifo = "on" diff --git a/weechat/relay.conf b/weechat/relay.conf index aa38a43..565dd14 100644 --- a/weechat/relay.conf +++ b/weechat/relay.conf @@ -1,6 +1,13 @@ # # weechat -- relay.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [look] auto_open_buffer = on diff --git a/weechat/script.conf b/weechat/script.conf index ac91c51..ee53242 100644 --- a/weechat/script.conf +++ b/weechat/script.conf @@ -1,6 +1,13 @@ # # weechat -- script.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [look] columns = "%s %n %V %v %u | %d | %t" diff --git a/weechat/sec.conf b/weechat/sec.conf index 230b2ce..7cda227 100644 --- a/weechat/sec.conf +++ b/weechat/sec.conf @@ -1,6 +1,13 @@ # # weechat -- sec.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [crypt] cipher = aes256 diff --git a/weechat/trigger.conf b/weechat/trigger.conf index 69bbe65..10d49e4 100644 --- a/weechat/trigger.conf +++ b/weechat/trigger.conf @@ -1,6 +1,13 @@ # # weechat -- trigger.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [look] enabled = on diff --git a/weechat/weechat.conf b/weechat/weechat.conf index 337afc3..60fe678 100644 --- a/weechat/weechat.conf +++ b/weechat/weechat.conf @@ -1,6 +1,13 @@ # # weechat -- weechat.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [debug] @@ -13,6 +20,7 @@ sys_rlimit = "" [look] align_end_of_lines = message +align_multiline_words = on bar_more_down = "▼" bar_more_left = "◀" bar_more_right = "▶" diff --git a/weechat/xfer.conf b/weechat/xfer.conf index 39ac5bd..c7ef602 100644 --- a/weechat/xfer.conf +++ b/weechat/xfer.conf @@ -1,6 +1,13 @@ # # weechat -- xfer.conf # +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use /set or similar command to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart +# [look] auto_open_buffer = on -- 2.49.0 From 598676e060bc749669da3caa6136da8197d7a9c4 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 28 Feb 2017 14:34:07 +0000 Subject: [PATCH 10/16] weechat: don't connect to kdab slack anymore --- weechat/plugins.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weechat/plugins.conf b/weechat/plugins.conf index f9334ae..13e4159 100644 --- a/weechat/plugins.conf +++ b/weechat/plugins.conf @@ -78,7 +78,7 @@ python.slack_extension.distracting_channels = "" python.slack_extension.server_alias.uh-sensationeditor = "se" python.slack_extension.server_alias.ultrahaptics = "uh" python.slack_extension.show_reaction_nicks = "0" -python.slack_extension.slack_api_token = "${sec.data.slack_uh},${sec.data.slack_se}" +python.slack_extension.slack_api_token = "${sec.data.slack_uh}" python.slack_extension.switch_buffer_on_join = "1" python.slack_extension.trigger_value = "0" python.slack_extension.unfurl_ignore_alt_text = "0" -- 2.49.0 From f5d80dd7a716b4d9e3f4ce9382d9c79f9d72f5b9 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 28 Feb 2017 14:35:19 +0000 Subject: [PATCH 11/16] weechat: add colorizer plugin Will colorize and highlight success/fail builds --- weechat/plugins.conf | 9 ++ weechat/ruby/colorizer.rb | 198 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 207 insertions(+) create mode 100644 weechat/ruby/colorizer.rb diff --git a/weechat/plugins.conf b/weechat/plugins.conf index 13e4159..5a88225 100644 --- a/weechat/plugins.conf +++ b/weechat/plugins.conf @@ -83,6 +83,15 @@ python.slack_extension.switch_buffer_on_join = "1" python.slack_extension.trigger_value = "0" python.slack_extension.unfurl_ignore_alt_text = "0" ruby.check_license = "off" +ruby.colorizer.buffer_regex = "" +ruby.colorizer.rule.0 = "" +ruby.colorizer.rule.1 = "" +ruby.colorizer.rule.2 = "" +ruby.colorizer.rule.3 = "" +ruby.colorizer.rule.4 = "" +ruby.colorizer.rule.8 = "Succeeded/lightgreen" +ruby.colorizer.rule.9 = "Failed/lightred" +ruby.colorizer.rule.count = "10" tcl.check_license = "off" [desc] diff --git a/weechat/ruby/colorizer.rb b/weechat/ruby/colorizer.rb new file mode 100644 index 0000000..21c15bb --- /dev/null +++ b/weechat/ruby/colorizer.rb @@ -0,0 +1,198 @@ +# vim: set noet nosta sw=4 ts=4 : +# +# Colorizer +# Michael B. Hix +# http://code.hix.io/projects/colorizer +# +# Color certain parts of text in certain buffers based on rules. +# + +# +# Options: +# +# plugins.var.ruby.colorizer.buffer_regex +# Buffers with names matching this regex are colorized. All buffers are +# colorized if this option is empty. +# +# plugins.var.ruby.colorizer.rule.count +# This is the maximum number of rules to load. +# +# plugins.var.ruby.colorizer.rule.X +# X is zero or a positive integer. Rules are strings consisting of a regular +# expression followed immediately by a slash and a Weechat color name. The +# regular expressions are case-insensitive. +# +# Text matching the regular expression is colored with the given color. The +# last match "wins" and overlapping matches are not detected. +# +# For example: "strelka|mongrel2/lightgreen" +# + +# +# Changelog: +# +# 0.1: Initial release. +# + +SCRIPT_NAME = 'colorizer' +SCRIPT_AUTHOR = 'Michael B. Hix' +SCRIPT_DESC = 'Colorize text in buffers based on rules.' +SCRIPT_VERSION = '0.1' +SCRIPT_LICENSE = 'BSD' + +# A default coloring rule. +# +DEFAULT_RULE = { + :value => '', + :description => 'A colorizing rule of the form: / Empty rules are ignored.', +}.freeze + +# Configuration defaults are supplied and set for the user if they're not already set. +# +DEFAULTS = { + 'rule.0' => DEFAULT_RULE, + 'rule.1' => DEFAULT_RULE, + 'rule.2' => DEFAULT_RULE, + 'rule.3' => DEFAULT_RULE, + 'rule.4' => DEFAULT_RULE, + 'rule.count' => { + :value => 10, + :description => 'The maximum number of rules to look for in your config.', + }, + 'buffer_regex' => { + :value => '', + :description => 'Only colorize text in buffers with names that match this regex. Leaving this empty matches all buffer names.', + }, +}.freeze + +######################################################################## +### I N I T +######################################################################## + +def weechat_init + Weechat.register SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, '', '' + + Weechat.hook_modifier( 'weechat_print', 'colorize_cb', '' ) + + DEFAULTS.each_pair do |option, opts| + value = opts[:value] + description = opts[:description] + + cur_value = Weechat.config_get_plugin( option ) + + if cur_value.nil? || cur_value.empty? + Weechat.config_set_plugin( option, value.to_s ) + end + + Weechat.config_set_desc_plugin( option, description ) + end + + parse_config + + Weechat.hook_config( "plugins.var.ruby.#{SCRIPT_NAME}.*", 'config_cb', '' ) + + return Weechat::WEECHAT_RC_OK +end + +################################################################################ +### U T I L I T I E S +################################################################################ + +# Provide a way to print legible stack traces. +# +def pp_error( e, message = '' ) + return unless e.is_a? Exception + unless message.nil? or message.empty? + Weechat.print( '', '%s%s' % [Weechat.prefix('error'), message] ) + end + Weechat.print( '', '%s%s: %s' % [Weechat.prefix( 'error' ), SCRIPT_NAME, e.to_s] ) + e.backtrace.each do |line| + Weechat.print( '', '%s%s' % [Weechat.prefix( 'error' ), line] ) + end +end + +# Re-build rules and any regular expressions when the config changes. +# +def parse_config + rules = {} + count = Weechat::config_get_plugin( 'rule.count' ).to_i || + DEFAULTS['rule.count'] + + count.times do |i| + key = "rule.#{i}" + next unless Weechat::config_is_set_plugin( key ) + + conf = Weechat::config_get_plugin( key ) + regex,color,_ = conf.split( /(? e + pp_error( e, 'There was a problem with rule %d:' % [i] ) + end + end + + @rules = rules + + begin + @buffer_regex = /#{Weechat::config_get_plugin( 'buffer_regex' )}/i + rescue Exception => e + pp_error( e, 'There was a problem with buffer_regex:' ) + end +end + +################################################################################ +### C A L L B A C K S +################################################################################ + +# Handle configuration changes. +# +def config_cb( data, option, value ) + parse_config + return Weechat::WEECHAT_RC_OK +end + +# Handle message printing. +# +def colorize_cb( data, modifier, modifier_data, message ) + _,buffer,_ = modifier_data.split( ';' ) + return message unless @buffer_regex =~ buffer + + reset = Weechat.color( 'reset' ) + @rules.each do |reg, color_str| + color = Weechat.color( color_str ) + message.gsub!( reg, '%s\1%s' % [color,reset] ) + end + + return message +end + +__END__ +__LICENSE__ + +Copyright (c) 2014 Michael B. Hix +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. -- 2.49.0 From 01019dc20b7a06008c88bdbc05ad24cdb8ea7699 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 28 Feb 2017 15:18:56 +0000 Subject: [PATCH 12/16] vim: also pull on BufNewFile I hope this fixes the conflicts I've been having on the first diary entry every day. --- vim/vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 90fbf5d..6648b7d 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -746,9 +746,9 @@ omap T Sneak_T let g:vimwiki_list = [{'path': '$XDG_DATA_HOME/vimwiki'}] let g:vimwiki_auto_chdir = 1 augroup myvimwiki - au! BufRead $XDG_DATA_HOME/vimwiki/index.wiki !git pull - au! BufRead $XDG_DATA_HOME/vimwiki/diary/*.wiki !git pull - au! BufWritePost $XDG_DATA_HOME/vimwiki/*.wiki exe '!git add "";git commit -m"' . strftime("%FT%R") . '";git push' + au! BufRead $XDG_DATA_HOME/vimwiki/index.wiki !git pull + au! BufRead,BufNewFile $XDG_DATA_HOME/vimwiki/diary/*.wiki !git pull + au! BufWritePost $XDG_DATA_HOME/vimwiki/*.wiki exe '!git add "";git commit -m"' . strftime("%FT%R") . '";git push' augroup END " functions {{{1 -- 2.49.0 From c2daf2ca8229419fcdb7a5c8218320154713519e Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 28 Feb 2017 21:34:09 +0000 Subject: [PATCH 13/16] flexget:replace secrets with variables --- flexget/config.yml | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/flexget/config.yml b/flexget/config.yml index e55be9f..0646f43 100644 --- a/flexget/config.yml +++ b/flexget/config.yml @@ -1,4 +1,4 @@ -secrets: private.yml +variables: private.yml templates: # {{{1 @@ -27,22 +27,22 @@ templates: # {{{1 usenet: # {{{2 sabnzbd: - key: '{{secrets.sabnzbd.key}}' - url: '{{secrets.sabnzbd.url}}' + key: '{?sabnzbd.key?}' + url: '{?sabnzbd.url?}' usenet-movies: # {{{2 inputs: - - rss: { url: 'https://www.usenet-crawler.com/rss?t=2040&dl=1&num=100{{secrets.crawler.api}}', silent: yes } # Movies HD - - rss: { url: 'https://newztown.co.za/rss?t=2040&dl=1&num=100{{secrets.newztown.api}}', silent: yes } # Movies HD - - rss: { url: 'https://api.drunkenslug.com/rss?t=2040&dl=1&num=100{{secrets.drunkenslug.api}}', silent: yes } # Movies HD + - rss: { url: 'https://www.usenet-crawler.com/rss?t=2040&dl=1&num=100{?crawler.api?}', silent: yes } # Movies HD + - rss: { url: 'https://newztown.co.za/rss?t=2040&dl=1&num=100{?newztown.api?}', silent: yes } # Movies HD + - rss: { url: 'https://api.drunkenslug.com/rss?t=2040&dl=1&num=100{?drunkenslug.api?}', silent: yes } # Movies HD usenet-tv: # {{{2 inputs: - - rss: { url: 'https://www.usenet-crawler.com/rss?t=5030,5040&dl=1&num=100{{secrets.crawler.api}}', silent: yes } # TV SD/HD - - rss: { url: 'https://newztown.co.za/rss?t=5030,5040&dl=1&num=100{{secrets.newztown.api}}', silent: yes } # TV SD/HD - - rss: { url: 'https://api.drunkenslug.com/rss?t=2040&dl=1&num=100{{secrets.drunkenslug.api}}', silent: yes } # Movies HD + - rss: { url: 'https://www.usenet-crawler.com/rss?t=5030,5040&dl=1&num=100{?crawler.api?}', silent: yes } # TV SD/HD + - rss: { url: 'https://newztown.co.za/rss?t=5030,5040&dl=1&num=100{?newztown.api?}', silent: yes } # TV SD/HD + - rss: { url: 'https://api.drunkenslug.com/rss?t=2040&dl=1&num=100{?drunkenslug.api?}', silent: yes } # Movies HD filters: # {{{2 @@ -144,8 +144,8 @@ templates: # {{{1 configure_series: from: trakt_list: - username: '{{secrets.trakt.username}}' - account: '{{secrets.trakt.account}}' + username: '{?trakt.username?}' + account: '{?trakt.account?}' list: followlist type: shows settings: *default_settings @@ -155,8 +155,8 @@ templates: # {{{1 configure_series: from: trakt_list: - username: '{{secrets.trakt.username}}' - account: '{{secrets.trakt.account}}' + username: '{?trakt.username?}' + account: '{?trakt.account?}' list: backfill type: shows settings: # *default_settings @@ -166,15 +166,15 @@ templates: # {{{1 interval: 1 hours what: - trakt_list: - username: '{{secrets.trakt.username}}' - account: '{{secrets.trakt.account}}' + username: '{?trakt.username?}' + account: '{?trakt.account?}' list: backfill type: episodes - next_series_episodes: from_start: yes from: - newznab: - url: 'https://www.usenet-crawler.com/api?apikey={{secrets.crawler.apikey}}&t=tvsearch&cat=5030,5040&extended=1' + url: 'https://www.usenet-crawler.com/api?apikey={?crawler.apikey?}&t=tvsearch&cat=5030,5040&extended=1' category: tv all_series: yes @@ -222,7 +222,7 @@ templates: # {{{1 # - emit_movie_queue: yes # from: # - newznab: - # url: 'https://www.usenet-crawler.com/api?apikey={{secrets.crawler.apikey}}&t=movie&extended=1&cat=2040' + # url: 'https://www.usenet-crawler.com/api?apikey={?crawler.apikey?}&t=movie&extended=1&cat=2040' # category: movie # interval: 7 days # search each entry only once a week @@ -230,8 +230,8 @@ templates: # {{{1 trakt-add-collection: # {{{2 list_add: - trakt_list: - username: '{{secrets.trakt.username}}' - account: '{{secrets.trakt.account}}' + username: '{?trakt.username?}' + account: '{?trakt.account?}' list: collection @@ -261,8 +261,8 @@ tasks: # {{{1 # dl-movies-trakt: # {{{2 # priority: 10 # trakt_list: - # username: '{{secrets.trakt.username}}' - # account: '{{secrets.trakt.account}}' + # username: '{?trakt.username?}' + # account: '{?trakt.account?}' # list: watchlist # type: movies # accept_all: yes @@ -277,8 +277,8 @@ tasks: # {{{1 # crossmatch: # from: # - trakt_list: - # username: '{{secrets.trakt.username}}' - # account: '{{secrets.trakt.account}}' + # username: '{?trakt.username?}' + # account: '{?trakt.account?}' # list: watchlist # type: movies # fields: [imdb_id] -- 2.49.0 From 72b66a86cfeaf18b31c5454b685ee2d341f816b6 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 28 Feb 2017 22:30:57 +0000 Subject: [PATCH 14/16] flexget: replace email with notify --- flexget/config.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/flexget/config.yml b/flexget/config.yml index 0646f43..88e898d 100644 --- a/flexget/config.yml +++ b/flexget/config.yml @@ -3,9 +3,12 @@ variables: private.yml templates: # {{{1 email: # {{{2 - email: - from: flexget@tardis - to: ramsi@localhost + notify: + task: + via: + - email: + from: flexget@tardis + to: ramsi@localhost torrents: # {{{2 @@ -458,10 +461,13 @@ tasks: # {{{1 list: move-tasks seen: local accept_all: yes - email: - from: flexget@tardis - to: ramsi@localhost - file_template: move + notify: + task: + template: move + via: + - email: + from: flexget@tardis + to: ramsi@localhost backfill-mail: # {{{2 -- 2.49.0 From 178f31b1b58c73379ac90eee82012ca4417ebc96 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Wed, 1 Mar 2017 00:30:05 +0000 Subject: [PATCH 15/16] vim: run git command in directory of diary/wiki file This should fix the issue I was having with conflicts all the time --- vim/vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 6648b7d..f1dc3f8 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -746,8 +746,8 @@ omap T Sneak_T let g:vimwiki_list = [{'path': '$XDG_DATA_HOME/vimwiki'}] let g:vimwiki_auto_chdir = 1 augroup myvimwiki - au! BufRead $XDG_DATA_HOME/vimwiki/index.wiki !git pull - au! BufRead,BufNewFile $XDG_DATA_HOME/vimwiki/diary/*.wiki !git pull + au! BufRead $XDG_DATA_HOME/vimwiki/index.wiki !git -C "%:p:h" pull + au! BufRead,BufNewFile $XDG_DATA_HOME/vimwiki/diary/*.wiki !git -C "%:p:h" pull au! BufWritePost $XDG_DATA_HOME/vimwiki/*.wiki exe '!git add "";git commit -m"' . strftime("%FT%R") . '";git push' augroup END -- 2.49.0 From cbf2112e929cf3fd1808dac4b8e352870c8238ca Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Wed, 1 Mar 2017 10:22:51 +0000 Subject: [PATCH 16/16] vim: add format options for vimwiki files --- vim/ftplugin/vimwiki.vim | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 vim/ftplugin/vimwiki.vim diff --git a/vim/ftplugin/vimwiki.vim b/vim/ftplugin/vimwiki.vim new file mode 100644 index 0000000..0b80e85 --- /dev/null +++ b/vim/ftplugin/vimwiki.vim @@ -0,0 +1,2 @@ +setlocal textwidth=80 +setlocal formatoptions+=awt " auto-format -- 2.49.0