New stuff™ Signed-off-by: Anirudh Oppiliappan <x@icyphox.sh>
Anirudh Oppiliappan x@icyphox.sh
Mon, 04 Nov 2019 12:49:41 +0530
5 files changed,
145 insertions(+),
22 deletions(-)
M
.Xresources
→
.Xresources
@@ -58,7 +58,7 @@ URxvt.internalBorder: 30
URxvt.perl-ext: default,matcher URxvt.letterSpace: -1 URxvt.matcher.button: 1 -URxvt.boldFont: +URxvt.boldFont: xft:Roboto Mono:size=14:style=Bold:antialias=true URxvt.url-launcher: /usr/bin/firefox URxvt.visualBell: false URxvt.depth: 20@@ -98,3 +98,12 @@ Xft.rgba: rgb
Xft.autohint: false Xft.hintstyle: hintslight Xft.lcdfilter: lcddefault + +! xst settings + +st.font: Roboto Mono:size=14:style=Medium:antialias=true +st.borderpx: 30 +st.cursorshape: 2 +st.mouseScrollLines: 2 +st.chscale: 1.0 +st.cwscale: 1.0
A
bin/elnotify.py
@@ -0,0 +1,113 @@
+from __future__ import unicode_literals + +import weechat as weechat +import subprocess +from os import environ, path + +crimnotify_name = "crimnotify" +crimnotify_version = "0.1" +crimnotify_license = "GPL3" + +# convenient table checking for bools +true = { "on": True, "off": False } + +# declare this here, will be global config() object +# but is initialized in __main__ +cfg = None + +class config(object): + def __init__(self): + # default options for lnotify + self.opts = { + "highlight": "on", + "query": "on", + "notify_away": "off", + "icon": "weechat", + } + + self.init_config() + self.check_config() + + def init_config(self): + for opt, value in self.opts.items(): + temp = weechat.config_get_plugin(opt) + if not len(temp): + weechat.config_set_plugin(opt, value) + + def check_config(self): + for opt in self.opts: + self.opts[opt] = weechat.config_get_plugin(opt) + + def __getitem__(self, key): + return self.opts[key] + +def printc(msg): + weechat.prnt("", msg) + +def handle_msg(data, pbuffer, date, tags, displayed, highlight, prefix, message): + highlight = bool(highlight) and cfg["highlight"] + query = true[cfg["query"]] + notify_away = true[cfg["notify_away"]] + buffer_type = weechat.buffer_get_string(pbuffer, "localvar_type") + away = weechat.buffer_get_string(pbuffer, "localvar_away") + x_focus = False + window_name = "" + my_nickname = "nick_" + weechat.buffer_get_string(pbuffer, "localvar_nick") + + # Check if active window is in the ignore_windows_list and skip notification + if (environ.get('DISPLAY') != None) and path.isfile("/bin/xdotool"): + cmd_pid="xdotool getactivewindow getwindowpid".split() + window_pid = subprocess.check_output(cmd_pid).decode("utf-8") + cmd_name=("ps -ho comm -p %s"%(window_pid)).split() + window_name = subprocess.check_output(cmd_name).decode("utf-8") + ignore_windows_list = [""] + if window_name in ignore_windows_list: + x_focus = True + return weechat.WEECHAT_RC_OK + + if pbuffer == weechat.current_buffer() and x_focus: + return weechat.WEECHAT_RC_OK + + if away and not notify_away: + return weechat.WEECHAT_RC_OK + + if my_nickname in tags: + return weechat.WEECHAT_RC_OK + + buffer_name = weechat.buffer_get_string(pbuffer, "short_name") + + + if buffer_type == "private" and query: + notify_user(buffer_name, message) + elif buffer_name == "#crimson": + notify_user("{}".format(prefix), message) + elif buffer_type == "channel" and highlight: + notify_user("{} @ {}".format(prefix, buffer_name), message) + + return weechat.WEECHAT_RC_OK + +def process_cb(data, command, return_code, out, err): + if return_code == weechat.WEECHAT_HOOK_PROCESS_ERROR: + weechat.prnt("", "Error with command '%s'" % command) + elif return_code != 0: + weechat.prnt("", "return_code = %d" % return_code) + weechat.prnt("", "notify-send has an error") + return weechat.WEECHAT_RC_OK + +def notify_user(origin, message): + hook = weechat.hook_process_hashtable("notify-send", + { "arg1": "-i", "arg2": cfg["icon"], + "arg3": "-a", "arg4": "WeeChat", + "arg5": origin, "arg6": message }, + 20000, "process_cb", "") + + return weechat.WEECHAT_RC_OK + +# execute initializations in order +if __name__ == "__main__": + weechat.register(crimnotify_name, "kevr", crimnotify_version, crimnotify_license, + "{} - A libnotify script for weechat".format(crimnotify_name), "", "") + + cfg = config() + print_hook = weechat.hook_print("", "", "", 1, "handle_msg", "") +
M
config/zathura/zathurarc
→
config/zathura/zathurarc
@@ -2,22 +2,22 @@ set incremental-search true
set recolor "true" -set default-bg "#ffffff" -set default-fg "#4d4d4c" +set default-bg "#1c2023" +set default-fg "#c7ccd1" -set completion-bg "#ffffff" -set completion-fg "#4d4d4c" -set completion-highlight-bg "#4271ae" -set completion-highlight-fg "#4d4d4c" +set completion-bg "#1c2023" +set completion-fg "#c7ccd1" +set completion-highlight-bg "#ae95c7" +set completion-highlight-fg "#c7ccd1" -set statusbar-bg "#4271ae" -set statusbar-fg "#ffffff" +set statusbar-bg "#ae95c7" +set statusbar-fg "#1c2023" -set inputbar-bg "#ffffff" -set inputbar-fg "#4d4d4c" +set inputbar-bg "#1c2023" +set inputbar-fg "#c7ccd1" -set recolor-darkcolor "#4d4d4c" -set recolor-lightcolor "#ffffff" +set recolor-darkcolor "#c7ccd1" +set recolor-lightcolor "#1c2023" set window-height "800" set window-width "600"
M
weechat/weechat.conf
→
weechat/weechat.conf
@@ -341,7 +341,7 @@ nicklist.color_fg = 8
nicklist.conditions = "nicklist" nicklist.filling_left_right = vertical nicklist.filling_top_bottom = columns_vertical -nicklist.hidden = on +nicklist.hidden = off nicklist.items = "buffer_nicklist" nicklist.position = right nicklist.priority = 200@@ -369,7 +369,7 @@ title.color_fg = default
title.conditions = "" title.filling_left_right = vertical title.filling_top_bottom = horizontal -title.hidden = on +title.hidden = off title.items = "buffer_title" title.position = top title.priority = 500@@ -381,12 +381,13 @@
[layout] default.buffer = "core;weechat;1" default.buffer = "irc;server.rizon;1" -default.buffer = "fset;fset;2" -default.buffer = "irc;rizon.#avpd;3" -default.buffer = "irc;rizon.#code;4" -default.buffer = "irc;rizon.#homescreen;5" -default.buffer = "irc;rizon.#linux;6" -default.buffer = "irc;rizon.#rice;7" +default.buffer = "irc;rizon.#avpd;2" +default.buffer = "irc;rizon.#code;3" +default.buffer = "irc;rizon.#crimbot;4" +default.buffer = "irc;rizon.#crimson;5" +default.buffer = "irc;rizon.#homescreen;6" +default.buffer = "irc;rizon.#linux;7" +default.buffer = "irc;rizon.#rice;8" default.window = "1;0;0;0;irc;rizon.Carp" default.current = on