[submodule "awesome/widgets/net_widgets"]
path = awesome/widgets/net_widgets
url = git@github.com:Ram-Z/net_widgets.git
-[submodule "awesome/widgets/pomodoro"]
- path = awesome/widgets/pomodoro
- url = git@github.com:/Ram-Z/awesome-pomodoro
- branch = module-path
[submodule "zsh/lib/zsh-syntax-highlighting"]
path = zsh/lib/zsh-syntax-highlighting
url = https://github.com/zsh-users/zsh-syntax-highlighting
-[submodule "urxvt/urxvt-perls"]
- path = urxvt/urxvt-perls
+[submodule "urxvt/perls"]
+ path = urxvt/perls
url = https://github.com/muennich/urxvt-perls
+[submodule "urxvt/autocomplete-ALL-the-things"]
+ path = urxvt/autocomplete-ALL-the-things
+ url = https://github.com/Vifon/autocomplete-ALL-the-things
+[submodule "weechat/python/wee-slack"]
+ path = weechat/python/wee-slack
+ url = https://github.com/rawdigits/wee-slack
+[submodule "weechat/lua/matrix"]
+ path = weechat/lua/matrix
+ url = https://github.com/torhve/weechat-matrix-protocol-script
+[submodule "awesome/widgets/pomodoro"]
+ path = awesome/widgets/pomodoro
+ url = git@github.com:ram-z/awesome-pomodoro
APATH := $(realpath .)
FILES := bin
-DOTFILES := conky* goobookrc msmtp* mutt ncmpcpp profile tmux.conf weechat Xresources xprofile zprofile zshenv zshrc
-CONFIGFILES := aliases compton.conf git gnupg mimeo.conf mpd mpv offlineimap ranger retroarch systemd vim xbindkeys xkb zsh
+DOTFILES := conky* goobookrc msmtp* mutt profile tmux.conf weechat Xresources
+CONFIGFILES := aliases compton.conf git mpv offlineimap ranger retroarch xbindkeys xkb
.PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES)
install: $(FILES) $(DOTFILES) $(CONFIGFILES)
+~/.config:
+ mkdir -p ~/.config
+
+vim:
+ ln -sfT $(APATH)/vim ~/.config/vim
+ mkdir -p ~/.local/share/vim
+ git clone https://github.com/gmarik/vundle ~/.local/share/vim/vundle
+.PHONY: vim
+
+awesome: ~/.config
+ ln -sfT $(APATH)/awesome ~/.config/awesome
+.PHONY: awesome
+
+qutebrowser: ~/.config
+ ln -sfT $(APATH)/qutebrowser ~/.config/qutebrowser
+ mkdir -p ~/downloads
+.PHONY: qutebrowser
+
+mpd: systemd
+ ln -sfT $(APATH)/mpd ~/.config/mpd
+ mkdir -p ~/.local/share/mpd/playlists
+ systemctl --user enable mpd
+ systemctl --user start mpd
+.PHONY: mpd
+
+ncmpcpp:
+ ln -sfT $(APATH)/ncmpcpp ~/.config/ncmpcpp
+ mkdir -p ~/.local/share/mpd/lyrics
+.PHONY: ncmpcpp
+
+systemd:
+ ln -sfT $(APATH)/$@ ~/.config/$@
+.PHONY: systemd
+
+gnupg: systemd
+ ln -sfT $(APATH)/$@ ~/.config/$@
+ systemctl --user enable gpg-agent.socket gpg-agent-extra.socket gpg-agent-browser.socket dirmngr.socket
+ systemctl --user start gpg-agent.socket gpg-agent-extra.socket gpg-agent-browser.socket dirmngr.socket
+.PHONY: gnupg
+
+zsh:
+ ln -sfT $(APATH)/zshrc ~/.zshrc
+ ln -sfT $(APATH)/zprofile ~/.zprofile
+ ln -sfT $(APATH)/zshenv ~/.zshenv
+ ln -sfT $(APATH)/zsh ~/.config/zsh
+ mkdir -p ~/.cache/zsh
+.PHONY: zsh
+
+xprofile:
+ ln -sfT $(APATH)/xprofile ~/.xprofile
+.PHONY: xprofile
+
+dircolors:
+ ln -sfT $(APATH)/dircolors ~/.config/dircolors
+.PHONY: dircolors
+
+urxvt:
+ ln -sfT $(APATH)/urxvt ~/.config/urxvt
+.PHONY: urxvt
+
$(FILES):
@if [[ -e ~/$@ && ! -L ~/$@ ]]; then \
if [[ -d $@ ]]; then \
fi;
ln -sfT $(APATH)/$@ ~/.$@
-$(CONFIGFILES):
+$(CONFIGFILES): ~/.config
@if [[ -e ~/.config/$@ && ! -L ~/.config/$@ ]]; then \
if [[ -d .config/$@ ]]; then \
cp -r ~/.config/$@/* $@; \
URxvt.iso14755_52: false
! {{{1 Perl extensions
-URxvt.perl-lib: .config/urxvt/urxvt-perls
URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select,autocomplete-ALL-the-things
! {{{2 url-select
URxvt.keysym.C-F: perl:url-select:select_next
URxvt.url-select.button: 1
-URxvt.url-select.launcher: mimeo
+URxvt.url-select.launcher: rifle
URxvt.url-select.underline: true
! {{{2 keyboard-select
URxvt.keysym.C-S-space: perl:keyboard-select:activate
alias vs='vim SPLITBUILD'
# colours, I want more colours
-alias diff='colordiff'
+[[ -x /usr/bin/colordiff ]] && alias diff='colordiff'
# colours and case insensitive search
export LESS='-RSi'
# yes I'm that lazy
-alias o='mimeo'
+alias o='rifle'
# suspend screensaver when vlc is running
alias vlc-suspend='xdg-screensaver suspend $(xprop -name vlc | grep "WM_CLIENT_LEADER(WINDOW)" | sed "s/.*\(0x\d*\)/\1/")'
+++ /dev/null
-local utils = require("utils")
-
-utils.run_once("qutebrowser")
-utils.run_once("urxvtc -name ncmpcpp -icon ~/src/dotfiles/icons/bmp.png -e ncmpcpp", nil, "ncmpcpp")
-utils.run_once("urxvtc -name mopidy -icon ~/src/dotfiles/icons/bmp.png -e ncmpcpp -p 6601", nil, "ncmpcpp -p 6601")
-utils.run_once("urxvtc -name weechat -icon ~/src/dotfiles/icons/im-irc.png -e weechat", nil, "weechat")
-utils.run_once("urxvtc -name mutt -icon ~/src/dotfiles/icons/internet-mail.png -e mutt", nil, "mutt")
-Subproject commit e514e742864495f23fd725f8c596f41a01d67795
+Subproject commit 251dda50c2957e455f9242186db4089f09cdee18
+local hotkeys_popup = require("awful.hotkeys_popup").widget
+
-- Default modkey.
modkey = "Mod4"
altkey = "Mod1"
awful.button({ }, 3, function () mymainmenu:toggle() end)
))
-clientbuttons = awful.util.table.join(
- awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
- awful.button({ modkey }, 1, awful.mouse.client.move),
- awful.button({ modkey }, 3, awful.mouse.client.resize))
-
-- Global Keys {{{1
globalkeys = awful.util.table.join(globalkeys,
- -- Awesome Keys {{{2
- awful.key({ modkey, }, "j",
- function ()
- awful.client.focus.byidx(-1)
- if client.focus then client.focus:raise() end
- end),
+ awful.key({ modkey, }, "s", hotkeys_popup.show_help,
+ {description="show help", group="awesome"}),
+ awful.key({ modkey, }, "Left", awful.tag.viewprev,
+ {description = "view previous", group = "tag"}),
+ awful.key({ modkey, }, "Down", awful.tag.viewprev,
+ {description = "view previous", group = "tag"}),
+ awful.key({ modkey, }, "Right", awful.tag.viewnext,
+ {description = "view next", group = "tag"}),
+ awful.key({ modkey, }, "Up", awful.tag.viewnext,
+ {description = "view next", group = "tag"}),
+ awful.key({ modkey, }, "Escape", awful.tag.history.restore,
+ {description = "go back", group = "tag"}),
+
awful.key({ modkey, }, "k",
function ()
awful.client.focus.byidx( 1)
- if client.focus then client.focus:raise() end
- end),
+ end,
+ {description = "focus next by index", group = "client"}
+ ),
+ awful.key({ modkey, }, "j",
+ function ()
+ awful.client.focus.byidx(-1)
+ end,
+ {description = "focus previous by index", group = "client"}
+ ),
+ awful.key({ modkey, }, "w", function () mymainmenu:show({ coords = { x = 0, y = 0}}) end,
+ {description = "show main menu", group = "awesome"}),
-- Layout manipulation
- awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
- awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
- awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
+ awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
+ {description = "swap with next client by index", group = "client"}),
+ awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
+ {description = "swap with previous client by index", group = "client"}),
+ awful.key({ modkey, }, "#49", function () awful.screen.focus_relative( 1) end, -- that's the key left of 1 (chronos)
+ {description = "focus the next screen", group = "screen"}),
+ awful.key({ modkey, }, "=", function () awful.screen.focus_relative( 1) end, -- that's the key left of 1 (kinesis)
+ {description = "focus the next screen", group = "screen"}),
+ awful.key({ modkey, "Control" }, "Right", function () awful.screen.focus_relative(-1) end,
+ {description = "focus the next screen", group = "screen"}),
+ awful.key({ modkey, "Control" }, "Left", function () awful.screen.focus_relative(-1) end,
+ {description = "focus the previous screen", group = "screen"}),
+ awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
+ {description = "jump to urgent client", group = "client"}),
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
- end),
+ end,
+ {description = "go back", group = "client"}),
-- Standard program
- awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
- awful.key({ modkey, "Control" }, "r", awesome.restart),
+ awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
+ {description = "open a terminal", group = "launcher"}),
+ awful.key({ modkey, "Control" }, "r", awesome.restart,
+ {description = "reload awesome", group = "awesome"}),
- awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
- awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
- awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
- awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
- awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
- awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
+ awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
+ {description = "increase master width factor", group = "layout"}),
+ awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
+ {description = "decrease master width factor", group = "layout"}),
+ awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
+ {description = "increase the number of master clients", group = "layout"}),
+ awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
+ {description = "decrease the number of master clients", group = "layout"}),
+ awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
+ {description = "increase the number of columns", group = "layout"}),
+ awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
+ {description = "decrease the number of columns", group = "layout"}),
+ -- resize slave
+ awful.key({ modkey, "Control" }, "j", function () awful.client.incwfact( 0.05) end,
+ {description = "increase focused client window factor", group = "layout"}),
+ awful.key({ modkey, "Control" }, "k", function () awful.client.incwfact(-0.05) end,
+ {description = "decrease focused client window factor", group = "layout"}),
- awful.key({ modkey, "Control" }, "n", awful.client.restore),
+ -- switch between layouts
+ awful.key({ modkey, }, "]", function () awful.layout.inc( 1) end,
+ {description = "select next", group = "layout"}),
+ awful.key({ modkey, }, "[", function () awful.layout.inc(-1) end,
+ {description = "select previous", group = "layout"}),
- awful.key({ modkey }, "x",
+ awful.key({ modkey, "Control" }, "n",
function ()
- awful.prompt.run({ prompt = "Run Lua code: " },
- mypromptbox[mouse.screen].widget,
- awful.util.eval, nil,
- awful.util.getdir("cache") .. "/history_eval")
- end),
- -- Menubar
- -- awful.key({ modkey }, "p", function() menubar.show() end),
-
- -- My Keys {{{2
- awful.key({ modkey, }, "Left", awful.tag.viewprev ),
- awful.key({ modkey, }, "Down", awful.tag.viewprev ),
- awful.key({ modkey, }, "Right", awful.tag.viewnext ),
- awful.key({ modkey, }, "Up", awful.tag.viewnext ),
-
- -- Menu
- awful.key({ modkey }, "w", function () mymainmenu:show({ coords = { x = 0, y = 0}}) end),
+ local c = awful.client.restore()
+ -- Focus restored client
+ if c then
+ client.focus = c
+ c:raise()
+ end
+ end,
+ {description = "restore minimized", group = "client"}),
+
-- Prompt
- awful.key({ modkey }, "space", function () mypromptbox[mouse.screen]:run() end),
- -- switch layout
- awful.key({ modkey }, "]", function () awful.layout.inc( 1, mouse.screen, layouts) end),
- awful.key({ modkey }, "[", function () awful.layout.inc(-1, mouse.screen, layouts) end),
- -- resize slave
- awful.key({ modkey, "Control" }, "j", function () awful.client.incwfact( 0.05) end),
- awful.key({ modkey, "Control" }, "k", function () awful.client.incwfact(-0.05) end),
+ awful.key({ modkey }, "space", function () awful.screen.focused().mypromptbox:run() end,
+ {description = "run prompt", group = "launcher"}),
+
+ awful.key({ modkey }, "x",
+ function ()
+ awful.prompt.run {
+ prompt = "Run Lua code: ",
+ textbox = awful.screen.focused().mypromptbox.widget,
+ exe_callback = awful.util.eval,
+ history_path = awful.util.get_cache_dir() .. "/history_eval"
+ }
+ end,
+ {description = "lua execute prompt", group = "awesome"}),
+
+ -- Applications {{{2
-- Ksnapshot
- awful.key({ }, "F13", function () awful.util.spawn("ksnapshot") end),
- awful.key({ }, "Print", function () awful.util.spawn("ksnapshot") end),
+ awful.key({ }, "F13", function () awful.spawn("ksnapshot") end),
+ awful.key({ }, "Print", function () awful.spawn("ksnapshot") end),
-- ranger
- awful.key({ modkey }, "r", function () awful.util.spawn(terminal .. " -e ranger") end),
- -- Layout manipulation
- awful.key({ modkey, }, "Escape", awful.tag.history.restore),
- awful.key({ modkey, }, "#49", function () awful.screen.focus_relative( 1) end), -- that's the key left of 1 (chronos)
- awful.key({ modkey, }, "#94", function () awful.screen.focus_relative( 1) end), -- that's the key left of 1 (shada)
- awful.key({ modkey, }, "=", function () awful.screen.focus_relative( 1) end), -- that's the key left of 1 (kinesis)
- awful.key({ modkey, "Control" }, "Left", function () awful.screen.focus_relative( 1) end),
- awful.key({ modkey, "Control" }, "Right", function () awful.screen.focus_relative(-1) end),
+ awful.key({ modkey }, "r", function () awful.spawn(terminal .. " -e ranger") end),
-- Volume
- awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("ponymix increase 5") end),
- awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("ponymix decrease 5") end),
- awful.key({ }, "XF86AudioMute", function () awful.util.spawn("ponymix toggle") end),
- awful.key({ modkey }, "F10", function () awful.util.spawn("ponymix toggle") end),
- awful.key({ modkey }, "F11", function () awful.util.spawn("ponymix decrease 5") end),
- awful.key({ modkey }, "F12", function () awful.util.spawn("ponymix increase 5") end)
+ awful.key({ }, "XF86AudioMute", function () awful.spawn("ponymix toggle") end,
+ {description = "toggle mute", group = "volume"}),
+ awful.key({ }, "XF86AudioLowerVolume", function () awful.spawn("ponymix decrease 5") end,
+ {description = "decrease volume", group = "volume"}),
+ awful.key({ }, "XF86AudioRaiseVolume", function () awful.spawn("ponymix increase 5") end,
+ {description = "increase volume", group = "volume"}),
+ awful.key({ modkey }, "F10", function () awful.spawn("ponymix toggle") end,
+ {description = "toggle mute", group = "volume"}),
+ awful.key({ modkey }, "F11", function () awful.spawn("ponymix decrease 5") end,
+ {description = "decrease volume", group = "volume"}),
+ awful.key({ modkey }, "F12", function () awful.spawn("ponymix increase 5") end,
+ {description = "increase volume", group = "volume"}),
+ -- Lock
+ awful.key({ modkey, "Control" }, "Escape", function () awful.spawn("xautolock -locknow") end),
+ -- VimWiki
+ awful.key({ modkey }, "i", function ()
+ awful.spawn(terminal.." -name vimwiki -e vim -c 'call vimwiki#base#goto_index(v:count1)'")
+ end)
)
-- Client keys {{{1
clientkeys = awful.util.table.join(
- -- Awesome Client Keys {{{2
- awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
- awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
- awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
- awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
+ awful.key({ modkey, }, "f",
+ function (c)
+ c.fullscreen = not c.fullscreen
+ c:raise()
+ end,
+ {description = "toggle fullscreen", group = "client"}),
+ awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
+ {description = "close", group = "client"}),
+ awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
+ {description = "toggle floating", group = "client"}),
+ awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
+ {description = "move to master", group = "client"}),
+ awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
+ {description = "toggle keep on top", group = "client"}),
+ awful.key({ modkey, }, "b", function (c) c.below = not c.below end,
+ {description = "toggle keep below", group = "client"}),
awful.key({ modkey, }, "n",
function (c)
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
- end),
+ end ,
+ {description = "minimize", group = "client"}),
awful.key({ modkey, }, "m",
function (c)
- c.maximized_horizontal = not c.maximized_horizontal
- c.maximized_vertical = not c.maximized_vertical
- end),
+ c.maximized = not c.maximized
+ c:raise()
+ end ,
+ {description = "maximize", group = "client"}),
- -- My Client Keys {{{2
-- Move client to screen
- awful.key({ modkey, "Shift" }, "#94", awful.client.movetoscreen ),
- awful.key({ modkey, "Shift" }, "#49", awful.client.movetoscreen ),
- awful.key({ modkey, "Shift" }, "=", awful.client.movetoscreen ), -- kinesis
- -- ontop and below
- awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
- awful.key({ modkey, }, "b", function (c) c.below = not c.below end)
- -- }}}
+ awful.key({ modkey, "Shift" }, "#94", function (c) c:move_to_screen() end,
+ {description = "move to screen", group = "client"}),
+ awful.key({ modkey, "Shift" }, "#49", function (c) c:move_to_screen() end,
+ {description = "move to screen", group = "client"}),
+ awful.key({ modkey, "Shift" }, "=", function (c) c:move_to_screen() end,
+ {description = "move to screen", group = "client"})
)
-- Tags {{{1
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do
globalkeys = awful.util.table.join(globalkeys,
+ -- View tag only.
awful.key({ modkey }, "#" .. i + 9,
function ()
- local screen = mouse.screen
- local tag = awful.tag.gettags(screen)[i]
- if tag then
- if tag == awful.tag.selected(screen) then
- awful.tag.history.restore(screen)
- else
- awful.tag.viewonly(tag)
- end
- end
- end),
+ local screen = awful.screen.focused()
+ local tag = screen.tags[i]
+ if tag then
+ if tag.selected then
+ awful.tag.history.restore(screen)
+ else
+ tag:view_only()
+ end
+ end
+ end,
+ {description = "view tag #"..i, group = "tag"}),
+ -- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9,
function ()
- local screen = mouse.screen
- local tag = awful.tag.gettags(screen)[i]
+ local screen = awful.screen.focused()
+ local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
- end),
+ end,
+ {description = "toggle tag #" .. i, group = "tag"}),
+ -- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function ()
- local tag = awful.tag.gettags(client.focus.screen)[i]
- if client.focus and tag then
- awful.client.movetotag(tag)
+ if client.focus then
+ local tag = client.focus.screen.tags[i]
+ if tag then
+ client.focus:move_to_tag(tag)
+ end
end
- end),
+ end,
+ {description = "move focused client to tag #"..i, group = "tag"}),
+ -- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function ()
- local tag = awful.tag.gettags(client.focus.screen)[i]
- if client.focus and tag then
- awful.client.toggletag(tag)
+ if client.focus then
+ local tag = client.focus.screen.tags[i]
+ if tag then
+ client.focus:toggle_tag(tag)
+ end
end
- end))
+ end,
+ {description = "toggle focused client on tag #" .. i, group = "tag"})
+ )
end
+
+-- Client Buttons {{{1
+clientbuttons = awful.util.table.join(
+ awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
+ awful.button({ modkey }, 1, awful.mouse.client.move),
+ awful.button({ modkey }, 3, awful.mouse.client.resize))
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, an error happened!",
- text = err })
+ text = tostring(err) })
in_error = false
end)
end
-- Variable definitions {{{1
--- Themes define colours, icons, and wallpapers
+-- Themes define colours, icons, font and wallpapers.
beautiful.init(awful.util.getdir("config").."/themes/mlp/theme.lua")
-- This is used later as the default terminal and editor to run.
editor = os.getenv("EDITOR") or "vim"
editor_cmd = terminal .. " -e " .. editor
--- Wallpaper {{{1
-if beautiful.wallpaper then
- for s = 1, screen.count() do
- gears.wallpaper.maximized(beautiful.wallpaper, s, true)
- end
-end
-
-- Require files {{{1
require("bindings")
require("tags")
require("topbar")
require("rules")
-- require("conky")
-require("autostart")
require("signals")
-- Set keys
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
+ raise = true,
keys = clientkeys,
- buttons = clientbuttons } },
- { rule = { class = "mpv" },
- properties = { floating = true } },
- { rule = { class = "MPlayer" },
- properties = { floating = true } },
- { rule = { class = "pinentry" },
- properties = { floating = true } },
- { rule = { class = "gimp" },
+ buttons = clientbuttons,
+ screen = awful.screen.preferred,
+ placement = awful.placement.no_overlap+awful.placement.no_offscreen } },
+ { rule_any = {
+ class = {
+ "Sensation Editor",
+ "MPlayer",
+ "pinentry",
+ "mpv",
+ "gimp",
+ } },
properties = { floating = true } },
{ rule = { class = "URxvt", instance = "pulsemixer" },
properties = { floating = true,
skip_taskbar = true,
ontop = true,
+ placement = awful.placement.top_right,
function (c)
- c:geometry({ x = 1920 - 500, y = mywibox[mouse.screen].height,
- width = 500, height = 300})
- c:connect_signal("unfocus", function (c) c:kill() end)
+ s = awful.screen.focused()
+ c:connect_signal("unfocus", function (c) c:kill() end)
end } },
{ rule = { class = "URxvt"},
properties = { opacity = 0.8 } },
{ rule = { class = "URxvt", instance = "mutt" },
properties = { tag = wwwtag,
function (c) awful.client.setslave(c) end } },
- { rule = { class = "Dwb", type = "normal", instance = "dwb-default" },
- properties = { tag = wwwtag,
- function (c) awful.client.setmaster(c) end } },
- { rule = { class = "Dwb", type = "normal", instance = "dwb-social" },
- properties = { tag = socialtag } },
{ rule = { class = "URxvt", instance = "ncmpcpp" },
properties = { tag = mediatag,
function (c) awful.client.setmaster(c) end } },
layouts =
{
awful.layout.suit.floating,
- lain.layout.uselesstile,
- lain.layout.uselesstile.left,
- lain.layout.uselesstile.bottom,
- lain.layout.uselesstile.top,
- lain.layout.uselessfair,
- lain.layout.uselessfair.horizontal,
+ awful.layout.suit.tile,
+ awful.layout.suit.tile.left,
+ awful.layout.suit.tile.bottom,
+ awful.layout.suit.tile.top,
-- lain.layout.uselesspiral,
-- lain.layout.uselesspiral.dwindle,
awful.layout.suit.max,
local path = beautiful.path
local icon_only = true
+--TODO create a list of tag objects and place them according to number of screens (sb:20170130)
-- single screen {{{2
mytags[1] = {}
mytags[1][1] = {
- { name = "1", layout = lain.layout.uselesstile.left, mwfact=0.50, icon = path.."/cutiemarks/pinkie_pie.png"},
- { name = "2", layout = lain.layout.uselesstile, mwfact=0.60, icon = path.."/cutiemarks/rainbow_dash.png"},
- { name = "3", layout = awful.layout.suit.max, mwfact=0.50, icon = path.."/cutiemarks/twilight_sparkle.png"},
- { name = "4", layout = lain.layout.uselesstile.left, mwfact=0.60, icon = path.."/cutiemarks/doctor_whooves.png"},
- { name = "5", layout = lain.layout.uselesstile, mwfact=0.30, icon = path.."/cutiemarks/derpy_hooves.png"},
- { name = "6", layout = lain.layout.uselesstile, mwfact=0.50, icon = path.."/cutiemarks/trixie.png"},
- { name = "7", layout = lain.layout.uselesstile.bottom, mwfact=0.80, icon = path.."/cutiemarks/soarin.png"},
- { name = "8", layout = lain.layout.uselesstile, mwfact=0.50, icon = path.."/cutiemarks/princess_celestia.png"},
- { name = "9", layout = awful.layout.suit.floating, mwfact=0.50, icon = path.."/cutiemarks/princess_luna.png"},
+ { name = "1", layout = awful.layout.suit.tile.left, master_width_factor=0.50, icon = path.."/cutiemarks/pinkie_pie.png"},
+ { name = "2", layout = awful.layout.suit.tile, master_width_factor=0.60, icon = path.."/cutiemarks/rainbow_dash.png"},
+ { name = "3", layout = awful.layout.suit.max, master_width_factor=0.50, icon = path.."/cutiemarks/twilight_sparkle.png"},
+ { name = "4", layout = awful.layout.suit.tile.left, master_width_factor=0.60, icon = path.."/cutiemarks/doctor_whooves.png"},
+ { name = "5", layout = awful.layout.suit.tile, master_width_factor=0.30, icon = path.."/cutiemarks/derpy_hooves.png"},
+ { name = "6", layout = awful.layout.suit.tile, master_width_factor=0.50, icon = path.."/cutiemarks/trixie.png"},
+ { name = "7", layout = awful.layout.suit.tile.bottom, master_width_factor=0.80, icon = path.."/cutiemarks/soarin.png"},
+ { name = "8", layout = awful.layout.suit.tile, master_width_factor=0.50, icon = path.."/cutiemarks/princess_celestia.png"},
+ { name = "9", layout = awful.layout.suit.floating, master_width_factor=0.50, icon = path.."/cutiemarks/princess_luna.png"},
}
-- Dual screen {{{2
mytags[2] = {}
mytags[2][1] = {
- { name = "1", layout = lain.layout.uselesstile.left, mwfact=0.50, icon = path.."/cutiemarks/pinkie_pie.png"},
- { name = "2", layout = lain.layout.uselesstile.left, mwfact=0.60, icon = path.."/cutiemarks/rainbow_dash.png"},
- { name = "3", layout = lain.layout.uselesstile.left, mwfact=0.60, icon = path.."/cutiemarks/twilight_sparkle.png"},
- { name = "4", layout = lain.layout.uselesstile.left, mwfact=0.60, icon = path.."/cutiemarks/doctor_whooves.png"},
- { name = "5", layout = lain.layout.uselesstile.left, mwfact=0.30, icon = path.."/cutiemarks/derpy_hooves.png"},
- { name = "6", layout = lain.layout.uselesstile.left, mwfact=0.70, icon = path.."/cutiemarks/trixie.png"},
- { name = "7", layout = lain.layout.uselesstile.left, mwfact=0.88, icon = path.."/cutiemarks/soarin.png"},
- { name = "8", layout = lain.layout.uselesstile.left, mwfact=0.84, icon = path.."/cutiemarks/princess_celestia.png"},
- { name = "9", layout = awful.layout.suit.floating, mwfact=0.50, icon = path.."/cutiemarks/princess_luna.png"},
+ { name = "1", layout = awful.layout.suit.tile.left, master_width_factor=0.50, icon = path.."/cutiemarks/pinkie_pie.png"},
+ { name = "2", layout = awful.layout.suit.tile.left, master_width_factor=0.60, icon = path.."/cutiemarks/rainbow_dash.png"},
+ { name = "3", layout = awful.layout.suit.tile.left, master_width_factor=0.60, icon = path.."/cutiemarks/twilight_sparkle.png"},
+ { name = "4", layout = awful.layout.suit.tile.left, master_width_factor=0.60, icon = path.."/cutiemarks/doctor_whooves.png"},
+ { name = "5", layout = awful.layout.suit.tile.left, master_width_factor=0.30, icon = path.."/cutiemarks/derpy_hooves.png"},
+ { name = "6", layout = awful.layout.suit.tile.left, master_width_factor=0.70, icon = path.."/cutiemarks/trixie.png"},
+ { name = "7", layout = awful.layout.suit.tile.left, master_width_factor=0.88, icon = path.."/cutiemarks/soarin.png"},
+ { name = "8", layout = awful.layout.suit.tile.left, master_width_factor=0.84, icon = path.."/cutiemarks/princess_celestia.png"},
+ { name = "9", layout = awful.layout.suit.floating, master_width_factor=0.50, icon = path.."/cutiemarks/princess_luna.png"},
}
mytags[2][2] = {
- { name = "1", layout = lain.layout.uselesstile, mwfact=0.60, icon = path.."/cutiemarks/snails.png"},
- { name = "2", layout = awful.layout.suit.max, mwfact=0.88, icon = path.."/cutiemarks/snips.png"},
- { name = "3", layout = lain.layout.uselesstile, mwfact=0.50, icon = path.."/cutiemarks/lyra_heartstrings.png"},
- { name = "4", layout = lain.layout.uselesstile.left, mwfact=0.80, icon = path.."/cutiemarks/rarity.png"},
- { name = "5", layout = lain.layout.uselesstile, mwfact=0.50, icon = path.."/cutiemarks/fluttershy.png"},
- { name = "6", layout = lain.layout.uselesstile, mwfact=0.50, icon = path.."/cutiemarks/applejack.png"},
- { name = "7", layout = lain.layout.uselesstile, mwfact=0.50, icon = path.."/cutiemarks/snowflake.png"},
- { name = "8", layout = lain.layout.uselesstile, mwfact=0.50, icon = path.."/cutiemarks/thunderlane.png"},
- { name = "9", layout = awful.layout.suit.max, mwfact=0.50, icon = path.."/cutiemarks/bon_bon.png"},
+ { name = "1", layout = awful.layout.suit.tile, master_width_factor=0.60, icon = path.."/cutiemarks/snails.png"},
+ { name = "2", layout = awful.layout.suit.max, master_width_factor=0.88, icon = path.."/cutiemarks/snips.png"},
+ { name = "3", layout = awful.layout.suit.tile, master_width_factor=0.50, icon = path.."/cutiemarks/lyra_heartstrings.png"},
+ { name = "4", layout = awful.layout.suit.tile.left, master_width_factor=0.80, icon = path.."/cutiemarks/rarity.png"},
+ { name = "5", layout = awful.layout.suit.tile, master_width_factor=0.50, icon = path.."/cutiemarks/fluttershy.png"},
+ { name = "6", layout = awful.layout.suit.tile, master_width_factor=0.50, icon = path.."/cutiemarks/applejack.png"},
+ { name = "7", layout = awful.layout.suit.tile, master_width_factor=0.50, icon = path.."/cutiemarks/snowflake.png"},
+ { name = "8", layout = awful.layout.suit.tile, master_width_factor=0.50, icon = path.."/cutiemarks/thunderlane.png"},
+ { name = "9", layout = awful.layout.suit.max, master_width_factor=0.50, icon = path.."/cutiemarks/bon_bon.png"},
}
+-- Wallpaper {{{2
+local function set_wallpaper(s)
+ -- Wallpaper
+ if beautiful.wallpaper then
+ local wallpaper = beautiful.wallpaper
+ -- If wallpaper is a function, call it with the screen
+ if type(wallpaper) == "function" then
+ wallpaper = wallpaper(s)
+ end
+ gears.wallpaper.maximized(wallpaper, s, true)
+ end
+end
+
+-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
+screen.connect_signal("property::geometry", set_wallpaper)
+
-- Tags {{{2
tags = {}
local sc = screen.count()
-for s = 1, sc do
+awful.screen.connect_for_each_screen(function(s)
+ -- Wallpaper
+ set_wallpaper(s)
+
+ local s = s.index
tags[s] = {}
for i,p in ipairs(mytags[sc][s]) do
local props = {}
tags[s][i] = awful.tag.add(p.name, props)
end
tags[s][1].selected = true
-end
+end)
-- Default awesome theme --
---------------------------
-theme = {}
+local theme = {}
theme.path = awful.util.getdir("config").."/themes/mlp"
theme.fg_urgent = "#ffffff"
theme.fg_minimize = "#ffffff"
+theme.useless_gap = 10
+theme.gap_single_client = false
theme.border_width = 2
theme.border_normal = "#000000"
theme.border_focus = "#535d6c"
--theme.bg_widget = "#cc0000"
-- Define the image to load
-theme.titlebar_close_button_normal = theme.path.."/titlebar/close_normal.png"
-theme.titlebar_close_button_focus = theme.path.."/titlebar/close_focus.png"
-
theme.titlebar_ontop_button_normal_inactive = theme.path.."/titlebar/ontop_normal_inactive.png"
theme.titlebar_ontop_button_focus_inactive = theme.path.."/titlebar/ontop_focus_inactive.png"
theme.titlebar_ontop_button_normal_active = theme.path.."/titlebar/ontop_normal_active.png"
theme.layout_tiletop = theme.path.."/layouts/tiletopw.png"
theme.layout_spiral = theme.path.."/layouts/spiralw.png"
theme.layout_dwindle = theme.path.."/layouts/dwindlew.png"
+theme.layout_cornernw = theme.path.."/layouts/cornernww.png"
+theme.layout_cornerne = theme.path.."/layouts/cornernew.png"
+theme.layout_cornersw = theme.path.."/layouts/cornersww.png"
+theme.layout_cornerse = theme.path.."/layouts/cornersew.png"
-- lain stuff
-theme.useless_gap_width = 10
theme.lain_icons = "/usr/share/awesome/lib/lain/icons/layout/default/"
theme.layout_uselessfairh = theme.path.."/layouts/fairhw.png"
theme.layout_uselessfair = theme.path.."/layouts/fairvw.png"
theme.awesome_icon = "/usr/share/awesome/icons/awesome16.png"
--- Define the icon theme for application icons. If not set then the icons
+-- Define the icon theme for application icons. If not set then the icons
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
theme.icon_theme = nil
return theme
+
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
separator = wibox.widget.textbox()
separator:set_markup('<span font="Symbola 10" color="#404040">│</span>')
+local function client_menu_toggle_fn()
+ local instance = nil
+
+ return function ()
+ if instance and instance.wibox.visible then
+ instance:hide()
+ instance = nil
+ else
+ instance = awful.menu.clients({ theme = { width = 250 } })
+ end
+ end
+end
+
-- Wibox {{{1
-- Create a wibox for each screen and add it
-mywibox = {}
-mypromptbox = {}
-mylayoutbox = {}
-mytaglist = {}
-mytaglist.buttons = awful.util.table.join(
- awful.button({ }, 1, awful.tag.viewonly),
- awful.button({ modkey }, 1, awful.client.movetotag),
+local taglist_buttons = awful.util.table.join(
+ awful.button({ }, 1, function(t) t:view_only() end),
+ awful.button({ modkey }, 1, function(t)
+ if client.focus then
+ client.focus:move_to_tag(t)
+ end
+ end),
awful.button({ }, 3, awful.tag.viewtoggle),
- awful.button({ modkey }, 3, awful.client.toggletag),
- awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
- awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
- )
-mytasklist = {}
-mytasklist.buttons = awful.util.table.join(
+ awful.button({ modkey }, 3, function(t)
+ if client.focus then
+ client.focus:toggle_tag(t)
+ end
+ end),
+ awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
+ awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
+ )
+
+local tasklist_buttons = awful.util.table.join(
awful.button({ }, 1, function (c)
if c == client.focus then
c.minimized = true
-- Without this, the following
-- :isvisible() makes no sense
c.minimized = false
- if not c:isvisible() then
- awful.tag.viewonly(c:tags()[1])
+ if not c:isvisible() and c.first_tag then
+ c.first_tag:view_only()
end
-- This will also un-minimize
-- the client, if needed
end
end),
awful.button({ }, 2, function (c) c:kill() end),
- awful.button({ }, 3, function ()
- if instance then
- instance:hide()
- instance = nil
- else
- instance = awful.menu.clients({ width=250 })
- end
- end),
+ awful.button({ }, 3, client_menu_toggle_fn()),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
- if client.focus then client.focus:raise() end
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
- if client.focus then client.focus:raise() end
end))
-for s = 1, screen.count() do
+awful.screen.connect_for_each_screen(function(s)
-- Create a promptbox for each screen
- mypromptbox[s] = awful.widget.prompt()
+ s.mypromptbox = awful.widget.prompt()
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen.
- mylayoutbox[s] = awful.widget.layoutbox(s)
- mylayoutbox[s]:buttons(awful.util.table.join(
- awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
- awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
- awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
- awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
+ s.mylayoutbox = awful.widget.layoutbox(s)
+ s.mylayoutbox:buttons(awful.util.table.join(
+ awful.button({ }, 1, function () awful.layout.inc( 1) end),
+ awful.button({ }, 3, function () awful.layout.inc(-1) end),
+ awful.button({ }, 4, function () awful.layout.inc( 1) end),
+ awful.button({ }, 5, function () awful.layout.inc(-1) end)))
-- Create a taglist widget
- mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
+ s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons)
-- Create a tasklist widget
- mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
+ s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons)
-- Create the wibox
- mywibox[s] = awful.wibox({ position = "top", screen = s })
-
- -- Widgets that are aligned to the left
- local left_layout = wibox.layout.fixed.horizontal()
- -- left_layout:add(mylauncher)
- left_layout:add(mytaglist[s])
- left_layout:add(mypromptbox[s])
+ s.mywibox = awful.wibar({ position = "top", screen = s })
- -- Widgets that are aligned to the right
- local right_layout = wibox.layout.fixed.horizontal()
- if s == 1 then right_layout:add(wibox.widget.systray()) end
- right_layout:add(separator)
- right_layout:add(require("widgets/pomodoro"))
- right_layout:add(separator)
- right_layout:add(require("widgets/awesompd"))
- right_layout:add(require("widgets/volume_widget"))
- if utils.host == "chronos" then
- right_layout:add(separator)
- right_layout:add(require("widgets/battery_widget"))
- end
- right_layout:add(separator)
- right_layout:add(require("widgets/network_widget"))
- right_layout:add(separator)
- right_layout:add(require("widgets/calendar"))
- right_layout:add(mylayoutbox[s])
-
- -- Now bring it all together (with the tasklist in the middle)
- local layout = wibox.layout.align.horizontal()
- layout:set_left(left_layout)
- layout:set_middle(mytasklist[s])
- layout:set_right(right_layout)
-
- mywibox[s]:set_widget(layout)
-end
+ -- Add widgets to the wibox
+ s.mywibox:setup {
+ layout = wibox.layout.align.horizontal,
+ { -- Left widgets
+ layout = wibox.layout.fixed.horizontal,
+ s.mytaglist,
+ s.mypromptbox,
+ },
+ s.mytasklist, -- Middle widget
+ { -- Right widgets
+ layout = wibox.layout.fixed.horizontal,
+ mykeyboardlayout,
+ wibox.widget.systray(),
+ separator,
+ require("widgets/pomodoro"),
+ separator,
+ require("widgets/awesompd"),
+ require("widgets/volume_widget"),
+ utils.has_battery() and {
+ layout = wibox.layout.fixed.horizontal,
+ separator,
+ require("widgets/battery_widget"),
+ },
+ separator,
+ require("widgets/network_widget"),
+ separator,
+ require("widgets/calendar"),
+ s.mylayoutbox,
+ },
+ }
+end)
local host = io.popen("hostname")
utils.host = host:read("*l")
+function utils.is_dir(path)
+ return os.execute(('[ -d "%s" ]'):format(path))
+end
+
function utils.run_or_kill(prg, cprop, screen)
if not prg then
do return nil end
end
end
end
- awful.util.spawn_with_shell(prg, screen)
+ awful.spawn.with_shell(prg, screen)
end
-- http://awesome.naquadah.org/wiki/Autostart#Simple_way
end
if not arg_string then
- awful.util.spawn_with_shell("pgrep -f -u $USER -x '" .. pname .. "' || (" .. prg .. ")",screen)
+ awful.spawn.with_shell("pgrep -f -u $USER -x '" .. pname .. "' || (" .. prg .. ")",screen)
else
- awful.util.spawn_with_shell("pgrep -f -u $USER -x '" .. pname .. " ".. arg_string .."' || (" .. prg .. " " .. arg_string .. ")",screen)
+ awful.spawn.with_shell("pgrep -f -u $USER -x '" .. pname .. " ".. arg_string .."' || (" .. prg .. " " .. arg_string .. ")",screen)
end
end
globalkeys = awful.util.table.join(globalkeys, keys)
end
+function utils.has_battery()
+ return utils.is_dir("/sys/class/power_supply/BAT0")
+end
+
return utils
-Subproject commit 3157a1c765ce4ae9130ee472d162bcf4026965d1
+Subproject commit d9a2e4b2d274eab33e09bd1544f0ed0b94a488c2
musicwidget.mpd_config = os.getenv("XDG_CONFIG_HOME").."/mpd/mpd.conf"
-- Specify the browser you use so awesompd can open links from
-- Jamendo in it.
-musicwidget.browser = "mimeo"
+musicwidget.browser = "rifle"
-- Specify decorators on the left and the right side of the
-- widget. Or just leave empty strings if you decorate the widget
-- from outside.
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! ⚡",
})
nextlim = getnextlim(charge)
end
- elseif state ~= "+" then
+ elseif state == "+" then
dirsign = "↑"
nextlim = limits[1][1]
else
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
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 }
calendar.position = "top_right"
calendar.offset = 0
-local calwidget = awful.widget.textclock(" %a %b %d, %k:%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)
-Subproject commit 6f869684f7745c7e7aae9336facdc47d2896cc30
+Subproject commit 14ddf2e767ab2f4be8b032f51f7d37cafadf2d9a
if utils.host == "smartlab-imac2" then
widget = net_widget.wireless({interface="wlp3s0", command_mode="newer", font='monospace'})
end
-if utils.host == "shada" then
+if utils.host == "hactar" then
widget = net_widget.indicator({interfaces={"enp3s0"}, command_mode="newer", font='monospace'})
end
if utils.host == "sb-arch" then
widget = net_widget.indicator({interfaces={"enp0s31f6"}, command_mode="newer", font='monospace'})
end
+if utils.host == "UH-LPT044" then
+ widget = net_widget.wireless({interface="wlp4s0", command_mode="newer", font='monospace'})
+end
return widget
-Subproject commit a861385355d0ac10091eda49757fc9eda05480a3
+Subproject commit cf595599d926fe975ce4207ae9d3e61bbd36e340
-- format string
pomodoro.format = function (t) return " <b>"..t.."</b>" end
+pomodoro.auto_start_pomodoro = false
pomodoro.init()
pombox:add(pomodoro.icon_widget)
pombox:add(pomodoro.widget)
+--TODO connect signals to something sensible (sb:20170130)
+-- 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("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
-- Select device
local device = ""
if utils.host == "chronos" then device = "alsa_output.pci-0000_00_1b.0.analog-stereo" end
-if utils.host == "shada" then device = "alsa_output.pci-0000_00_14.2.analog-stereo" end
+if utils.host == "hactar" then device = "alsa_output.pci-0000_00_14.2.analog-stereo" end
-- Register widget
vicious.register(volwidget, vicious.contrib.pulse, "$1", 1, device)
--- /dev/null
+#!/usr/bin/env bash
+
+vim \
+ -c "call vimwiki#diary#make_note(v:count1)" \
+ + \
+ -c 'r !date +"\%n== \%H:\%M ==\%n * "' \
+ -c "start!"
if [[ "$(hostnamectl --static)" == "$host" ]]; then
/usr/bin/weechat "$@"
else
- autossh -M0 -t $host "tmux -u new-session -As weechat weechat"
+ autossh -M0 -t $host "LANG=en_GB.UTF-8 tmux -u new-session -As weechat weechat"
fi
-secrets: private.yml
+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
transmission:
host: localhost
port: 9091
- path: /mnt/Skaro/torrents/done
+ path: /srv/torrents/done
ratio: 0.0
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://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://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
- \[facepalm\]: {from: title}
- \bASAP\b: {from: title}
- \b Go\): {from: title} # filter those misplaced french only movies
+ - \b(HEVC|x265)\b: {from: title} # don't get x265/HEVC
series: # {{{2
upgrade: yes
exists_series:
path:
- - '/mnt/Skaro/Series/{{tvdb_series_name}}'
+ - '/mnt/series/{{tvdb_series_name}}'
allow_different_qualities: better
content_size:
min: 100
- american dad
- archer 2009
- better call saul
+ - black mirror
- boardwalk empire
- breaking bad
- broadchurch
- family guy
- foyle's war
- futurama
- - game of thrones
+ - game of thrones: { timeframe: 9 hours }
- homeland
- house of cards 2013: { alternate_name: house of cards us }
- how i met your mother
- suits
- the big bang theory
- the blacklist
+ - the blacklist redemption
- the cleveland show
- the walking dead
- two and a half men
- the wire: { quality: 720p+ }
- vinyl
+ - westworld
series-trakt: # {{{2
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
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
interval: 1 hours
what:
- trakt_list:
- username: '{{secrets.trakt.username}}'
- account: '{{secrets.trakt.account}}'
+ username: '{?trakt.username?}'
+ account: '{?trakt.account?}'
list: backfill
type: episodes
- - emit_series:
+ - 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
priority: '-2'
exists_movie:
path:
- - '/mnt/Skaro/Movies'
+ - '/mnt/movies'
allow_different_qualities: better
type: files
lookup: imdb
movies-imdb: # {{{2
+ imdb_lookup: yes
+ require_field: imdb_url
imdb:
min_score: 7.5
min_votes: 30000
- imdb_required: on
movies-1080p: # {{{2
max: 10000
strict: yes
- movies-discover-queue: # {{{2
- movie_queue: accept
- discover:
- what:
- - emit_movie_queue: yes
- from:
- - newznab:
- url: 'https://www.usenet-crawler.com/api?apikey={{secrets.crawler.apikey}}&t=movie&extended=1&cat=2040'
- category: movie
- interval: 7 days # search each entry only once a week
+ # movies-discover-queue: # {{{2
+ # movie_queue: accept
+ # discover:
+ # what:
+ # - emit_movie_queue: yes
+ # from:
+ # - newznab:
+ # 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
trakt-add-collection: # {{{2
- trakt_add:
- username: '{{secrets.trakt.username}}'
- account: '{{secrets.trakt.account}}'
- list: collection
+ list_add:
+ - trakt_list:
+ username: '{?trakt.username?}'
+ account: '{?trakt.account?}'
+ list: collection
tasks: # {{{1
# digest: backfill
- dl-movies-trakt: # {{{2
- priority: 10
- trakt_list:
- username: '{{secrets.trakt.username}}'
- account: '{{secrets.trakt.account}}'
- list: watchlist
- type: movies
- accept_all: yes
- movie_queue: add
-
-
- dl-movies-trakt-remove: # {{{2
- priority: 20
- disable:
- - seen
- emit_movie_queue: yes
- crossmatch:
- from:
- - trakt_list:
- username: '{{secrets.trakt.username}}'
- account: '{{secrets.trakt.account}}'
- list: watchlist
- type: movies
- fields: [imdb_id]
- action: reject
- accept_all: yes
- movie_queue: remove
+ # dl-movies-trakt: # {{{2
+ # priority: 10
+ # trakt_list:
+ # username: '{?trakt.username?}'
+ # account: '{?trakt.account?}'
+ # list: watchlist
+ # type: movies
+ # accept_all: yes
+ # movie_queue: add
+
+
+ # dl-movies-trakt-remove: # {{{2
+ # priority: 20
+ # disable:
+ # - seen
+ # emit_movie_queue: yes
+ # crossmatch:
+ # from:
+ # - trakt_list:
+ # username: '{?trakt.username?}'
+ # account: '{?trakt.account?}'
+ # list: watchlist
+ # type: movies
+ # fields: [imdb_id]
+ # action: reject
+ # accept_all: yes
+ # movie_queue: remove
dl-movies-discover-queue-1080p: # {{{2
filesystem:
path:
- - /mnt/Skaro/usenet/done
- - /mnt/Skaro/torrents/done
+ - /srv/usenet/done
+ - /srv/torrents/done
recursive: yes
retrieve: files
regexp: '.*\.(avi|mkv|mp4|mpg|divx|webm)$'
all_series:
parse_only: yes
accept_all: yes
- require_field: tvdb_episode
+ require_field:
+ - tvdb_season
+ - tvdb_episode
+ - tvdb_ep_name
set:
- destination: '/mnt/Skaro/Series'
+ destination: '/mnt/series'
folder: "{{tvdb_series_name}}/{% if tvdb_season == 0 %}Specials{% else %}Season {{tvdb_season}}{% endif %}"
filename: "{{tvdb_season}}x{{tvdb_episode|pad(2)}} {{tvdb_ep_name|replace('/','-')}} ({{tvdb_ep_air_date|formatdate('%Y')}}){{'{'}}{{quality|replace(' ','}{')}}{{'}'}}[en]"
move:
- to: "/mnt/Skaro/Series/{{folder}}"
- filename: "{{filename}}"
+ to: "/mnt/series/{{folder}}"
+ rename: "{{filename}}"
clean_source: 100 # removes dir if < [N] MB
# log: "<<<{{folder}}/{{filename}}>>>"
filesystem:
path:
- - /mnt/Skaro/usenet/done
- - /mnt/Skaro/torrents/done
+ - /srv/usenet/done
+ - /srv/torrents/done
recursive: yes
regexp: '.*\.(mkv|avi|mp4)$'
- movie_name is None:
manipulate:
- title:
- extract: '([^/]*)/[^/]*$'
+ extract: 'done/([^/]*)/[^/]*$'
from: location
imdb_lookup: yes
accept_all: yes
- require_field: imdb_name
+ require_field:
+ - imdb_name
+ - imdb_year
set:
- destination: '/mnt/Skaro/Movies'
+ destination: '/mnt/movies'
filename: "{{imdb_name}} ({{imdb_year}}){{'{'}}{{quality|replace(' ','}{')}}{{'}'}}[en]"
move:
- to: "/mnt/Skaro/Movies"
- filename: "{{filename}}"
+ to: "/mnt/movies"
+ rename: "{{filename}}"
clean_source: 100 # removes dir if < [N] MB
exec:
daily-mail: # {{{2
manual: yes
no_entries_ok: yes
- emit_digest:
+ from_digest:
list: move-tasks
seen: local
accept_all: yes
- email:
- from: flexget@tardis
- to: ramsi@localhost
- template: move
+ notify:
+ task:
+ template: move
+ via:
+ - email:
+ from: flexget@tardis
+ to: ramsi@localhost
backfill-mail: # {{{2
template:
- email
no_entries_ok: yes
- emit_digest:
+ from_digest:
list: backfill
seen: local
accept_all: yes
filesystem:
path:
- - '/mnt/Skaro/Series'
+ - '/mnt/series'
recursive: yes
retrieve: files
regexp: '.*\.(avi|mkv|mp4|webm|m4v)$'
filesystem:
path:
- - '/mnt/Skaro/Series'
+ - '/mnt/series'
recursive: yes
retrieve: files
regexp: '.*\.(avi|mkv|mp4|webm|m4v)$'
- trakt-add-collection
filesystem:
path:
- - '/mnt/Skaro/Movies'
+ - '/mnt/movies'
recursive: yes
retrieve: files
regexp: '.*\.(avi|mkv|mp4|webm|m4v)$'
[rebase]
autostash = true
autosquash = true
+[status]
+ submodulesummary = true
+[rerere]
+ enabled = true
+++ /dev/null
-/usr/bin/mpv --profile=mimeo "%u"
- ^https?://www.youtube.com/watch\?(.*&)*v=.*
pid_file "~/.local/share/mpd/pid"
state_file "~/.local/share/mpd/state"
sticker_file "~/.local/share/mpd/sticker.sql"
-
-input {
- plugin "curl"
-}
+max_output_buffer_size "16384"
audio_output {
type "pulse"
cache-default=50000
cache-initial=100
no-sub
-
-# profiles
-[mimeo]
-quiet
macro index,pager gc "<change-folder>=gmail/cadscan<return>" "go to cadscan"
bind index q noop
-bind index Q noop
-bind index x noop
+bind index,pager Q noop
+bind index,pager x noop
# completion
bind editor <Tab> complete-query
folder-hook youtube push '<limit>=(=U|=F)<enter>'
# delete other mails
folder-hook youtube push '<delete-pattern>!~(~U|~F)<enter>'
+
+# open video in mpv
+folder-hook * bind index,pager m mail
+folder-hook * bind pager <return> next-line
+folder-hook youtube 'macro index,pager m "<pipe-message>~/.mutt/mutt_mpv<enter>"'
+folder-hook youtube 'macro pager <return> "<pipe-message>~/.mutt/mutt_mpv<enter>"'
text/html; ~/.mutt/mutt_bgrun qutebrowser %s; test=test -n "$DISPLAY"; nametemplate=%s.html
text/html; w3m -I %{charset} -dump %s -T text/html -cols "$COLUMNS" -o display_link_number=1; copiousoutput; nametemplate=%s.html
-image/*; ~/.mutt/mutt_bgrun feh %s;
-application/pdf; ~/.mutt/mutt_bgrun okular %s;
-application/*; ~/.mutt/mutt_bgrun mimeo %s;
+application/*; ~/.mutt/mutt_bgrun rifle -f F %s;
+image/*; rifle -f F %s;
--- /dev/null
+#!/usr/bin/env bash
+
+url=$(grep -Eo '^https?://www.youtube.com/watch\?v=[[:alnum:]_-]{11}' </dev/stdin)
+
+if youtube-dl -qs "$url"; then
+ mpv --no-terminal "$url" &
+else
+ exit $?
+fi
subscribe -group neovim ^neovim.*github.com
subscribe -group mutt mutt-users@mutt.org
subscribe -group qutebrowser ^qutebrowser.*
+subscribe -group lug @mailman.lug.org.uk
# performance tuning
set read_inc = 1000 # nb of messages read before printing status
set markers = no
set mark_old = no # leave messages as new if unread
set status_on_top = yes # also help on bottom
+set wait_key = no # don't wait for enter key
set index_format="[%Z] %{%e/%m} %15.15L %?M?+ ?%s"
# header
set header_cache = "~/.cache/mutt" # cache headers for speedss
source ~/.mutt/mailboxes # source mailboxes generetated by offlineimap
-# SMTP: msmtp (with queue)
-set sendmail = ~/.msmtp/msmtpq # use msmtp message queue
-set sendmail_wait = -1 # fork sendmail to the background
-set send_charset="us-ascii:utf-8" # only use ascii and utf8
+# SMTP: msmtp
+set sendmail = /usr/bin/msmtp # use msmtp
+set send_charset="utf-8" # only utf8
# GnuPG
-set crypt_autosign = yes # autosign messages
set crypt_replyencrypt = yes # encrypt replies to encrypted messages
set crypt_replysign = yes # sign replies to signed messages
set crypt_replysignencrypted = yes # you get the idea
set pgp_use_gpg_agent = yes # don't ask for passwords
source /usr/share/doc/mutt/samples/gpg.rc
+group -group nosign -rx .*@bitbucket.org
+group -group nosign -rx jira@.*atlassian.net
+send-hook . "set crypt_autosign = yes"
+send-hook "%t nosign" "set crypt_autosign = no"
+
source ~/.mutt/hooks
source ~/.mutt/bindings
source ~/.mutt/colors/badfox # color theme
def_key "q"
dummy
-def_key "ctrl_c"
+def_key "ctrl-c"
quit
def_key "k"
def_key "h"
volume_down
+def_key "g"
+ move_home
+
+def_key "G"
+ move_end
+
def_key "!"
show_playlist
def_key "c"
clear_main_playlist
-# def_key "c"
-# dummy
-
def_key "C"
crop_main_playlist
-# def_key "C"
-# dummy
+def_key "n"
+ next_found_item
+
+def_key "N"
+ previous_found_item
+
+def_key "v"
+ select_item
+ scroll_down
+
+def_key "V"
+ remove_selection
+
+def_key "ctrl-v"
+ reverse_selection
mpd_host = "localhost"
mpd_port = "6600"
mpd_music_dir = "~/music"
-lyrics_directory = "~/.local/share/mpd/lyrics"
+
+ncmpcpp_directory = "~/.config/ncmpcpp"
+lyrics_directory = "~/.local/share/mpd/lyrics"
playlist_display_mode = "columns"
browser_display_mode = "columns"
maxconnections = 3
holdconnectionopen = yes
keepalive = 60
+auth_mechanisms = GSSAPI, CRAM-MD5, PLAIN, LOGIN
# readonly = True
--- /dev/null
+/qsettings/
tab-next
<ctrl-pgdown>
+record-macro
+ q
+
+run-macro
+ @
+
[insert]
# Keybindings for insert mode.
# Since normal keypresses are passed through, only special keys are
prompt-open-download
<ctrl-x>
+prompt-item-focus prev
+ <shift-tab>
+ <up>
+
+prompt-item-focus next
+ <tab>
+ <down>
+
[command,prompt]
rl-backward-char
#
# startpage (List of String):
# The default page(s) to open at the start, separated by commas.
-# Default: https://duckduckgo.com
+# Default: https://start.duckduckgo.com
#
# yank-ignored-url-parameters (List of String):
# The URL parameters to strip with :yank url, separated by commas.
# Default:
# ref,utm_source,utm_medium,utm_campaign,utm_term,utm_content
#
+# default-open-dispatcher (String):
+# The default program used to open downloads. Set to an empty string
+# to use the default internal handler.
+# Any {} in the string will be expanded to the filename, else the
+# filename will be appended.
+# Default:
+#
# default-page (FuzzyUrl):
# The page to open if :open -t/-b/-w is used without URL. Use
# `about:blank` for a blank page.
# developer-extras (Bool):
# Enable extra tools for Web developers.
# This needs to be enabled for `:inspector` to work and also adds an
-# _Inspect_ entry to the context menu.
+# _Inspect_ entry to the context menu. For QtWebEngine, see
+# 'qutebrowser --help' instead.
# Valid values: true, false
# Default: false
#
ignore-case = smart
startpage = https://duckduckgo.com/?t=chakra
yank-ignored-url-parameters = ref,utm_source,utm_medium,utm_campaign,utm_term,utm_content
+default-open-dispatcher =
default-page = ${startpage}
auto-search = naive
auto-save-config = true
# Valid values: true, false
# Default: false
#
-# user-stylesheet (UserStyleSheet):
-# User stylesheet to use (absolute filename, filename relative to
-# the config directory or CSS string). Will expand environment
-# variables.
-# Default: html > ::-webkit-scrollbar { width: 0px; height: 0px; }
+# user-stylesheet (File):
+# User stylesheet to use (absolute filename or filename relative to
+# the config directory). Will expand environment variables.
+# Default:
+#
+# hide-scrollbar (Bool):
+# Hide the main scrollbar.
+# Valid values: true, false
+# Default: true
#
# css-media-type (String):
# Set the CSS media type.
# * `{id}`: The internal window ID of this window.
# * `{scroll_pos}`: The page scroll position.
# * `{host}`: The host of the current web page.
+# * `{backend}`: Either 'webkit' or 'webengine'
# Default: {perc}{title}{title_sep}qutebrowser
#
# modal-js-dialog (Bool):
# Globs are supported, so ';*' will blacklist all keychainsstarting
# with ';'. Use '*' to disable keyhints
# Default:
+#
+# prompt-radius (Int):
+# The rounding radius for the edges of prompts.
+# Default: 8
+#
+# prompt-filebrowser (Bool):
+# Show a filebrowser in upload/download prompts.
+# Valid values: true, false
+# Default: true
zoom-levels = 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500%
default-zoom = 100%
downloads-position = top
confirm-quit = downloads
zoom-text-only = false
frame-flattening = false
-user-stylesheet = html > ::-webkit-scrollbar { width: 0px; height: 0px; }
+user-stylesheet =
+hide-scrollbar = true
css-media-type =
smooth-scrolling = false
remove-finished-downloads = -1
modal-js-dialog = false
hide-wayland-decoration = false
keyhint-blacklist =
+prompt-radius = 8
+prompt-filebrowser = true
[network]
# Settings related to the network.
# custom-headers (HeaderDict):
# Set custom headers for qutebrowser HTTP requests.
# Default:
+#
+# netrc-file (File):
+# Set location of a netrc-file for HTTP authentication. If empty,
+# ~/.netrc is used.
+# Default:
do-not-track = true
accept-language = en-US,en,de,fr
referer-header = same-domain
ssl-strict = ask
dns-prefetch = true
custom-headers =
+netrc-file =
[completion]
# Options related to completion and command history.
# into zoom increments.
# Default: 512
timeout = 500
-partial-timeout = 1000
+partial-timeout = 5000
insert-mode-on-plugins = false
auto-leave-insert-mode = true
auto-insert-mode = false
#
# select-on-remove (SelectOnRemove):
# Which tab to select when the focused tab is removed.
-# left: Select the tab on the left.
-# right: Select the tab on the right.
-# previous: Select the previously selected tab.
-# Default: right
+# prev: Select the tab which came before the closed one (left in
+# horizontal, above in vertical).
+# next: Select the tab which came after the closed one (right in
+# horizontal, below in vertical).
+# last-used: Select the previously selected tab.
+# Default: next
#
# new-tab-position (NewTabPosition):
# How new tabs are positioned.
-# left: On the left of the current tab.
-# right: On the right of the current tab.
-# first: At the left end.
-# last: At the right end.
-# Default: right
+# prev: Before the current tab.
+# next: After the current tab.
+# first: At the beginning.
+# last: At the end.
+# Default: next
#
# new-tab-position-explicit (NewTabPosition):
# How new tabs opened explicitly are positioned.
-# left: On the left of the current tab.
-# right: On the right of the current tab.
-# first: At the left end.
-# last: At the right end.
+# prev: Before the current tab.
+# next: After the current tab.
+# first: At the beginning.
+# last: At the end.
# Default: last
#
# last-close (String):
# * `{id}`: The internal tab ID of this tab.
# * `{scroll_pos}`: The page scroll position.
# * `{host}`: The host of the current web page.
+# * `{backend}`: Either 'webkit' or 'webengine'
# Default: {index}: {title}
#
# title-alignment (TextAlignment):
# Padding for indicators (top, bottom, left, right).
# Default: 2,2,0,4
background-tabs = false
-select-on-remove = left
-new-tab-position = right
-new-tab-position-explicit = right
+select-on-remove = prev
+new-tab-position = next
+new-tab-position-explicit = next
last-close = ignore
show = always
show-switching-delay = 800
# Enables or disables WebGL. For QtWebEngine, Qt/PyQt >= 5.7 is
# required for this setting.
# Valid values: true, false
-# Default: false
+# Default: true
#
# css-regions (Bool):
# Enable or disable support for CSS regions.
# Valid values: true, false, ask
# Default: ask
#
+# media-capture (BoolAsk):
+# Allow websites to record audio/video.
+# Valid values: true, false, ask
+# Default: ask
+#
# javascript-can-open-windows-automatically (Bool):
# Whether JavaScript programs can open new windows without user
# interaction.
# - A zip-file of any of the above, with either only one file, or a
# file named 'hosts' (with any extension).
# Default:
-# http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext
+# https://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext
#
# host-blocking-enabled (Bool):
# Whether host blocking is enabled.
hyperlink-auditing = false
geolocation = ask
notifications = false
+media-capture = ask
javascript-can-open-windows-automatically = false
javascript-can-close-windows = false
javascript-can-access-clipboard = false
# Aliases for commands.
# By default, no aliases are defined. Example which adds a new command
# `:qtb` to open qutebrowsers website:
-# `qtb = open http://www.qutebrowser.org/`
+# `qtb = open https://www.qutebrowser.org/`
quit = close
q = close
exit = quit
# Background color of the statusbar.
# Default: black
#
-# statusbar.fg.error (QssColor):
-# Foreground color of the statusbar if there was an error.
-# Default: ${statusbar.fg}
-#
-# statusbar.bg.error (QssColor):
-# Background color of the statusbar if there was an error.
-# Default: red
-#
-# statusbar.fg.warning (QssColor):
-# Foreground color of the statusbar if there is a warning.
-# Default: ${statusbar.fg}
-#
-# statusbar.bg.warning (QssColor):
-# Background color of the statusbar if there is a warning.
-# Default: darkorange
-#
-# statusbar.fg.prompt (QssColor):
-# Foreground color of the statusbar if there is a prompt.
-# Default: ${statusbar.fg}
-#
-# statusbar.bg.prompt (QssColor):
-# Background color of the statusbar if there is a prompt.
-# Default: darkblue
-#
# statusbar.fg.insert (QssColor):
# Foreground color of the statusbar in insert mode.
# Default: ${statusbar.fg}
# keyhint.bg (QssColor):
# Background color of the keyhint widget.
# Default: rgba(0, 0, 0, 80%)
+#
+# messages.fg.error (QssColor):
+# Foreground color of an error message.
+# Default: white
+#
+# messages.bg.error (QssColor):
+# Background color of an error message.
+# Default: red
+#
+# messages.border.error (QssColor):
+# Border color of an error message.
+# Default: #bb0000
+#
+# messages.fg.warning (QssColor):
+# Foreground color a warning message.
+# Default: white
+#
+# messages.bg.warning (QssColor):
+# Background color of a warning message.
+# Default: darkorange
+#
+# messages.border.warning (QssColor):
+# Border color of an error message.
+# Default: #d47300
+#
+# messages.fg.info (QssColor):
+# Foreground color an info message.
+# Default: white
+#
+# messages.bg.info (QssColor):
+# Background color of an info message.
+# Default: black
+#
+# messages.border.info (QssColor):
+# Border color of an info message.
+# Default: #333333
+#
+# prompts.fg (QssColor):
+# Foreground color for prompts.
+# Default: white
+#
+# prompts.bg (QssColor):
+# Background color for prompts.
+# Default: darkblue
+#
+# prompts.selected.bg (QssColor):
+# Background color for the selected item in filename prompts.
+# Default: #308cc6
completion.fg = white
completion.bg = #333333
completion.alternate-bg = #444444
completion.scrollbar.bg = ${completion.bg}
statusbar.fg = white
statusbar.bg = black
-statusbar.fg.error = ${statusbar.fg}
-statusbar.bg.error = red
-statusbar.fg.warning = ${statusbar.fg}
-statusbar.bg.warning = darkorange
-statusbar.fg.prompt = ${statusbar.fg}
-statusbar.bg.prompt = darkblue
statusbar.fg.insert = ${statusbar.fg}
statusbar.bg.insert = darkgreen
statusbar.fg.command = ${statusbar.fg}
keyhint.fg = #FFFFFF
keyhint.fg.suffix = #FFFF00
keyhint.bg = rgba(0, 0, 0, 80%)
+messages.fg.error = ${statusbar.fg}
+messages.bg.error = red
+messages.border.error = #bb0000
+messages.fg.warning = ${statusbar.fg}
+messages.bg.warning = darkorange
+messages.border.warning = #d47300
+messages.fg.info = white
+messages.bg.info = black
+messages.border.info = #333333
+prompts.fg = ${statusbar.fg}
+prompts.bg = #333333
+prompts.selected.bg = #308cc6
[fonts]
# Fonts used for the UI, with optional style/weight/size.
# keyhint (Font):
# Font used in the keyhint widget.
# Default: 8pt ${_monospace}
-_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Liberation Mono", "Courier New", Courier, monospace, Fixed, Consolas, Terminal
+#
+# messages.error (Font):
+# Font used for error messages.
+# Default: 8pt ${_monospace}
+#
+# messages.warning (Font):
+# Font used for warning messages.
+# Default: 8pt ${_monospace}
+#
+# messages.info (Font):
+# Font used for info messages.
+# Default: 8pt ${_monospace}
+#
+# prompts (Font):
+# Font used for prompts.
+# Default: 8pt sans-serif
+_monospace = Hack, Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Liberation Mono", "Courier New", Courier, monospace, Fixed, Consolas, Terminal
completion = 8pt ${_monospace}
completion.category = bold ${completion}
tabbar = 8pt ${_monospace}
web-size-default =
web-size-default-fixed =
keyhint = 8pt ${_monospace}
+messages.error = 8pt ${_monospace}
+messages.warning = 8pt ${_monospace}
+messages.info = 8pt ${_monospace}
+prompts = 8pt sans-serif
# name <regexp> | The regexp matches the basename of $1
# path <regexp> | The regexp matches the absolute path of $1
# has <program> | The program is installed (i.e. located in $PATH)
+# env <variable> | The environment variable "variable" is non-empty
# file | $1 is a file
# directory | $1 is a directory
# number <n> | change the number of this command to n
# Note: When using rifle in ranger, there is an additional flag "c" for
# only running the current file even if you have marked multiple files.
+# Play videos with mpv
+match ^https?://www.youtube.com/watch\?, has mpv, X, terminal = mpv -- $1
+match ^https?://www.youtube.com/watch\?, has mpv, X, flag f = mpv --quiet -- $1
+match ^https?://youtu.be/, has mpv, X, terminal = mpv --quiet -- $1
+match ^https?://youtu.be/, has mpv, X, flag f = mpv --quiet -- $1
+
+# open web url with BROWSER
+match ^https?://, X, flag f = $BROWSER -- "$@"
+
#-------------------------------------------
# Websites
#-------------------------------------------
# Rarely installed browsers get higher priority; It is assumed that if you
# install a rare browser, you probably use it. Firefox/konqueror/w3m on the
# other hand are often only installed as fallback browsers.
-ext x?html?, has dwb, X, flag f = dwb -- "$@"
-ext x?html?, has luakit, X, flag f = luakit -- "$@"
-ext x?html?, has chromium, X, flag f = chromium -- "$@"
-ext x?html?, has elinks, terminal = elinks "$@"
-ext x?html?, has lynx, terminal = lynx -- "$@"
-ext x?html?, has w3m, terminal = w3m "$@"
+ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
+ext x?html?, has dwb, X, flag f = dwb -- "$@"
+ext x?html?, has chromium, X, flag f = chromium -- "$@"
+ext x?html?, has elinks, terminal = elinks "$@"
+ext x?html?, has w3m, terminal = w3m "$@"
#-------------------------------------------
# Misc
#-------------------------------------------
# Define the "editor" for text files as first action
-mime ^text, label editor = "$EDITOR" -- "$@"
+mime ^text, label editor = $EDITOR -- "$@"
mime ^text, label pager = "$PAGER" -- "$@"
-!mime ^text, label editor, ext xml|csv|tex|py|pl|rb|sh|php = "$EDITOR" -- "$@"
-!mime ^text, label pager, ext xml|csv|tex|py|pl|rb|sh|php = "$PAGER" -- "$@"
+!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@"
+!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
ext 1 = man "$1"
ext s[wmf]c, has zsnes, X = zsnes "$1"
#--------------------------------------------
# Audio without X
#-------------------------------------------
-mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
-mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
-ext midi?, terminal, has wildmidi = wildmidi -- "$@"
+mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
#--------------------------------------------
# Video/Audio with a GUI
#-------------------------------------------
mime ^video|audio, has umpv, X, flag f = umpv -- "$@"
mime ^video|audio, has mpv, X, flag f = mpv -- "$@"
-mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@"
-mime ^video|audio, has smplayer, X, flag f = smplayer "$@"
-mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@"
-mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@"
-mime ^video, has mplayer, X, flag f = mplayer -- "$@"
-mime ^video, has mplayer, X, flag f = mplayer -fs -- "$@"
-mime ^video|audio, has vlc, X, flag f = vlc -- "$@"
-mime ^video|audio, has totem, X, flag f = totem -- "$@"
-mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@"
-
-#--------------------------------------------
-# Video without X:
-#-------------------------------------------
-mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@"
-mime ^video, terminal, !X, has mplayer = mplayer -- "$@"
-
-#-------------------------------------------
-# Image Viewing:
-#-------------------------------------------
-ext svg, has inkscape, X, flag f = inkscape -- "$@"
-mime ^image, has eog, X, flag f = eog -- "$@"
-mime ^image, has sxiv, X, flag f = sxiv -- "$@"
-mime ^image, has feh, X, flag f = feh -- "$@"
-mime ^image, has mirage, X, flag f = mirage -- "$@"
-mime ^image, has gimp, X, flag f = gimp -- "$@"
-ext xcf, has gimp, X, flag f = gimp -- "$@"
#-------------------------------------------
# Documents
#-------------------------------------------
-ext pdf, has llpp, X, flag f = llpp "$@"
ext pdf, has zathura, X, flag f = zathura -- "$@"
-ext pdf, has mupdf, X, flag f = mupdf -- "$@"
-ext pdf, has apvlv, X, flag f = apvlv -- "$@"
-ext pdf, has xpdf, X, flag f = xpdf -- "$@"
-ext pdf, has evince, X, flag f = evince -- "$@"
ext pdf, has okular, X, flag f = okular -- "$@"
-ext pdf, has epdfview, X, flag f = epdfview -- "$@"
ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER"
-ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@"
-ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@"
-ext od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
-ext od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@"
-ext od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@"
+ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
ext djvu, has evince, X, flag f = evince -- "$@"
+#-------------------------------------------
+# Image Viewing:
+#-------------------------------------------
+mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
+
+mime ^image, has feh, X, flag f = feh -- "$@"
+mime ^image, has gimp, X, flag f = gimp -- "$@"
+ext xcf, X, flag f = gimp -- "$@"
+
#-------------------------------------------
# Archives
#-------------------------------------------
#-------------------------------------------
# Misc
#-------------------------------------------
-label wallpaper, number 11, mime ^image, X = feh --bg-scale "$1"
-label wallpaper, number 12, mime ^image, X = feh --bg-tile "$1"
-label wallpaper, number 13, mime ^image, X = feh --bg-center "$1"
-label wallpaper, number 14, mime ^image, X = feh --bg-fill "$1"
+label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1"
+label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1"
+label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1"
+label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
# Define the editor for non-text files + pager as last action
- !mime ^text, !ext xml|csv|tex|py|pl|rb|sh|php = ask
-label editor, !mime ^text, !ext xml|csv|tex|py|pl|rb|sh|php = "$EDITOR" -- "$@"
-label pager, !mime ^text, !ext xml|csv|tex|py|pl|rb|sh|php = "$PAGER" -- "$@"
+ !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
+label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@"
+label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
+
+# The very last action, so that it's never triggered accidentally, is to execute a program:
+mime application/x-executable = "$1"
# 3 | fix width | success. Don't reload when width changes
# 4 | fix height | success. Don't reload when height changes
# 5 | fix both | success. Don't ever reload
+# 6 | image | success. display the image $cached points to as an image preview
+# 7 | image | success. display the file directly as an image
# Meaningful aliases for arguments:
-path="$1" # Full path of the selected file
-width="$2" # Width of the preview pane (number of fitting characters)
-height="$3" # Height of the preview pane (number of fitting characters)
+path="$1" # Full path of the selected file
+width="$2" # Width of the preview pane (number of fitting characters)
+height="$3" # Height of the preview pane (number of fitting characters)
+cached="$4" # Path that should be used to cache image previews
+preview_images="$5" # "True" if image previews are enabled, "False" otherwise.
maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln
# Find out something about the file:
mimetype=$(file --mime-type -Lb "$path")
-extension=${path##*.}
+extension=$(/bin/echo "${path##*.}" | awk '{print tolower($0)}')
# Functions:
# runs a command and saves its output into $output. Useful if you need
# the return value AND want to use the output in a pipe
try() { output=$(eval '"$@"'); }
-# writes the output of the previouosly used "try" command
-dump() { echo "$output"; }
+# writes the output of the previously used "try" command
+dump() { /bin/echo "$output"; }
# a common post-processing function used after most commands
trim() { head -n "$maxln"; }
# wraps highlight to treat exit code 141 (killed by SIGPIPE) as success
-highlight() { command highlight "$@"; test $? = 0 -o $? = 141; }
+safepipe() { "$@"; test $? = 0 -o $? = 141; }
+
+# Image previews, if enabled in ranger.
+if [ "$preview_images" = "True" ]; then
+ case "$mimetype" in
+ # Image previews for SVG files, disabled by default.
+ ###image/svg+xml)
+ ### convert "$path" "$cached" && exit 6 || exit 1;;
+ # Image previews for image files. w3mimgdisplay will be called for all
+ # image files (unless overriden as above), but might fail for
+ # unsupported types.
+ image/*)
+ exit 7;;
+ # Image preview for video, disabled by default.:
+ ###video/*)
+ ### ffmpegthumbnailer -i "$path" -o "$cached" -s 0 && exit 6 || exit 1;;
+ esac
+fi
case "$extension" in
# Archive extensions:
# BitTorrent Files
torrent)
try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;;
+ # ODT Files
+ odt|ods|odp|sxw)
+ try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;;
# HTML Pages:
htm|html|xhtml)
try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; }
case "$mimetype" in
# Syntax highlight for text files:
text/* | */xml)
- try highlight --out-format=ansi "$path" && { dump | trim; exit 5; } || exit 2;;
+ if [ "$(tput colors)" -ge 256 ]; then
+ pygmentize_format=terminal256
+ highlight_format=xterm256
+ else
+ pygmentize_format=terminal
+ highlight_format=ansi
+ fi
+ try safepipe highlight --out-format=${highlight_format} "$path" && { dump | trim; exit 5; }
+ try safepipe pygmentize -f ${pygmentize_format} "$path" && { dump | trim; exit 5; }
+ exit 2;;
# Ascii-previews of images:
- #image/*)
- # img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;;
+ image/*)
+ img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;;
# Display information about media files:
video/* | audio/*)
exiftool "$path" && exit 5
--- /dev/null
+[Socket]
+ListenStream=
+ListenStream=%h/.config/gnupg/S.dirmngr
--- /dev/null
+[Socket]
+ListenStream=
+ListenStream=%h/.config/gnupg/S.gpg-agent.browser
--- /dev/null
+[Socket]
+ListenStream=
+ListenStream=%h/.config/gnupg/S.gpg-agent.extra
--- /dev/null
+[Socket]
+ListenStream=
+ListenStream=%h/.config/gnupg/S.gpg-agent.ssh
--- /dev/null
+[Socket]
+ListenStream=
+ListenStream=%h/.config/gnupg/S.gpg-agent
[Service]
Type=forking
PassEnvironment=SSH_AUTH_SOCK
-ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK
+ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK -t 1h
[Install]
WantedBy=default.target
set -g default-terminal "screen-256color"
-set -g utf8 on
set -g set-titles on
-set -g mouse-utf8 on
set -g mode-keys vi
--- /dev/null
+Subproject commit 5f9e3d9e997c39dbda9c37080ab596733ee52623
--- /dev/null
+Subproject commit e7bd5d2b94d9f4032e058d8a0b8ee3fe8a985b50
UniteResume
endfunction
-nmap <silent> [oq :copen<cr>
-nmap <silent> ]oq :cclose<cr>
-nmap <silent> coq :call <SID>ToggleQuickfixList()<CR>
-nmap <silent> [ol :lopen<cr>
-nmap <silent> ]ol :lclose<cr>
-nmap <silent> col :call <SID>ToggleLocationList()<CR>
+nnoremap <silent> [oq :copen<cr>
+nnoremap <silent> ]oq :cclose<cr>
+nnoremap <silent> coq :call <SID>ToggleQuickfixList()<CR>
+nnoremap <silent> [ol :lopen<cr>
+nnoremap <silent> ]ol :lclose<cr>
+nnoremap <silent> col :call <SID>ToggleLocationList()<CR>
+nnoremap <silent> cop :pclose<CR>
augroup filetypedetect
autocmd! BufNewFile,BufRead PKGBUILD setfiletype PKGBUILD
autocmd! BufRead,BufNewFile *.pro,*.pri setfiletype qmake
+ autocmd! BufNewFile,BufRead *.qml setfiletype qml.javascript
augroup END
augroup ft_ros
--- /dev/null
+" vim:set ft=vim:
+au BufRead,BufNewFile fstab* set filetype=fstab
augroup fswitch
au BufEnter *.h let b:fswitchdst = 'cpp,c'
au BufEnter *.h let b:fswitchlocs = 'reg:|include.*|source|'
- au BufEnter *.cpp let b:fswitchdst = 'h'
+ au BufEnter *.cpp let b:fswitchdst = 'hpp,h'
au BufEnter *.cpp let b:fswitchlocs = 'reg:|source|include/**|'
augroup END
--- /dev/null
+setlocal textwidth=80
+setlocal formatoptions+=awt " auto-format
snippet cmake "CMakeFiles Stub" b
-cmake_minimum_required(VERSION 2.8.11)
+cmake_minimum_required(VERSION 3.5)
project(${1:ProjectName})
-find_package(${2:LIBRARY})
+# find_package(Boost REQUIRED)
-include_directories(
- ${$2_INCLUDE_DIR}
+add_executable(\${PROJECT_NAME}
+ ${1:main.cpp}
)
-add_subdirectory(${0:src})
-
-add_executable($1)
-set_target_properties($1
- PROPERTIES CXX_STANDARD 11
+set_target_properties(\${PROJECT_NAME}
+ PROPERTIES CXX_STANDARD 14
)
-
-target_link_libraries($1
- ${$2_LIBRARIES}
+target_link_libraries(\${PROJECT_NAME}
)
endsnippet
)
foreach(qt5_module ${qt5_modules})
- find_package(${qt5_module} QUIET)
- if(${qt5_module}_FOUND)
-
- else(${qt5_module}_FOUND)
- message(FATAL_ERROR "Qt5 module '${qt5_module}' not found")
- endif()
- endif()
+ find_package(${qt5_module} REQUIRED)
endforeach()
endsnippet
snippet find
find_package(${0:LIBRARY})
-include_dir($0_INCLUDE_DIRS)
-link_directories($0_LIBRARY_DIRS)
endsnippet
snippet glob
endsnippet
snippet lib
-add_library(${1:lib} ${2:STATIC}
+add_library(${1:lib}
${${0:SRCS}}
)
endsnippet
snippet link
-target_link_libraries(${1:bin}
+target_link_libraries(\${PROJECT_NAME}
${0:somelib}
)
endsnippet
endsnippet
snippet props
-set_target_properties(${1:target}
- ${2:PROPERTIES} ${3:COMPILE_FLAGS}
- ${0:"-O3 -Wall -pedantic"}
+set_target_properties(${1:target} ${2:PROPERTIES}
+ ${3:COMPILE_FLAGS} ${0:"-O3 -Wall -pedantic"}
)
endsnippet
" needs editing colorscheme
" Plugin 'jeaye/color_coded'
" Check LucHermites plugins: https://github.com/LucHermitte/lh-cpp
+Plugin 'wincent/loupe'
+Plugin 'Ram-Z/vimwiki'
call vundle#end()
set ttymouse=xterm " type of mouse
" messages and info {{{2
-set showcmd " Show (partial) command in status line.
-set ruler " show the cursor position all the time
-set confirm " Ask what to do when closing unsaved documents
-set shortmess=filnxtoOI " don't show intro message
+set showcmd " Show (partial) command in status line.
+set ruler " show the cursor position all the time
+set confirm " Ask what to do when closing unsaved documents
+set shortmess= " reset option
+set shortmess+=a " all abbreviations
+set shortmess+=o " overwrite file-written message
+set shortmess+=O " file-read message overrides previous
+set shortmess+=t " truncate file message at start
+set shortmess+=T " truncate other messages in the middle
+set shortmess+=W " don't give 'written' or '[w]' when writing a file
+set shortmess+=A " ignore swapfile warning
+set shortmess+=I " no splash screen
" editing text {{{2
set backspace=indent,eol,start " allow backspacing over everything in insert mode
map <F1> :ls<CR>:b<space>
-" move between windows
-nnoremap <C-L> <C-W>w
-nnoremap <C-H> <C-W>W
+" move between windows (skip previewwindow)
+nnoremap <silent> <C-L> <C-W>w:if &previewwindow \| wincmd w \| endif<CR>
+nnoremap <silent> <C-H> <C-W>W:if &previewwindow \| wincmd W \| endif<CR>
"xterm mouse with middleclick paste
nnoremap <MiddleMouse> i<MiddleMouse>
if executable('ag')
" Use ag in unite grep source.
let g:unite_source_grep_command = 'ag'
- let g:unite_source_grep_default_opts = '--smart-case --vimgrep --hidden --ignore ''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr'''
+ let g:unite_source_grep_default_opts = '--smart-case --vimgrep --ignore ''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr'''
let g:unite_source_grep_recursive_opt = ''
end
nnoremap <silent> [unite]a :<C-u>Unite grep:.::\12\17<CR>
" unite-file_rec {{{3
if executable('ag')
" Use ag in unite rec source
- let g:unite_source_rec_async_command = 'ag --follow --nocolor --nogroup --hidden -g ""'
+ let g:unite_source_rec_async_command = ['ag', '--follow', '--nocolor', '--nogroup', '-g', '']
end
nnoremap <silent> [unite]f :<C-u>Unite -start-insert file_rec/async<CR>
call unite#custom#source('file_rec/async', 'sorters', 'sorter_selecta')
omap t <Plug>Sneak_t
omap T <Plug>Sneak_T
+" vimviki {{{2
+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 -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 "<afile>";git commit -m"' . strftime("%FT%R") . '";git push'
+augroup END
+
" functions {{{1
" Convenient command to see the difference between the current buffer and the
-import os
-import shlex
-import subprocess
+from glob import glob
+from os import path
+
import ycm_core
-def FlagsForFile( filename, **kwargs ):
- client_data = kwargs['client_data']
- cwd = client_data['getcwd()']
- # These are the compilation flags that will be used in case there's no
- # compilation database set (by default, one is not set).
- flags = [
- '-Wall',
- # '-Wextra',
- # '-Wshadow',
- # '-Werror',
- # '-Wc++98-compat',
- # '-Wno-long-long',
- # '-Wno-variadic-macros',
- # '-fexceptions',
- # '-DNDEBUG',
- '-std=c++14',
- '-stdlib=libstdc++',
- '-x', 'c++',
- '-I', '.',
- '-I', './include',
- ]
- flags += rospack()
- relative_to = cwd
- final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
- return {
- 'flags': final_flags,
- 'do_cache': True
- }
+def findCompilationDatabaseFolder(dir='.'):
+ dirs = [path.dirname(f) for f in glob(dir + '/**/compile_commands.json',
+ recursive=True)]
+ return dirs
+
+
+def generateQtFlags():
+ flags = []
+ for p in glob('/usr/include/qt/*/'):
+ flags += ['-isystem', p]
+ return flags
-# This function makes it easy to pull in additional flags from rospack
-def rospack():
- cmd = ['rospack', 'cflags-only-I']
- try:
- out = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE).stdout
- except:
- return []
- line = out.readline()[:-1].split(" ")
- includes = []
- for include in line:
- if include.startswith(os.path.expanduser('~')):
- includes += ['-I', include]
- else:
- includes += ['-isystem', include]
- return filter(lambda a: a != ' ', includes)
+def isHeader(filename):
+ ext = path.splitext(filename)[1]
+ return ext in ['.hpp', '.h']
-def DirectoryOfThisScript():
- return os.path.dirname( os.path.abspath( __file__ ) )
-def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
- if not working_directory:
- return list( flags )
- new_flags = []
- make_next_absolute = False
- path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
- for flag in flags:
- new_flag = flag
+def GetCompilationInfoForFile(database, filename):
+ if isHeader(filename):
+ basename = path.splitext(filename)[0]
+ for ext in ['.cpp', '.c']:
+ cpp_file = basename + ext
+ if path.exists(cpp_file):
+ compilation_info = database.GetCompilationInfoForFile(
+ cpp_file)
+ if compilation_info.compiler_flags_:
+ return compilation_info
+ return None
+ return database.GetCompilationInfoForFile(filename)
- if make_next_absolute:
- make_next_absolute = False
- if not flag.startswith( '/' ):
- new_flag = os.path.join( working_directory, flag )
- for path_flag in path_flags:
- if flag == path_flag:
- make_next_absolute = True
- break
+def FlagsForFile(filename, **kwargs):
+ client_data = kwargs['client_data']
+ cwd = client_data['getcwd()']
- if flag.startswith( path_flag ):
- path = flag[ len( path_flag ): ]
- new_flag = path_flag + os.path.join( working_directory, path )
- break
+ extra_flags = [
+ '-Wall',
+ '-Wextra',
+ # '-Wshadow',
+ # '-Werror',
+ # '-Wc++98-compat',
+ # '-Wno-long-long',
+ # '-Wno-variadic-macros',
+ # '-fexceptions',
+ # '-DNDEBUG',
+ ]
- if new_flag:
- new_flags.append( new_flag )
- return new_flags
+ folders = findCompilationDatabaseFolder(cwd)
+ if not folders:
+ folder = None
+ else:
+ folder = folders[0]
+ if len(folders) > 1:
+ print("Multiple compilation databases found!")
+ print(folders)
+ print("Selecting first: %s" % (folder))
+
+ if folder:
+ database = ycm_core.CompilationDatabase(folder)
+ compilation_info = GetCompilationInfoForFile(database, filename)
+ if not compilation_info:
+ return None
+ flags = list(compilation_info.compiler_flags_)
+ else:
+ flags = [
+ '-std=c++14',
+ '-stdlib=libstdc++',
+ '-x', 'c++',
+ '-isystem', '/usr/include',
+ '-isystem', '/usr/local/include',
+ '-I', cwd,
+ '-I', cwd + '/include',
+ ]
+ flags += generateQtFlags()
+ return {
+ 'flags': flags + extra_flags,
+ 'do_cache': True
+ }
weechat.log
script/plugins.xml.gz
irc.conf
+slack.cache
+autoload/
#
# 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"
#
# 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
#
# 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
+timer = 1
[buffer]
perl.highmon.number = "100"
#
# 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
core_to_front = off
detach = 0
detach_buffer_immediately = "highmon"
+detach_buffer_immediately_level = 2
detach_display_window_number = off
detach_displayed_buffers = on
detach_free_content = off
hotlist_counter = on
immune_detach_buffers = ""
indenting = off
+indenting_amount = 2
indenting_number = on
jump_prev_next_visited_buffer = off
mark_inactive = off
#
# 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"
#
# 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 = ""
#
# 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
#
# 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
--- /dev/null
+Subproject commit bdaf2d4886c1da68bb134ece7bbd506cfec51637
+++ /dev/null
-../beep.pl
\ No newline at end of file
+++ /dev/null
-../buffers.pl
\ No newline at end of file
+++ /dev/null
-../highmon.pl
\ No newline at end of file
+++ /dev/null
-../iset.pl
\ No newline at end of file
#
# History:
#
+# 2016-05-01, mumixam <mumixam@gmail.com>:
+# v5.4: added option "detach_buffer_immediately_level"
+# 2015-08-21, Matthew Cox <matthewcpcox@gmail.com>
+# v5.3: add option "indenting_amount", to adjust the indenting of channel buffers
+# 2015-05-02, arza <arza@arza.us>:
+# v5.2: truncate long names (name_size_max) more when mark_inactive adds parenthesis
+# 2015-03-29, Ed Santiago <ed@edsantiago.com>:
+# v5.1: merged buffers: always indent, except when filling is horizontal
# 2014-12-12
# v5.0: fix cropping non-latin buffer names
# 2014-08-29, Patrick Steinhardt <ps@pks.im>:
use Encode qw( decode encode );
# -----------------------------[ internal ]-------------------------------------
my $SCRIPT_NAME = "buffers";
-my $SCRIPT_VERSION = "5.0";
+my $SCRIPT_VERSION = "5.4";
my $BUFFERS_CONFIG_FILE_NAME = "buffers";
my $buffers_config_file;
my $cmd_buffers_whitelist= "buffers_whitelist";
my $cmd_buffers_detach = "buffers_detach";
+my $maxlength;
+
my %mouse_keys = ("\@item(buffers):button1*" => "hsignal:buffers_mouse",
"\@item(buffers):button2*" => "hsignal:buffers_mouse",
"\@bar(buffers):ctrl-wheelup" => "hsignal:buffers_mouse",
"", 0, 0, "on", "on", 0,
"", "", "buffers_signal_config", "", "", ""
],
+ "indenting_amount" => [
+ "indenting_amount", "integer",
+ "amount of indenting to use. This option only takes effect if bar ".
+ "is left/right positioned, and indenting is enabled",
+ "", 0, 16, 2, 2, 0,
+ "", "", "buffers_signal_config", "", "", ""
+ ],
"short_names" => [
"short_names", "boolean",
"display short names (remove text before first \".\" in buffer name)",
],
"detach_buffer_immediately" => [
"detach_buffer_immediately", "string",
- "comma separated list of buffers to detach immediately. A query and ".
- "highlight message will attach buffer again. Allows \"*\" wildcard. ".
+ "comma separated list of buffers to detach immediately. Buffers ".
+ "will attach again based on notify level set in ".
+ "\"detach_buffer_immediately_level\". Allows \"*\" wildcard. ".
"Ex: \"BitlBee,freenode.*\"",
"", 0, 0, "", "", 0,
"", "", "buffers_signal_config_detach_buffer_immediately", "", "", ""
],
+ "detach_buffer_immediately_level" => [
+ "detach_buffer_immediately_level", "integer",
+ "The value determines what notify level messages are reattached from activity. ".
+ " This option works in conjunction with \"detach_buffer_immediately\" ".
+ "0: low priority (like join/part messages), ".
+ "1: message, ".
+ "2: private, ".
+ "3: highlight",
+ "", 0, 3, 2, 2, 0,
+ "", "", "buffers_signal_config", "", "", ""
+ ],
"detach_free_content" => [
"detach_free_content", "boolean",
"buffers with free content will be detached (Ex: iset, chanmon)",
weechat::infolist_free($infolist_channel);
}
- my $result = check_immune_detached_buffers($buffer->{"name"}); # checking for wildcard
-
+ my $result = check_immune_detached_buffers($buffer->{"name"}); # checking for wildcard
+ my $maxlevel = weechat::config_integer($options{"detach_buffer_immediately_level"});
next if ( check_detach_buffer_immediately($buffer->{"name"}) eq 1
and $buffer->{"current_buffer"} eq 0
- and ( not exists $hotlist{$buffer->{"pointer"}} or $hotlist{$buffer->{"pointer"}} < 2) ); # checking for buffer to immediately detach
+ and ( not exists $hotlist{$buffer->{"pointer"}} or $hotlist{$buffer->{"pointer"}} < $maxlevel) ); # checking for buffer to immediately detach
unless ($result)
{
$name = $buffer->{"name"};
}
}
- if (weechat::config_integer($options{"name_size_max"}) >= 1){
- $name = encode("UTF-8", substr(decode("UTF-8", $name), 0, weechat::config_integer($options{"name_size_max"})));
+ if (weechat::config_integer($options{"name_size_max"}) >= 1)
+ {
+ $maxlength = weechat::config_integer($options{"name_size_max"});
+ if($buffer->{"type"} eq "channel" and weechat::config_boolean( $options{"mark_inactive"} ) eq 1 and $buffer->{"nicks_count"} == 0)
+ {
+ $maxlength -= 2;
+ }
+ $name = encode("UTF-8", substr(decode("UTF-8", $name), 0, $maxlength));
}
if ( weechat::config_boolean($options{"core_to_front"}) eq 1)
{
}
else
{
- my $indent = "";
- $indent = ((" " x length($buffer->{"number"}))." ") if (($position eq "left") || ($position eq "right"));
+ # Indentation aligns channels in a visually appealing way
+ # when viewing list top-to-bottom...
+ my $indent = (" " x length($buffer->{"number"}))." ";
+ # ...except when list is top/bottom and channels left-to-right.
+ my $option_pos = weechat::config_string( weechat::config_get( "weechat.bar.buffers.position" ) );
+ if (($option_pos eq 'top') || ($option_pos eq 'bottom')) {
+ my $option_filling = weechat::config_string( weechat::config_get( "weechat.bar.buffers.filling_top_bottom" ) );
+ if ($option_filling =~ /horizontal/) {
+ $indent = '';
+ }
+ }
$str .= weechat::color("default")
.$color_bg
.$indent;
{
if ( weechat::config_integer( $options{"indenting"} ) eq 1 )
{
- $str .= " ";
+ $str .= (" " x weechat::config_integer( $options{"indenting_amount"} ) );
}
elsif ( (weechat::config_integer($options{"indenting"}) eq 2) and (weechat::config_integer($options{"indenting_number"}) eq 0) ) #under_name
{
if ( weechat::config_boolean( $options{"show_number"} ) eq 0 )
{
- $str .= " ";
- }else
+ $str .= (" " x weechat::config_integer( $options{"indenting_amount"} ) );
+ }
+ else
{
- $str .= ( (" " x ( $max_number_digits - length($buffer->{"number"}) ))." " );
+ $str .= ( (" " x ( $max_number_digits - length($buffer->{"number"}) )).(" " x weechat::config_integer( $options{"indenting_amount"} ) ) );
}
}
}
if (weechat::config_integer($options{"name_size_max"}) >= 1) # check max_size of buffer name
{
$name = decode("UTF-8", $name);
- $str .= encode("UTF-8", substr($name, 0, weechat::config_integer($options{"name_size_max"})));
+
+ $maxlength = weechat::config_integer($options{"name_size_max"});
+ if($buffer->{"type"} eq "channel" and weechat::config_boolean( $options{"mark_inactive"} ) eq 1 and $buffer->{"nicks_count"} == 0)
+ {
+ $maxlength -= 2;
+ }
+
+ $str .= encode("UTF-8", substr($name, 0, $maxlength));
$str .= weechat::color(weechat::config_color( $options{"color_number_char"})).weechat::config_string($options{"name_crop_suffix"}) if (length($name) > weechat::config_integer($options{"name_size_max"}));
$str .= add_inactive_parentless($buffer->{"type"}, $buffer->{"nicks_count"});
$str .= add_hotlist_count($buffer->{"pointer"}, %hotlist);
#
# Copyright (C) 2008-2014 Sebastien Helleu <flashcode@flashtux.org>
-# Copyright (C) 2010-2014 Nils Görs <weechatter@arcor.de>
+# Copyright (C) 2010-2015 Nils Görs <weechatter@arcor.de>
#
# 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
#
# History:
#
+# 2016-07-08, nils_2 <weechatter@arcor.de>
+# version 4.2: add diff function
+# 2016-02-06, Sebastien Helleu <flashcode@flashtux.org>:
+# version 4.1: remove debug print
+# 2015-12-24, Sebastien Helleu <flashcode@flashtux.org>:
+# version 4.0: add support of parent options (inherited values in irc servers)
+# with WeeChat >= 1.4
+# 2015-05-16, Sebastien Helleu <flashcode@flashtux.org>:
+# version 3.9: fix cursor position when editing an option with WeeChat >= 1.2
+# 2015-05-02, arza <arza@arza.us>:
+# version 3.8: don't append "null" to /set when setting an undefined setting
+# 2015-05-01, nils_2 <weechatter@arcor.de>:
+# version 3.7: fix two perl warnings (reported by t3chguy)
# 2014-09-30, arza <arza@arza.us>:
# version 3.6: fix current line counter when options aren't found
# 2014-06-03, nils_2 <weechatter@arcor.de>:
use strict;
my $PRGNAME = "iset";
-my $VERSION = "3.6";
+my $VERSION = "4.2";
my $DESCR = "Interactive Set for configuration options";
my $AUTHOR = "Sebastien Helleu <flashcode\@flashtux.org>";
my $LICENSE = "GPL3";
my $wee_version_number = 0;
my @iset_focus = ();
my @options_names = ();
+my @options_parent_names = ();
my @options_types = ();
my @options_values = ();
my @options_default_values = ();
+my @options_parent_values = ();
my @options_is_null = ();
my $option_max_length = 0;
my $current_line = 0;
my $description = "";
my $options_name_copy = "";
my $iset_filter_title = "";
-# search modes: 0 = index() on value, 1 = grep() on value, 2 = grep() on option, 3 = grep on option & value
+# search modes: 0 = index() on value, 1 = grep() on value, 2 = grep() on option, 3 = grep on option & value, 4 = diff all, 5 = diff parts
my $search_mode = 2;
my $search_value = "";
my $help_text_keys = "alt + space: toggle, +/-: increase/decrease, enter: change, ir: reset, iu: unset, v: toggle help bar";
$filter = "*" if ($filter eq "");
$show_filter = $filter;
}
+ elsif ($search_mode == 4 or $search_mode == 5)
+ {
+ $iset_filter_title = "diff: ";
+ $show_filter = "all";
+ $show_filter = $search_value if $search_mode == 5;
+ }
elsif ($search_mode eq 3)
{
$iset_filter_title = "(option) ";
sub iset_buffer_input
{
my ($data, $buffer, $string) = ($_[0], $_[1], $_[2]);
+
+ # string begins with space?
+ return weechat::WEECHAT_RC_OK if (substr($string, 0, 1 ) eq " ");
+
if ($string eq "q")
{
weechat::buffer_close($buffer);
weechat::buffer_set($iset_buffer, "localvar_set_iset_search_value", $search_value);
}
}
+ # show all diff values
+ elsif ($string eq "d")
+ {
+ $search_mode = 4;
+# iset_title();
+ iset_create_filter("*");
+ iset_get_options("*");
+ }
+ elsif ( $array_count >= 2 and $cmd_array[0] eq "d")
+ {
+ $search_mode = 5;
+ $search_value = substr($cmd_array[1], 0); # cut value_search_char
+ $search_value = substr($cmd_array[2], 0) if ( $array_count > 2); # cut value_search_char
+ iset_create_filter($search_value);
+ iset_get_options($search_value);
+
+ }
else
{
$search_mode = 2;
- if ( $array_count >= 2 and $cmd_array[0] ne "f" or $cmd_array[0] ne "s")
+ if ( $array_count >= 2 and $cmd_array[0] ne "f" or $cmd_array[0] ne "s" )
{
if ( defined $cmd_array[1] and substr($cmd_array[1], 0, 1) eq weechat::config_string($options_iset{"value_search_char"})
or defined $cmd_array[2] and substr($cmd_array[2], 0, 1) eq weechat::config_string($options_iset{"value_search_char"}) )
{
iset_create_filter($string);
iset_get_options($search_value);
- }else
+ }
+ else
{
iset_create_filter($string);
iset_get_options("");
$search_value = $var_value;
@iset_focus = ();
@options_names = ();
+ @options_parent_names = ();
@options_types = ();
@options_values = ();
@options_default_values = ();
+ @options_parent_values = ();
@options_is_null = ();
$option_max_length = 0;
my %options_internal = ();
{
$key = sprintf("%08d", $i);
my $name = weechat::infolist_string($infolist, "full_name");
+ my $parent_name = weechat::infolist_string($infolist, "parent_name");
next if (weechat::config_boolean($options_iset{"show_plugin_description"}) == 0 and index ($name, "plugins.desc.") != -1);
my $type = weechat::infolist_string($infolist, "type");
my $value = weechat::infolist_string($infolist, "value");
my $default_value = weechat::infolist_string($infolist, "default_value");
+ my $parent_value;
+ if ($parent_name && (($wee_version_number < 0x00040300) || (weechat::infolist_search_var($infolist, "parent_value"))))
+ {
+ $parent_value = weechat::infolist_string($infolist, "parent_value");
+ }
my $is_null = weechat::infolist_integer($infolist, "value_is_null");
+
if ($search_mode == 3)
{
my $value = weechat::infolist_string($infolist, "value");
if ( grep /\Q$var_value/,lc($value) )
{
+ $options_internal{$name}{"parent_name"} = $parent_name;
$options_internal{$name}{"type"} = $type;
$options_internal{$name}{"value"} = $value;
$options_internal{$name}{"default_value"} = $default_value;
+ $options_internal{$name}{"parent_value"} = $parent_value;
$options_internal{$name}{"is_null"} = $is_null;
$option_max_length = length($name) if (length($name) > $option_max_length);
- $iset_struct{$key} = $options_internal{$name};
- push(@iset_focus, $iset_struct{$key});
+ $iset_struct{$key} = $options_internal{$name};
+ push(@iset_focus, $iset_struct{$key});
+ }
+ }
+ # search for diff?
+ elsif ( $search_mode == 4 or $search_mode == 5)
+ {
+ if ($value ne $default_value )
+ {
+ $options_internal{$name}{"parent_name"} = $parent_name;
+ $options_internal{$name}{"type"} = $type;
+ $options_internal{$name}{"value"} = $value;
+ $options_internal{$name}{"default_value"} = $default_value;
+ $options_internal{$name}{"parent_value"} = $parent_value;
+ $options_internal{$name}{"is_null"} = $is_null;
+ $option_max_length = length($name) if (length($name) > $option_max_length);
+ $iset_struct{$key} = $options_internal{$name};
+ push(@iset_focus, $iset_struct{$key});
}
}
else
{
+ $options_internal{$name}{"parent_name"} = $parent_name;
$options_internal{$name}{"type"} = $type;
$options_internal{$name}{"value"} = $value;
$options_internal{$name}{"default_value"} = $default_value;
+ $options_internal{$name}{"parent_value"} = $parent_value;
$options_internal{$name}{"is_null"} = $is_null;
$option_max_length = length($name) if (length($name) > $option_max_length);
- $iset_struct{$key} = $options_internal{$name};
- push(@iset_focus, $iset_struct{$key});
+ $iset_struct{$key} = $options_internal{$name};
+ push(@iset_focus, $iset_struct{$key});
}
$i++;
}
foreach my $name (sort keys %options_internal)
{
push(@options_names, $name);
+ push(@options_parent_names, $options_internal{$name}{"parent_name"});
push(@options_types, $options_internal{$name}{"type"});
push(@options_values, $options_internal{$name}{"value"});
push(@options_default_values, $options_internal{$name}{"default_value"});
+ push(@options_parent_values, $options_internal{$name}{"parent_value"});
push(@options_is_null, $options_internal{$name}{"is_null"});
}
}
{
my ($var_value,$search_mode) = ($_[0],$_[1]);
@options_names = ();
+ @options_parent_names = ();
@options_types = ();
@options_values = ();
@options_default_values = ();
+ @options_parent_values = ();
@options_is_null = ();
$option_max_length = 0;
my %options_internal = ();
while (weechat::infolist_next($infolist))
{
my $name = weechat::infolist_string($infolist, "full_name");
+ my $parent_name = weechat::infolist_string($infolist, "parent_name");
next if (weechat::config_boolean($options_iset{"show_plugin_description"}) == 0 and index ($name, "plugins.desc.") != -1);
my $type = weechat::infolist_string($infolist, "type");
my $is_null = weechat::infolist_integer($infolist, "value_is_null");
my $value = weechat::infolist_string($infolist, "value");
my $default_value = weechat::infolist_string($infolist, "default_value");
+ my $parent_value;
+ if ($parent_name && (($wee_version_number < 0x00040300) || (weechat::infolist_search_var($infolist, "parent_value"))))
+ {
+ $parent_value = weechat::infolist_string($infolist, "parent_value");
+ }
if ($search_mode)
{
if ( grep /\Q$var_value/,lc($value) )
{
+ $options_internal{$name}{"parent_name"} = $parent_name;
$options_internal{$name}{"type"} = $type;
$options_internal{$name}{"value"} = $value;
$options_internal{$name}{"default_value"} = $default_value;
+ $options_internal{$name}{"parent_value"} = $parent_value;
$options_internal{$name}{"is_null"} = $is_null;
$option_max_length = length($name) if (length($name) > $option_max_length);
}
# if ($value =~ /\Q$var_value/si)
if (lc($value) eq $var_value)
{
+ $options_internal{$name}{"parent_name"} = $parent_name;
$options_internal{$name}{"type"} = $type;
$options_internal{$name}{"value"} = $value;
$options_internal{$name}{"default_value"} = $default_value;
+ $options_internal{$name}{"parent_value"} = $parent_value;
$options_internal{$name}{"is_null"} = $is_null;
$option_max_length = length($name) if (length($name) > $option_max_length);
}
foreach my $name (sort keys %options_internal)
{
push(@options_names, $name);
+ push(@options_parent_names, $options_internal{$name}{"parent_name"});
push(@options_types, $options_internal{$name}{"type"});
push(@options_values, $options_internal{$name}{"value"});
push(@options_default_values, $options_internal{$name}{"default_value"});
+ push(@options_parent_values, $options_internal{$name}{"parent_value"});
push(@options_is_null, $options_internal{$name}{"is_null"});
}
}
my $color1 = weechat::color(weechat::config_color($options_iset{"color_option"}));
my $color2 = weechat::color(weechat::config_color($options_iset{"color_type"}));
my $color3 = "";
+ my $color4 = "";
if ($options_is_null[$y])
{
$color3 = weechat::color(weechat::config_color($options_iset{"color_value_undef"}));
+ $color4 = weechat::color(weechat::config_color($options_iset{"color_value"}));
}
elsif ($options_values[$y] ne $options_default_values[$y])
{
if ($options_is_null[$y])
{
$color3 = weechat::color(weechat::config_color($options_iset{"color_value_undef_selected"}).",".weechat::config_color($options_iset{"color_bg_selected"}));
+ $color4 = weechat::color(weechat::config_color($options_iset{"color_value_selected"}).",".weechat::config_color($options_iset{"color_bg_selected"}));
}
elsif ($options_values[$y] ne $options_default_values[$y])
{
}
}
my $value = $options_values[$y];
- $value = "(undef)" if ($options_is_null[$y]);
+ if ($options_is_null[$y])
+ {
+ $value = "null";
+ if ($options_parent_names[$y])
+ {
+ if (defined $options_parent_values[$y])
+ {
+ my $around_parent = "";
+ $around_parent = "\"" if ($options_types[$y] eq "string");
+ $value .= $color1." -> ".$color4.$around_parent.$options_parent_values[$y].$around_parent;
+ }
+ else
+ {
+ $value .= $color1." -> ".$color3."null";
+ }
+ }
+ }
my $strline = sprintf($format,
$color1, $options_names[$y], $padding,
$color2, $options_types[$y],
return -1;
}
+sub iset_refresh_option
+{
+ my $option_name = $_[0];
+ my $index = $_[1];
+ my $infolist = weechat::infolist_get("option", "", $option_name);
+ if ($infolist)
+ {
+ weechat::infolist_next($infolist);
+ if (weechat::infolist_fields($infolist))
+ {
+ $options_parent_names[$index] = weechat::infolist_string($infolist, "parent_name");
+ $options_types[$index] = weechat::infolist_string($infolist, "type");
+ $options_values[$index] = weechat::infolist_string($infolist, "value");
+ $options_default_values[$index] = weechat::infolist_string($infolist, "default_value");
+ $options_is_null[$index] = weechat::infolist_integer($infolist, "value_is_null");
+ $options_parent_values[$index] = undef;
+ if ($options_parent_names[$index]
+ && (($wee_version_number < 0x00040300) || (weechat::infolist_search_var($infolist, "parent_value"))))
+ {
+ $options_parent_values[$index] = weechat::infolist_string($infolist, "parent_value");
+ }
+ iset_refresh_line($index);
+ iset_title() if ($option_name eq "iset.look.show_current_line");
+ }
+ else
+ {
+ iset_full_refresh(1); # if not found, refresh fully without clearing buffer
+ weechat::print_y($iset_buffer, $#options_names + 1, "");
+ }
+ weechat::infolist_free($infolist);
+ }
+}
+
sub iset_config_cb
{
my ($data, $option_name, $value) = ($_[0], $_[1], $_[2]);
if ($index >= 0)
{
# refresh info about changed option
- my $infolist = weechat::infolist_get("option", "", $option_name);
- if ($infolist)
+ iset_refresh_option($option_name, $index);
+ # refresh any other option having this changed option as parent
+ foreach my $i (0 .. $#options_names)
{
- weechat::infolist_next($infolist);
- if (weechat::infolist_fields($infolist))
- {
- $options_types[$index] = weechat::infolist_string($infolist, "type");
- $options_values[$index] = weechat::infolist_string($infolist, "value");
- $options_default_values[$index] = weechat::infolist_string($infolist, "default_value");
- $options_is_null[$index] = weechat::infolist_integer($infolist, "value_is_null");
- iset_refresh_line($index);
- iset_title() if ($option_name eq "iset.look.show_current_line");
- }
- else
+ if ($options_parent_names[$i] eq $option_name)
{
- iset_full_refresh(1); # if not found, refresh fully without clearing buffer
- weechat::print_y($iset_buffer, $#options_names + 1, "");
+ iset_refresh_option($options_names[$i], $i);
}
- weechat::infolist_free($infolist);
}
}
else
{
# f/s option =value
# option =value
- $search_mode = 2;
+ $search_mode = 2; # grep on option
if ( $array_count >= 2 and $cmd_array[0] ne "f" or $cmd_array[0] ne "s")
{
if ( defined $cmd_array[1] and substr($cmd_array[1], 0, 1) eq weechat::config_string($options_iset{"value_search_char"})
or defined $cmd_array[2] and substr($cmd_array[2], 0, 1) eq weechat::config_string($options_iset{"value_search_char"}) )
{
- $search_mode = 3;
+ $search_mode = 3; # grep on option and value
$search_value = substr($cmd_array[1], 1); # cut value_search_char
$search_value = substr($cmd_array[2], 1) if ( $array_count > 2); # cut value_search_char
}
}
+
+ # show all diff values
+ if ( $args eq "d")
+ {
+ $search_mode = 4;
+ $search_value = "*";
+ $args = $search_value;
+ }
+ if ( $array_count >= 2 and $cmd_array[0] eq "d")
+ {
+ $search_mode = 5;
+ $search_value = substr($cmd_array[1], 0); # cut value_search_char
+ $search_value = substr($cmd_array[2], 0) if ( $array_count > 2); # cut value_search_char
+ $args = $search_value;
+ }
+
iset_create_filter($args);
$filter_set = 1;
my $ptrbuf = weechat::buffer_search($LANG, $PRGNAME);
+
if ($ptrbuf eq "")
{
iset_init();
my $value = $options_values[$current_line];
if ($options_is_null[$current_line])
{
- $value = "null";
+ $value = "";
}
else
{
$quote = "\"" if ($options_types[$current_line] eq "string");
}
+ $value = " ".$quote.$value.$quote if ($value ne "" or $quote ne "");
+
my $set_command = "/set";
- $set_command = "/mute " . $set_command if (weechat::config_boolean($options_iset{"use_mute"}) == 1);
-
- weechat::buffer_set($iset_buffer, "input", $set_command." ".$options_names[$current_line]." ".$quote.$value.$quote);
- weechat::command($iset_buffer, "/input move_beginning_of_line");
- weechat::command($iset_buffer, "/input move_next_word");
- weechat::command($iset_buffer, "/input move_next_word");
- weechat::command($iset_buffer, "/input move_next_word") if (weechat::config_boolean($options_iset{"use_mute"}) == 1);
- weechat::command($iset_buffer, "/input move_next_char");
- weechat::command($iset_buffer, "/input move_next_char") if ($quote ne "");
+ my $start_index = 5;
+ if (weechat::config_boolean($options_iset{"use_mute"}) == 1)
+ {
+ $set_command = "/mute ".$set_command;
+ $start_index += 11;
+ }
+ $set_command = $set_command." ".$options_names[$current_line].$value;
+ my $pos_space = index($set_command, " ", $start_index);
+ if ($pos_space < 0)
+ {
+ $pos_space = 9999;
+ }
+ else
+ {
+ $pos_space = $pos_space + 1;
+ $pos_space = $pos_space + 1 if ($quote ne "");
+ }
+ weechat::buffer_set($iset_buffer, "input", $set_command);
+ weechat::buffer_set($iset_buffer, "input_pos", "".$pos_space);
}
}
weechat::bar_item_update("isetbar_help") if (weechat::config_boolean($options_iset{"show_help_bar"}) == 1);
{
my ($data, $signal, %hash) = ($_[0], $_[1], %{$_[2]});
+ return weechat::WEECHAT_RC_OK unless (@options_types);
+
if ($hash{"_buffer_name"} eq $PRGNAME && ($hash{"_buffer_plugin"} eq $LANG))
{
if ($hash{"_key"} eq "button1")
iset_config_init();
iset_config_read();
-weechat::hook_command($PRGNAME, "Interactive set", "f <file> || s <section> || [=][=]<text>",
+weechat::hook_command($PRGNAME, "Interactive set", "d <text> || f <file> || s <section> || [=][=]<text>",
+ "d <text> : show only changed options\n".
"f file : show options for a file\n".
"s section: show options for a section\n".
"text : show options with 'text' in name\n".
"text,enter : set a new filter using command line (use '*' to see all options)\n".
"alt+'v' : toggle help bar on/off\n".
"alt+'p' : toggle option \"show_plugin_description\" on/off\n".
+ "q : as input in iset buffer to close it\n".
"\n".
"Mouse actions:\n".
"wheel up/down : move cursor up/down\n".
"right button + drag left/right: increase/decrease value (for integer or color)\n".
"\n".
"Examples:\n".
- " show options for file 'weechat'\n".
- " /iset f weechat\n".
+ " show changed options in 'aspell' plugin\n".
+ " /iset d aspell\n".
" show options for file 'irc'\n".
" /iset f irc\n".
" show options for section 'look'\n".
#
# 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"
guile.check_license = "off"
lua.check_license = "off"
+lua.matrix.autojoin_on_invite = "on"
+lua.matrix.backlog_lines = "120"
+lua.matrix.debug = "off"
+lua.matrix.encrypted_message_color = "lightgreen"
+lua.matrix.homeserver_url = "https://matrix.org/"
+lua.matrix.local_echo = "on"
+lua.matrix.password = ""
+lua.matrix.typing_notices = "on"
+lua.matrix.user = ""
perl.beep.beep_command_dcc = "$bell"
perl.beep.beep_command_highlight = "$bell"
perl.beep.beep_command_pv = "$bell"
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"
+python.slack_extension.colorize_messages = "0"
+python.slack_extension.colorize_nicks = "1"
+python.slack_extension.colorize_private_chats = "0"
+python.slack_extension.debug_mode = ""
+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}"
+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]
+lua.matrix.autojoin_on_invite = "Automatically join rooms you are invited to (default: "on")"
+lua.matrix.backlog_lines = "Number of lines to fetch from backlog upon connecting (default: "120")"
+lua.matrix.debug = "Print a lot of extra information to help with finding bugs and other problems. (default: "off")"
+lua.matrix.encrypted_message_color = "Print encrypted mesages with this color (default: "lightgreen")"
+lua.matrix.homeserver_url = "Full URL including port to your homeserver (including trailing slash) or use default matrix.org (default: "https://matrix.org/")"
+lua.matrix.local_echo = "Print lines locally instead of waiting for return from server (default: "on")"
+lua.matrix.password = "Your homeserver password (default: "")"
+lua.matrix.typing_notices = "Send typing notices when you type (default: "on")"
+lua.matrix.user = "Your homeserver username (default: "")"
perl.beep.beep_command_dcc = "command for beep on dcc, special value "$bell" is allowed, as well as "$bell;command" (default: "$bell")"
perl.beep.beep_command_highlight = "command for beep on highlight, special value "$bell" is allowed, as well as "$bell;command" (default: "$bell")"
perl.beep.beep_command_pv = "command for beep on private message, special value "$bell" is allowed, as well as "$bell;command" (default: "$bell")"
+++ /dev/null
-../allquery.py
\ No newline at end of file
+++ /dev/null
-../buffer_autoset.py
\ No newline at end of file
+++ /dev/null
-../grep.py
\ No newline at end of file
+++ /dev/null
-../screen_away.py
\ No newline at end of file
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2010-2012 Sebastien Helleu <flashcode@flashtux.org>
+# Copyright (C) 2010-2015 Sébastien Helleu <flashcode@flashtux.org>
#
# 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
#
# Auto-set buffer properties when a buffer is opened.
-# (this script requires WeeChat 0.3.2 or newer)
+# (this script requires WeeChat 1.0 or newer)
#
# History:
#
+# 2015-09-28, Simmo Saan <simmo.saan@gmail.com>:
+# version 0.9: instantly apply properties
+# 2015-07-12, Sébastien Helleu <flashcode@flashtux.org>:
+# version 0.8: add option buffer_autoset.look.timer to add a small timer
+# before setting buffer properties
+# 2015-04-05, Nils Görs <freenode@#weechat>:
+# version 0.7: increase priority of hook_signal('buffer_opened')
# 2012-12-09, Nils Görs <freenode@#weechat>:
# version 0.6: add support of core buffer
-# 2012-03-09, Sebastien Helleu <flashcode@flashtux.org>:
+# 2012-03-09, Sébastien Helleu <flashcode@flashtux.org>:
# version 0.5: fix reload of config file
-# 2012-01-03, Sebastien Helleu <flashcode@flashtux.org>:
+# 2012-01-03, Sébastien Helleu <flashcode@flashtux.org>:
# version 0.4: make script compatible with Python 3.x
-# 2010-12-02, Sebastien Helleu <flashcode@flashtux.org>:
+# 2010-12-02, Sébastien Helleu <flashcode@flashtux.org>:
# version 0.3: "no_highlight_nicks" replaced by "hotlist_max_level_nicks"
-# 2010-10-11, Sebastien Helleu <flashcode@flashtux.org>:
+# 2010-10-11, Sébastien Helleu <flashcode@flashtux.org>:
# version 0.2: add example in /help autosetbuffer with new buffer
# property "no_highlight_nicks"
-# 2010-04-19, Sebastien Helleu <flashcode@flashtux.org>:
+# 2010-04-19, Sébastien Helleu <flashcode@flashtux.org>:
# version 0.1: initial release
#
-SCRIPT_NAME = "buffer_autoset"
-SCRIPT_AUTHOR = "Sebastien Helleu <flashcode@flashtux.org>"
-SCRIPT_VERSION = "0.6"
+SCRIPT_NAME = "buffer_autoset"
+SCRIPT_AUTHOR = "Sébastien Helleu <flashcode@flashtux.org>"
+SCRIPT_VERSION = "0.9"
SCRIPT_LICENSE = "GPL3"
-SCRIPT_DESC = "Auto-set buffer properties when a buffer is opened"
+SCRIPT_DESC = "Auto-set buffer properties when a buffer is opened"
SCRIPT_COMMAND = "autosetbuffer"
CONFIG_FILE_NAME = "buffer_autoset"
-# config file
+# config file / options
bas_config_file = ""
+bas_options = {}
+
# =================================[ config ]=================================
Initialization of configuration file.
Sections: buffer.
"""
- global bas_config_file
+ global bas_config_file, bas_options
bas_config_file = weechat.config_new(CONFIG_FILE_NAME,
"bas_config_reload_cb", "")
if bas_config_file == "":
return
+ # section "look"
+ section_look = weechat.config_new_section(
+ bas_config_file, "look", 0, 0, "", "", "", "", "", "", "", "", "", "")
+ if not section_look:
+ weechat.config_free(bas_config_file)
+ return
+
+ # options in section "look"
+ bas_options["look_timer"] = weechat.config_new_option(
+ bas_config_file, section_look, "timer", "integer",
+ "Timer used to delay the set of properties (in milliseconds, "
+ "0 = don't use a timer)",
+ "", 0, 2147483647, "1", "1", 0, "", "", "", "", "", "")
+
+ bas_options["look_instant"] = weechat.config_new_option(
+ bas_config_file, section_look, "instant", "boolean",
+ "Instantly apply properties to buffers affected",
+ "", 0, 0, "on", "on", 0, "", "", "", "", "", "")
+
# section "buffer"
section_buffer = weechat.config_new_section(
bas_config_file, "buffer", 1, 1, "", "", "", "", "", "",
"bas_config_buffer_create_option_cb", "", "", "")
- if section_buffer == "":
+ if not section_buffer:
weechat.config_free(bas_config_file)
return
-def bas_config_buffer_create_option_cb(data, config_file, section, option_name, value):
+
+def bas_config_buffer_create_option_cb(data, config_file, section, option_name,
+ value):
option = weechat.config_search_option(config_file, section, option_name)
if option:
- return weechat.config_option_set (option, value, 1)
+ return weechat.config_option_set(option, value, 1)
else:
- option = weechat.config_new_option (config_file, section, option_name, "string",
- "", "", 0, 0, "", value, 0,
- "", "", "", "", "", "")
+ option = weechat.config_new_option(config_file, section, option_name,
+ "string", "", "", 0, 0, "",
+ value, 0, "", "", "", "", "", "")
if not option:
return weechat.WEECHAT_CONFIG_OPTION_SET_ERROR
return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE
+
def bas_config_reload_cb(data, config_file):
- """ Reload configuration file. """
+ """Reload configuration file."""
return weechat.config_reload(config_file)
+
def bas_config_read():
- """ Read configuration file. """
+ """Read configuration file."""
global bas_config_file
return weechat.config_read(bas_config_file)
+
def bas_config_write():
- """ Write configuration file. """
+ """Write configuration file."""
global bas_config_file
return weechat.config_write(bas_config_file)
+
# ================================[ command ]=================================
def bas_cmd(data, buffer, args):
- """ Callback for /autosetbuffer command. """
+ """Callback for /autosetbuffer command."""
args = args.strip()
if args == "":
weechat.command("", "/set %s.buffer.*" % CONFIG_FILE_NAME)
return weechat.WEECHAT_RC_OK
return weechat.WEECHAT_RC_OK
-def bas_completion_current_buffer_cb(data, completion_item, buffer, completion):
- """ Complete with current buffer name (plugin.name), for command '/autosetbuffer'. """
+
+def bas_completion_current_buffer_cb(data, completion_item, buffer,
+ completion):
+ """
+ Complete with current buffer name (plugin.name),
+ for command '/autosetbuffer'.
+ """
name = "%s.%s" % (weechat.buffer_get_string(buffer, "plugin"),
weechat.buffer_get_string(buffer, "name"))
weechat.hook_completion_list_add(completion, name,
0, weechat.WEECHAT_LIST_POS_BEGINNING)
return weechat.WEECHAT_RC_OK
+
def bas_completion_options_cb(data, completion_item, buffer, completion):
- """ Complete with config options, for command '/autosetbuffer'. """
- options = weechat.infolist_get("option", "", "%s.buffer.*" % CONFIG_FILE_NAME)
+ """Complete with config options, for command '/autosetbuffer'."""
+ options = weechat.infolist_get("option", "",
+ "%s.buffer.*" % CONFIG_FILE_NAME)
if options:
while weechat.infolist_next(options):
- weechat.hook_completion_list_add(completion,
- weechat.infolist_string(options, "option_name"),
- 0, weechat.WEECHAT_LIST_POS_SORT)
+ weechat.hook_completion_list_add(
+ completion,
+ weechat.infolist_string(options, "option_name"),
+ 0, weechat.WEECHAT_LIST_POS_SORT)
weechat.infolist_free(options)
return weechat.WEECHAT_RC_OK
-# =================================[ signal ]=================================
+
+# ==========================[ timer/signal/option ]===========================
+
+def bas_apply_options_for_buffer(buffer):
+ full_name = weechat.buffer_get_string(buffer, "full_name")
+ options = weechat.infolist_get("option", "",
+ "%s.buffer.*" % CONFIG_FILE_NAME)
+ if not options:
+ return
+
+ while weechat.infolist_next(options):
+ option = weechat.infolist_string(options, "option_name")
+ value = weechat.infolist_string(options, "value")
+ if option:
+ pos = option.rfind(".")
+ if pos > 0:
+ buffer_mask = option[0:pos]
+ property = option[pos+1:]
+ if buffer_mask and property:
+ if weechat.string_match(full_name, buffer_mask, 1):
+ weechat.buffer_set(buffer, property, value)
+
+ weechat.infolist_free(options)
+
+
+def bas_timer_buffer_opened_cb(data, remaining_calls):
+ full_name = data
+ buffer = weechat.buffer_search("==", full_name)
+ if not buffer:
+ return weechat.WEECHAT_RC_OK
+ bas_apply_options_for_buffer(buffer)
+ return weechat.WEECHAT_RC_OK
+
def bas_signal_buffer_opened_cb(data, signal, signal_data):
+ global bas_options
buffer = signal_data
- name = "%s.%s" % (weechat.buffer_get_string(buffer, "plugin"),
- weechat.buffer_get_string(buffer, "name"))
- options = weechat.infolist_get("option", "", "%s.buffer.*" % CONFIG_FILE_NAME)
- if options:
- while weechat.infolist_next(options):
- option = weechat.infolist_string(options, "option_name")
- value = weechat.infolist_string(options, "value")
- if option:
- pos = option.rfind(".")
- if pos > 0:
- buffer_mask = option[0:pos]
- property = option[pos+1:]
- if buffer_mask and property:
- if weechat.string_match(name, buffer_mask, 1):
- weechat.buffer_set(buffer, property, value)
- weechat.infolist_free(options)
+ timer = weechat.config_integer(bas_options["look_timer"])
+ if timer == 0:
+ bas_apply_options_for_buffer(buffer)
+ else:
+ weechat.hook_timer(timer, 0, 1,
+ "bas_timer_buffer_opened_cb",
+ weechat.buffer_get_string(buffer, "full_name"))
+ return weechat.WEECHAT_RC_OK
+
+def bas_config_option_cb(data, option, value):
+ if not weechat.config_boolean(bas_options["look_instant"]):
+ return weechat.WEECHAT_RC_OK
+
+ if not weechat.config_get(option): # option was deleted
+ return weechat.WEECHAT_RC_OK
+
+ option = option[len("%s.buffer." % CONFIG_FILE_NAME):]
+
+ pos = option.rfind(".")
+ if pos > 0:
+ buffer_mask = option[0:pos]
+ property = option[pos+1:]
+ if buffer_mask and property:
+ buffers = weechat.infolist_get("buffer", "", buffer_mask)
+
+ if not buffers:
+ return weechat.WEECHAT_RC_OK
+
+ while weechat.infolist_next(buffers):
+ buffer = weechat.infolist_pointer(buffers, "pointer")
+ weechat.buffer_set(buffer, property, value)
+
+ weechat.infolist_free(buffers)
+
return weechat.WEECHAT_RC_OK
# ==================================[ main ]==================================
if __name__ == "__main__" and import_ok:
- if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
- SCRIPT_DESC, "bas_unload_script", ""):
+ if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
+ SCRIPT_LICENSE, SCRIPT_DESC, "bas_unload_script", ""):
version = weechat.info_get("version_number", "") or 0
- if int(version) < 0x00030200:
- weechat.prnt("", "%s%s: WeeChat 0.3.2 is required for this script."
+ if int(version) < 0x01000000:
+ weechat.prnt("", "%s%s: WeeChat 1.0 is required for this script."
% (weechat.prefix("error"), SCRIPT_NAME))
else:
bas_config_init()
bas_config_read()
- weechat.hook_command(SCRIPT_COMMAND,
- "Auto-set buffer properties when a buffer is opened",
- "[add buffer property value] | [del option]",
- " add: add a buffer/property/value in configuration file\n"
- " del: delete an option from configuration file\n"
- " buffer: name of a buffer (can start or end with \"*\" as wildcard)\n"
- "property: buffer property\n"
- " value: value for property\n"
- " option: name of option from configuration file\n\n"
- "Examples:\n"
- " disable timestamp on channel #weechat:\n"
- " /" + SCRIPT_COMMAND + " add irc.freenode.#weechat time_for_each_line 0\n"
- " add word \"weechat\" in highlight list on channel #savannah:\n"
- " /" + SCRIPT_COMMAND + " add irc.freenode.#savannah highlight_words_add weechat\n"
- " disable highlights from nick \"mike\" on freenode server, channel #weechat (requires WeeChat >= 0.3.4):\n"
- " /" + SCRIPT_COMMAND + " add irc.freenode.#weechat hotlist_max_level_nicks_add mike:2\n"
- " disable hotlist changes for nick \"bot\" on freenode server (all channels) (requires WeeChat >= 0.3.4):\n"
- " /" + SCRIPT_COMMAND + " add irc.freenode.* hotlist_max_level_nicks_add bot:-1",
- "add %(buffers_plugins_names)|%(buffer_autoset_current_buffer) %(buffer_properties_set)"
- " || del %(buffer_autoset_options)",
- "bas_cmd", "")
- weechat.hook_completion("buffer_autoset_current_buffer", "current buffer name for buffer_autoset",
- "bas_completion_current_buffer_cb", "")
- weechat.hook_completion("buffer_autoset_options", "list of options for buffer_autoset",
- "bas_completion_options_cb", "")
- weechat.hook_signal("buffer_opened", "bas_signal_buffer_opened_cb", "")
+ weechat.hook_command(
+ SCRIPT_COMMAND,
+ "Auto-set buffer properties when a buffer is opened",
+ "[add buffer property value] | [del option]",
+ " add: add a buffer/property/value in configuration file\n"
+ " del: delete an option from configuration file\n"
+ " buffer: name of a buffer (can start or end with \"*\" as "
+ "wildcard)\n"
+ "property: buffer property\n"
+ " value: value for property\n"
+ " option: name of option from configuration file\n\n"
+ "Examples:\n"
+ " disable timestamp on channel #weechat:\n"
+ " /" + SCRIPT_COMMAND + " add irc.freenode.#weechat "
+ "time_for_each_line 0\n"
+ " add word \"weechat\" in highlight list on channel "
+ "#savannah:\n"
+ " /" + SCRIPT_COMMAND + " add irc.freenode.#savannah "
+ "highlight_words_add weechat\n"
+ " disable highlights from nick \"mike\" on freenode server, "
+ "channel #weechat (requires WeeChat >= 0.3.4):\n"
+ " /" + SCRIPT_COMMAND + " add irc.freenode.#weechat "
+ "hotlist_max_level_nicks_add mike:2\n"
+ " disable hotlist changes for nick \"bot\" on freenode "
+ "server (all channels) (requires WeeChat >= 0.3.4):\n"
+ " /" + SCRIPT_COMMAND + " add irc.freenode.* "
+ "hotlist_max_level_nicks_add bot:-1",
+ "add %(buffers_plugins_names)|"
+ "%(buffer_autoset_current_buffer) "
+ "%(buffer_properties_set)"
+ " || del %(buffer_autoset_options)",
+ "bas_cmd", "")
+ weechat.hook_completion(
+ "buffer_autoset_current_buffer",
+ "current buffer name for buffer_autoset",
+ "bas_completion_current_buffer_cb", "")
+ weechat.hook_completion(
+ "buffer_autoset_options",
+ "list of options for buffer_autoset",
+ "bas_completion_options_cb", "")
+ weechat.hook_signal("9000|buffer_opened",
+ "bas_signal_buffer_opened_cb", "")
+ weechat.hook_config("%s.buffer.*" % CONFIG_FILE_NAME,
+ "bas_config_option_cb", "")
# core buffer is already open on script startup, check manually!
bas_signal_buffer_opened_cb("", "", weechat.buffer_search_main())
+
+
# ==================================[ end ]===================================
def bas_unload_script():
#
# History:
#
+# 2016-06-23, mickael9
+# version 0.7.7: fix get_home function
+#
+# 2015-11-26
+# version 0.7.6: fix a typo
+#
# 2015-01-31, Nicd-
# version 0.7.5:
# '~' is now expaned to the home directory in the log file path so
SCRIPT_NAME = "grep"
SCRIPT_AUTHOR = "Elián Hanisch <lambdae2@gmail.com>"
-SCRIPT_VERSION = "0.7.5"
+SCRIPT_VERSION = "0.7.7"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = "Search in buffers and logs"
SCRIPT_COMMAND = "grep"
def get_home():
home = weechat.config_string(weechat.config_get('logger.file.path'))
+ home = home.replace('%h', weechat.info_get('weechat_dir', ''))
home = path.abspath(path.expanduser(home))
- return home.replace('%h', weechat.info_get('weechat_dir', ''))
+ return home
def strip_home(s, dir=''):
"""Strips home dir from the begging of the log path, this makes them sorter."""
If used with 'log <file>' search in all logs that matches <file>.
-b --buffer: Search only in buffers, not in file logs.
-c --count: Just count the number of matched lines instead of showing them.
- -m --matchcase: Don't do case insensible search.
+ -m --matchcase: Don't do case insensitive search.
-H --hilight: Colour exact matches in output buffer.
-o --only-match: Print only the matching part of the line (unique matches).
-v -i --invert: Print lines that don't match the regular expression.
--- /dev/null
+Subproject commit 01beb42fec5c6dbfc0d8c53ce1de88b48b48f6db
#
# 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
text_selected = white
[network]
+allow_empty_password = off
allowed_ips = ""
bind_address = ""
clients_purge_delay = 0
backlog_max_minutes = 1440
backlog_max_number = 256
backlog_since_last_disconnect = on
+backlog_since_last_message = off
backlog_tags = "irc_privmsg"
backlog_time_format = "[%H:%M] "
+++ /dev/null
-../samechannel.rb
\ No newline at end of file
--- /dev/null
+# vim: set noet nosta sw=4 ts=4 :
+#
+# Colorizer
+# Michael B. Hix <m@hix.io>
+# 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: <regular_expression>/<weechat_color_name> 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( /(?<!\\)\//, 3 )
+
+ next if regex.nil? or regex.empty? or color.nil? or color.empty?
+
+ begin
+ rules[/(#{regex})/i] = color
+ rescue Exception => 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.
#
# (c) 2013 Hendrik 'henk' Jaeger <weechat@henk.geekmail.org>
+# (c) 2015 arza <arza@arza.us>
#
# 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+# Changelog:
+# 2013-10-19 0.0.1 henk:
+# - initial release
+# 2015-09-24 0.1 arza:
+# - option -m/--minimum for minimum count of mutual channels
+# - fixed completion
+
def weechat_init
Weechat.register(
"samechannel",
"henk",
- "0.0.1",
+ "0.1",
"GPL3",
"Lists multiple occurences of the same nick(s) in a set of channels.",
"",
Weechat.hook_command(
"samechannel",
"Lists multiple occurences of the same nick(s) in a set of channels.",
- "[[-s|--servers] servername[,...]] [[-c|--channels] channelname[,...]] [[-n|--nicks] nickname[,...]]",
+ "[-s/--servers servername[,...]] [-c/--channels channelname[,...]] [-n/--nicks nickname[,...]] [-m/--minimum minimum]",
"--servers servername[,servername],...]
--channels channelname[@servername][,channelname[@servername],...]
--nicks nickname[,nickname,...]
-Options used to set filters. All given names are treated as regular expressions. If no names are given, no filters are set.
+--minimum minimum (default: 2)
-WARNING: If you are joined to MANY or even just a few very crowded channels, this script may have to do a lot of comparisons!
+Options used to set filters. All given names are treated as regular expressions. If no names are given, no filters are set.
NOTE: Only nicknames from channels the client is joined to are available for comparison!
EXAMPLES:
+
+ /samechannel -m 5 -s freenode,IRCnet
+ Lists nicks found on at least five channels in freenode and IRCnet combined.
+
/samechannel --channels foo
- Lists nicks found in more than two channels on all servers.
+ Lists nicks found on at least two channels that include 'foo' on all servers.
/samechannel --nicks barbaz,hons --servers example,foobarbaz
Lists channels from the servers example and foobarbaz for each given nick.
/samechannel --nicks foo --channels ^#example.*@.*free.*$
Lists channels you share with nick foo that begin with 'example' from every server with 'free' in their names.",
- "-servers %(irc_servers)
- || -servers %(irc_servers) -channels %(irc_channels)
- || -servers %(irc_servers) -nicks %(irc_server_nicks)
- || -channels %(irc_channels)
- || -channels %(irc_channels) -servers %(irc_servers)
- || -channels %(irc_channels) -nicks %(irc_server_nicks)
- || -nicks %(irc_server_nicks)
- || -nicks %(irc_server_nicks) -servers %(irc_servers)
- || -nicks %(irc_server_nicks) -channels %(irc_channels)",
+ "--minimum" +
+ "|| --servers %(irc_servers) --minimum --channels %(irc_channels)" +
+ "|| --channels %(irc_channels) --servers %(irc_servers)" +
+ "|| --nicks %(irc_server_nicks) --servers %(irc_servers)",
"samechannel_cb",
""
)
end
end
+ minimum = options[:minimumfilter].to_i
+ minimum = 2 if minimum==0
+
duplicate_nicks = nickcount.delete_if do |nickname, nickpaths|
- nickpaths.length <= 1
+ nickpaths.length < minimum
end
duplicate_nicks_sorted = duplicate_nicks.sort do |a, b|
a[1].length <=> b[1].length
options = Hash.new
opt_parser = OptionParser.new do |opts|
+
opts.on("-c", "--channels channelname[,channelname,...]",
"Only channels matching the given (partial) channelname(s) will be considered.)") do |channels|
options[:channelfilter] = channels.split(',')
"Only servers matching the given (partial) servername(s) will be considered.)") do |servers|
options[:serverfilter] = servers.split(',')
end
+
+ opts.on("-m", "--minimum minimum",
+ "Only nicks with at least this many matches will be considered.") do |minimum|
+ options[:minimumfilter] = minimum
+ end
+
end
opt_parser.parse(args)
#
# 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"
#
# 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
salt = on
[data]
+__passphrase__ = on
+slack_se = "84E589F23F2A92ECC0B106866E51234769E82F6F27E093557A41CECF4C24B004645F52AED4F9F2B5E3BD37CE1C9C1F1EDEDE91A9347EA7CD6DB116F201122AD372F52A28D8CD63A88B5F1FC2340C563814206D02893B4F9445EE07FCAE211499834217525BD357F201A981DA03967F5EDA39"
+slack_uh = "D58D59EC51F61E70E8C8D1600D9BD773A345B6EB01339C964888B636CA68949C8AE6D1C8ABD678C3B0A28D3FB2A3838D6FB3EFB85FBB0D1A2839AB3D2F8BC2ADEF13EC3A5CD4CCBDA89060B62D6460420B4553AFB3291C65CE4D702AC3F8BB6D6C53CEE13B1C513B68ABADD0E3EBB7311D"
#
# 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
[color]
flag_command = lightgreen
flag_conditions = yellow
+flag_post_action = lightblue
flag_regex = lightcyan
flag_return_code = lightmagenta
regex = white
beep.conditions = "${tg_highlight} || ${tg_msg_pv}"
beep.enabled = on
beep.hook = print
+beep.post_action = none
beep.regex = ""
beep.return_code = ok
cmd_pass.arguments = "5000|input_text_display;5000|history_add;5000|irc_command_auth"
cmd_pass.conditions = ""
cmd_pass.enabled = on
cmd_pass.hook = modifier
+cmd_pass.post_action = none
cmd_pass.regex = "==^((/(msg|quote) +nickserv +(id|identify|register|ghost +\S+|release +\S+|regain +\S+) +)|/oper +\S+ +|/quote +pass +|/set +\S*password\S* +|/secure +(passphrase|decrypt|set +\S+) +)(.*)==$1$.*+"
cmd_pass.return_code = ok
msg_auth.arguments = "5000|irc_message_auth"
msg_auth.conditions = ""
msg_auth.enabled = on
msg_auth.hook = modifier
+msg_auth.post_action = none
msg_auth.regex = "==^(.*(id|identify|register|ghost +\S+|release +\S+) +)(.*)==$1$.*+"
msg_auth.return_code = ok
server_pass.arguments = "5000|input_text_display;5000|history_add"
server_pass.conditions = ""
server_pass.enabled = on
server_pass.hook = modifier
+server_pass.post_action = none
server_pass.regex = "==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==$1$.*4$5"
server_pass.return_code = ok
#
# 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]
[look]
align_end_of_lines = message
+align_multiline_words = on
bar_more_down = "▼"
bar_more_left = "◀"
bar_more_right = "▶"
bare_display_exit_on_input = on
bare_display_time_format = "%H:%M"
buffer_auto_renumber = off
-buffer_notify_default = highlight
+buffer_notify_default = message
buffer_position = first_gap
buffer_search_case_sensitive = off
buffer_search_force_default = off
command_incomplete = off
confirm_quit = off
confirm_upgrade = off
-day_change = off
+day_change = on
day_change_message_1date = "-- %a, %d %b %Y --"
day_change_message_2dates = "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --"
eat_newline_glitch = off
input_share = none
input_share_overwrite = off
input_undo_max = 32
+item_away_message = on
item_buffer_filter = "•"
item_buffer_zoom = "!"
item_mouse_status = "M"
key_grab_delay = 800
mouse = on
mouse_timer_delay = 100
+nick_color_force = ""
+nick_color_hash = djb2
+nick_color_stop_chars = "_|["
nick_prefix = ""
nick_suffix = ""
paste_auto_add_newline = on
scroll_bottom_after_switch = off
scroll_page_percent = 100
search_text_not_found_alert = on
-separator_horizontal = "â\80\95"
+separator_horizontal = "â\94\80"
separator_vertical = ""
tab_width = 1
time_format = "%a, %d %b %Y %T"
chat_time = default
chat_time_delimiters = brown
chat_value = cyan
+chat_value_null = blue
emphasized = yellow
emphasized_bg = magenta
input_actions = lightgreen
input_text_not_found = red
+item_away = yellow
nicklist_away = cyan
nicklist_group = green
-nicklist_offline = blue
separator = 31
status_count_highlight = magenta
status_count_msg = brown
buffers.conditions = "${window.buffer.full_name} == perl.highmon"
buffers.filling_left_right = columns_vertical
buffers.filling_top_bottom = columns_vertical
-buffers.hidden = off
+buffers.hidden = on
buffers.items = "buffers"
buffers.position = left
buffers.priority = 0
#
# 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
xkb_keycodes { include "evdev" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
- xkb_symbols { include "pc+inet(evdev)+dvorak+dvorak(demon_king)" };
+ xkb_symbols { include "pc+inet(evdev)+dvorak+dvorak(kinesis)" };
xkb_geometry { include "pc(pc104)" };
};
+#!/usr/bin/env bash
+
+export URXVT_PERL_LIB="$HOME/src/dotfiles/urxvt/perls:$HOME/src/dotfiles/urxvt/autocomplete-ALL-the-things"
+urxvtd -q -o &
start-pulseaudio-x11
compton --config ~/.config/compton.conf &
xautolock -detectsleep \
-notify 600 -notifier "xset dpms force off" \
-time 20 -locker "i3lock -nc 000000" \
-killtime 70 -killer "systemctl suspend" &
-xkbcomp -I$HOME/.config/xkb $HOME/.config/xkb/$(hostname).xkb $DISPLAY
unclutter --timeout 1 &
[[ -f "$XDG_CONFIG_HOME/xbindkeys/$(hostname)" ]] && xbindkeys --file $XDG_CONFIG_HOME/xbindkeys/$(hostname)
+xkbcomp -I$HOME/.config/xkb $HOME/.config/xkb/$(hostname).xkb $DISPLAY
xcape -e "Control_L=Escape;Control_R=Escape"
-urxvtd -q -f -o
+
+hash mopidy && urxvtc -name mopidy -icon ~/src/dotfiles/icons/bmp.png -e ncmpcpp -p 6601
+hash ncmpcpp && urxvtc -name ncmpcpp -icon ~/src/dotfiles/icons/bmp.png -e ncmpcpp
+hash weechat && urxvtc -name weechat -icon ~/src/dotfiles/icons/im-irc.png -e weechat
+hash mutt && urxvtc -name mutt -icon ~/src/dotfiles/icons/internet-mail.png -e mutt
+
+qutebrowser &
--- /dev/null
+[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
alias gcp='git cherry-pick'
alias gcount='git shortlog -sn'
-alias glg='git --no-pager log --oneline --graph --max-count=20 --decorate'
alias glg='git --no-pager log --graph --max-count=20 --pretty=tformat:"%Cblue%cd %C(auto)%h%d %s" --date=short'
function glm { glg "${1:-origin}".. }
compdef _git glm=git-log
alias glgg='git log --stat --graph --max-count=20 --decorate'
alias glgga='git log --stat --graph --decorate --all'
+alias grl='git --no-pager reflog --max-count=20'
+
alias ga='git add'
alias gm='git merge'
paclist() {
pacman -Qei "$@" | awk 'BEGIN {FS=": "}/^Name/{printf("\033[1;36m%s\033[0m ",$2)}/^Description/{print $2}'
}
+
+pacclean() {
+ local _pkgs=( $(pacman -Qeq) )
+ for pkg in ${_pkgs[@]}; do
+ # the file has been removed by a previous clean
+ pacman -Qq $pkg 2>&1 1>/dev/null || continue
+
+ pacman -Qi $pkg | awk 'BEGIN {FS=": "}/^Name/{printf("\n\033[1;36m%s\033[0m ",$2)}/^Description/{print $2}/^(Required|Optional For)/'
+
+ local edrq=''
+ while true; do
+ echo -n "Explicit, Dependency, Remove, Quit? [Edrq] "
+ read -sk edrq
+ echo
+ case $edrq in
+ [Qq]) return ;;
+ $'\n') ;&
+ [Ee]) break ;;
+ [Rr]) sudo pacman -Rnscu $pkg; break ;;
+ [Dd]) sudo pacman -D --asdeps $pkg; break ;;
+ esac
+ done
+ done
+}
# [l]ist [o]orphans
alias paclo='pacman -Qdt'
# [r]emove [o]orphans
bindkey '^P' history-search-backward
bindkey ' ' magic-space # also do history expansion on space
-bindkey -s '^[l' '\11ls\r' # show dir content
+bindkey -s '^[l' '^Qls\r' # show dir content
+bindkey -s '^Z' '^Qfg\r' # fg with ^Z
bindkey '^[[Z' reverse-menu-complete
--- /dev/null
+function git_auto_fetch {
+ # auto git fetch on intervals
+ if [[ -d .git ]] || git rev-parse --git-dir 2>/dev/null 1>&2; then
+ # read interval or store default
+ local -i interval
+ if ! interval=$(git config custom.fetch-interval); then
+ ((interval = 24 * 60 * 60)) # 1 day
+ git config custom.fetch-interval $interval
+ fi
+
+ # Don't fetch if interval is <= 0
+ (( $interval <= 0 )) && return
+
+ local -i time=$(date -u +%s)
+ local -i fetch_time=$(git config custom.fetch-time)
+ if (( $time - $fetch_time > $interval )); then
+ echo "Fetching from repositories..."
+ git fetch
+ git config custom.fetch-time $(date -u +%s)
+ fi
+ fi
+}
+chpwd_functions+=(git_auto_fetch)
-Subproject commit 367929502fc1e6cb5a1bacc5ff8cc8a317cb998a
+Subproject commit 2dce602727d715f142b5067be4f85de84d98a8b7
export XDG_CACHE_HOME="$HOME/.cache"
export HOST=$(hostname)
+# gpg
+export GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
# ssh
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
XDG_CACHE_HOME \
XDG_CONFIG_HOME \
XDG_DATA_HOME \
+ GNUPGHOME \
SSH_AUTH_SOCK
fi
export MPV_HOME="$XDG_CONFIG_HOME/mpv"
export MPLAYER_HOME="$XDG_CONFIG_HOME/mplayer"
-# gpg
-export GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
-
# pass
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass"
+
+# SSH Agent
+export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
+
+# weechat
+export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat"