Browse Source

Final push before switching to git bare

main
Yigit Colakoglu 4 years ago
parent
commit
3b2427735b
45 changed files with 2170 additions and 912 deletions
  1. +8
    -0
      .gitmodules
  2. +1
    -1
      README.md
  3. +3
    -0
      arch-setup/packages.rice
  4. +1
    -1
      browser/startpage/src/index.css
  5. +2
    -0
      config/.gitignore
  6. +14
    -21
      config/dunst/dunstrc
  7. +2
    -2
      config/htop/htoprc
  8. +2
    -2
      config/isync/mbsyncrc
  9. +1
    -0
      config/mimeapps.list
  10. +0
    -0
      config/mutt/.mailsynclastrun
  11. +6
    -0
      config/nextcloud/nextcloud
  12. +1
    -0
      config/screen/screenrc
  13. +4
    -0
      config/tmux/tmux.conf
  14. +1
    -1
      config/weechat/buflist.conf
  15. +45
    -1
      config/weechat/irc.conf
  16. BIN
      config/weechat/irc.upgrade
  17. +38
    -0
      config/weechat/iset.conf
  18. +1
    -0
      config/weechat/perl/autoload/iset.pl
  19. +0
    -1
      config/weechat/perl/autoload/multiline.pl
  20. +1645
    -0
      config/weechat/perl/iset.pl
  21. +0
    -782
      config/weechat/perl/multiline.pl
  22. +47
    -12
      config/weechat/plugins.conf
  23. +10
    -6
      config/weechat/python/anotify.py
  24. +1
    -0
      config/weechat/python/autoload/styurl.py
  25. +178
    -0
      config/weechat/python/styurl.py
  26. BIN
      config/weechat/relay.upgrade
  27. +1
    -1
      config/weechat/script.conf
  28. BIN
      config/weechat/script/plugins.xml.gz
  29. +2
    -1
      config/weechat/sec.conf
  30. +44
    -28
      config/weechat/weechat.conf
  31. +29
    -27
      config/weechat/weechat.log
  32. BIN
      config/weechat/weechat.upgrade
  33. +2
    -2
      config/weechat/xfer.conf
  34. BIN
      config/weechat/xfer.upgrade
  35. +12
    -3
      config/zsh/aliases
  36. +1
    -0
      local/bin/.gitignore
  37. +9
    -0
      local/bin/calsync
  38. +1
    -1
      local/bin/check-updates
  39. +14
    -10
      local/bin/mailsync
  40. +1
    -3
      local/bin/nextcloud-sync
  41. +1
    -1
      local/bin/status-bar/date
  42. +2
    -5
      profile
  43. +21
    -0
      suckless/paleofetch/logos/artix.h
  44. +4
    -0
      suckless/st/config.h
  45. +15
    -0
      suckless/st/x.c

+ 8
- 0
.gitmodules View File

@ -1,24 +1,32 @@
[submodule "misc/ranger/plugins/devicons2"]
path = misc/ranger/plugins/devicons2
url = https://github.com/cdump/ranger-devicons2.git
shallow = true
[submodule "misc/ranger/plugins/devicons"]
path = misc/ranger/plugins/devicons
url = https://github.com/cdump/ranger-devicons2
shallow = true
[submodule "gtk/Tela-icon-theme"]
path = theming/Tela-icon-theme
url = https://github.com/vinceliuice/Tela-icon-theme.git
shallow = true
[submodule "gtk/themes/material-ocean"]
path = theming/themes/material-ocean
url = https://github.com/material-ocean/Gtk-Theme.git
shallow = true
[submodule "local/share/icons/Tela-Icons"]
path = local/share/icons/Tela-Icons
url = https://github.com/vinceliuice/Tela-icon-theme.git
shallow = true
[submodule "local/share/themes/Material-Ocean"]
path = local/share/themes/Material-Ocean
url = https://github.com/material-ocean/Gtk-Theme
shallow = true
[submodule "local/share/themes/material-ocean"]
path = local/share/themes/material-ocean
url = https://github.com/material-ocean/Gtk-Theme
shallow = true
[submodule "config/ranger/plugins/devicons"]
path = config/ranger/plugins/devicons
url = https://github.com/cdump/ranger-devicons2.git
shallow = true

+ 1
- 1
README.md View File

@ -22,7 +22,7 @@ Have fun! Another copy of all of this is [here](https://git.yigitcolakoglu.com/y
Just run
```sh
git clone --recurse-submodules https://github.com/theFr1nge/dotfiles.git ~/.dotfiles && ~/.dotfiles/install.sh
git clone --depth 4 --recurse-submodules https://github.com/theFr1nge/dotfiles.git ~/.dotfiles && ~/.dotfiles/install.sh
```
This will download everything you need. After that, I have a list of all the packages I have installed on my machine in the directory arch-setup/.


+ 3
- 0
arch-setup/packages.rice View File

@ -50,3 +50,6 @@ libexif
libxft
udevil
redshift
python-notify2
python-gobject
gsound

+ 1
- 1
browser/startpage/src/index.css View File

@ -30,7 +30,7 @@ textarea {
:root {
/* colors */
--main: hsl(220, 21%, 17%);
--main: hsl(229, 27%, 8%);
--main-light: hsl(30, 35%, 40%);
--module-background: hsl(31, 77%, 60%);
--search-background: hsl(4, 100%, 74%);


+ 2
- 0
config/.gitignore View File

@ -43,6 +43,8 @@
!newsboat/**
!nextcloud
!nextcloud/**
!screen
!screen/**
!notmuch
!notmuch/**
!pulse


+ 14
- 21
config/dunst/dunstrc View File

@ -67,26 +67,19 @@
frame_color = "#E5E9F0"
timeout = 0
[irc]
appname = weechat
timeout = 0
background = "#0033bb"
foreground = "#dddddd"
#
[weechat hl]
appname = weechat
category = weechat.HL
background = "#FF5C47"
foreground = "#FFFFFF"
#
[weechat pn]
appname = weechat
category = weechat.PM
background = "#D53B84"
foreground = "#FFFFFF"
[Spotify]
appname = Spotify
frame_color = "#30AB70"
timeout = 5
[volume]
appname = 蓼 Volume
history_ignore = yes
[screensaver]
appname =  System
history_ignore = yes
[notification]
appname =  Notifications
history_ignore = yes
[keyboard]
appname =  Keyboard
history_ignore = yes
# vim: ft=cfg

+ 2
- 2
config/htop/htoprc View File

@ -1,12 +1,12 @@
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=47
sort_key=46
sort_direction=1
tree_sort_key=47
tree_sort_direction=1
hide_kernel_threads=1
hide_userland_threads=0
hide_userland_threads=1
shadow_other_users=0
show_thread_names=0
show_program_path=1


+ 2
- 2
config/isync/mbsyncrc View File

@ -15,8 +15,8 @@ Inbox /home/yigit/.local/share/mail/yigitcolakoglu@hotmail.com/INBOX
Channel yigitcolakoglu@hotmail.com
Expunge Both
Master :yigitcolakoglu@hotmail.com-remote:
Slave :yigitcolakoglu@hotmail.com-local:
Far :yigitcolakoglu@hotmail.com-remote:
Near :yigitcolakoglu@hotmail.com-local:
Patterns * !"[Gmail]/All Mail"
Create Both
SyncState *


+ 1
- 0
config/mimeapps.list View File

@ -26,3 +26,4 @@ application/x-directory=lf.desktop
[Added Associations]
application/javascript=gvim.desktop;vim.desktop;
application/pdf=org.pwmt.zathura-pdf-mupdf.desktop;

+ 0
- 0
config/mutt/.mailsynclastrun View File


+ 6
- 0
config/nextcloud/nextcloud View File

@ -1,5 +1,11 @@
#!/bin/bash
eval "$(grep -h -- \
"^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\|XDG_DATA_HOME\|XDG_CONFIG_HOME\|XDG_RUNTIME_DIR\)=" \
"$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \
"$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" "$HOME/.pam_environment" 2>/dev/null)"
export NEXTCLOUD_USERNAME=yigitcolakoglu
export NEXTCLOUD_PASSWORD=$(pass show Server/drive.yigitcolakoglu.com/yigitcolakoglu)
export NEXTCLOUD_URL=https://drive.yigitcolakoglu.com/remote.php/webdav


+ 1
- 0
config/screen/screenrc View File

@ -0,0 +1 @@
debug on

+ 4
- 0
config/tmux/tmux.conf View File

@ -120,6 +120,10 @@ bind _ split-window -v -c "#{pane_current_path}"
bind-key "\\" split-window -fh -c "#{pane_current_path}"
bind-key "_" split-window -fv -c "#{pane_current_path}"
# Disable status bar for weechat sessions
set-hook -g session-created 'if -F "#{==:#{session_name},weechat}" "set status off" "set status on"'
set-hook -g session-created 'if -F "#{==:#{session_name},weechat}" "set status off" "set status on"'
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'


+ 1
- 1
config/weechat/buflist.conf View File

@ -25,7 +25,7 @@ use_items = 1
[format]
buffer = "${format_number}${indent}${format_nick_prefix}${color_hotlist}${format_name}"
buffer_current = "${color:,blue}${format_buffer}"
buffer_current = "${color:,8}${format_buffer}"
hotlist = " ${color:green}(${hotlist}${color:green})"
hotlist_highlight = "${color:magenta}"
hotlist_low = "${color:white}"


+ 45
- 1
config/weechat/irc.conf View File

@ -188,7 +188,7 @@ freenode.local_hostname
freenode.usermode
freenode.command
freenode.command_delay
freenode.autojoin = "#vim,#archlinux,#lf,##C,#python,##java"
freenode.autojoin = "#vim,#archlinux,#lf,##C,#python,##java,#xorg-devel,#pass"
freenode.autorejoin
freenode.autorejoin_delay
freenode.connection_timeout
@ -203,3 +203,47 @@ freenode.notify
freenode.split_msg_max_length
freenode.charset_message
freenode.default_chantypes
oftc.addresses = "irc.oftc.net"
oftc.proxy
oftc.ipv6
oftc.ssl
oftc.ssl_cert
oftc.ssl_password
oftc.ssl_priorities
oftc.ssl_dhkey_size
oftc.ssl_fingerprint
oftc.ssl_verify
oftc.password
oftc.capabilities
oftc.sasl_mechanism = plain
oftc.sasl_username = "Fr1nge"
oftc.sasl_password = "${sec.data.oftc_password}"
oftc.sasl_key
oftc.sasl_timeout
oftc.sasl_fail
oftc.autoconnect = on
oftc.autoreconnect
oftc.autoreconnect_delay
oftc.nicks = "Fr1nge,theFr1nge"
oftc.nicks_alternate
oftc.username = "Fr1nge"
oftc.realname = "Yigit Colakoglu"
oftc.local_hostname
oftc.usermode
oftc.command
oftc.command_delay
oftc.autojoin = "#suckless"
oftc.autorejoin
oftc.autorejoin_delay
oftc.connection_timeout
oftc.anti_flood_prio_high
oftc.anti_flood_prio_low
oftc.away_check
oftc.away_check_max_nicks
oftc.msg_kick
oftc.msg_part
oftc.msg_quit
oftc.notify
oftc.split_msg_max_length
oftc.charset_message
oftc.default_chantypes

BIN
config/weechat/irc.upgrade View File


+ 38
- 0
config/weechat/iset.conf View File

@ -0,0 +1,38 @@
#
# 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
help_default_value = green
help_option_name = white
help_text = default
option = default
option_selected = white
type = brown
type_selected = yellow
value = cyan
value_diff = magenta
value_diff_selected = lightmagenta
value_selected = lightcyan
value_undef = green
value_undef_selected = lightgreen
[help]
show_help_bar = on
show_help_extra_info = on
show_plugin_description = off
[look]
scroll_horiz = 10
show_current_line = on
use_color = off
use_mute = off
value_search_char = "="

+ 1
- 0
config/weechat/perl/autoload/iset.pl View File

@ -0,0 +1 @@
../iset.pl

+ 0
- 1
config/weechat/perl/autoload/multiline.pl View File

@ -1 +0,0 @@
../multiline.pl

+ 1645
- 0
config/weechat/perl/iset.pl
File diff suppressed because it is too large
View File


+ 0
- 782
config/weechat/perl/multiline.pl View File

@ -1,782 +0,0 @@
use strict; use warnings;
$INC{'Encode/ConfigLocal.pm'}=1;
require Encode;
use utf8;
# multiline.pl is written by Nei <anti.teamidiot.de>
# and licensed under the under GNU General Public License v3
# or any later version
# to read the following docs, you can use "perldoc multiline.pl"
=head1 NAME
multiline - Multi-line edit box for WeeChat (weechat edition)
=head1 DESCRIPTION
multiline will draw a multi-line edit box to your WeeChat window so
that when you hit the return key, you can first compose a complete
multi-line message before sending it all at once.
Furthermore, if you have multi-line pastes then you can edit them
before sending out all the lines.
=head1 USAGE
make a key binding to send the finished message:
/key bind meta-s /input return
then you can send the multi-line message with Alt+S
=head1 SETTINGS
the settings are usually found in the
plugins.var.perl.multiline
namespace, that is, type
/set plugins.var.perl.multiline.*
to see them and
/set plugins.var.perl.multiline.SETTINGNAME VALUE
to change a setting C<SETTINGNAME> to a new value C<VALUE>. Finally,
/unset plugins.var.perl.multiline.SETTINGNAME
will reset a setting to its default value.
the following settings are available:
=head2 char
character(s) which should be displayed to indicate end of line
=head2 tab
character(s) which should be displayed instead of Tab key character
=head2 lead_linebreak
if turned on, multi-line messages always start on a new line
=head2 modify_keys
if turned on, cursor keys are modified so that they respect line
boundaries instead of treating the whole multi-line message as a
single line
=head2 magic
indicator displayed when message will be sent soon
=head2 magic_enter_time
delay after pressing enter before sending automatically (in ms), or 0
to disable
=head2 magic_paste_only
only use multi-line messages for multi-line pastes (multi-line on
enter is disabled by this)
=head2 paste_lock
time-out to detect pastes (disable the weechat built-in paste
detection if you want to use this)
=head2 send_empty
set to on to automatically disregard enter key on empty line
=head2 hide_magic_nl
whether the new line inserted by magic enter key will be hidden
=head2 weechat_paste_fix
disable ctrl-J binding when paste is detected to stop silly weechat
sending out pastes without allowing to edit them
=head2 ipl
this setting controls override of ctrl-M (enter key) by script. Turn
it off if you don't want multiline.pl to set and re-set the key binding.
=head1 FUNCTION DESCRIPTION
for full pod documentation, filter this script with
perl -pE'
(s/^## (.*?) -- (.*)/=head2 $1\n\n$2\n\n=over\n/ and $o=1) or
s/^## (.*?) - (.*)/=item I<$1>\n\n$2\n/ or
(s/^## (.*)/=back\n\n$1\n\n=cut\n/ and $o=0,1) or
($o and $o=0,1 and s/^sub /=back\n\n=cut\n\nsub /)'
=cut
use constant SCRIPT_NAME => 'multiline';
our $VERSION = '0.6.3'; # af2e0a17b659a16
weechat::register(SCRIPT_NAME,
'Nei <anti.teamidiot.de>', # Author
$VERSION,
'GPL3', # License
'Multi-line edit box', # Description
'stop_multiline', '') || return;
sub SCRIPT_FILE() {
my $infolistptr = weechat::infolist_get('perl_script', '', SCRIPT_NAME);
my $filename = weechat::infolist_string($infolistptr, 'filename') if weechat::infolist_next($infolistptr);
weechat::infolist_free($infolistptr);
return $filename unless @_;
}
{
package Nlib;
# this is a weechat perl library
use strict; use warnings; no warnings 'redefine';
## i2h -- copy weechat infolist content into perl hash
## $infolist - name of the infolist in weechat
## $ptr - pointer argument (infolist dependend)
## @args - arguments to the infolist (list dependend)
## $fields - string of ref type "fields" if only certain keys are needed (optional)
## returns perl list with perl hashes for each infolist entry
sub i2h {
my %i2htm = (i => 'integer', s => 'string', p => 'pointer', b => 'buffer', t => 'time');
local *weechat::infolist_buffer = sub { '(not implemented)' };
my ($infolist, $ptr, @args) = @_;
$ptr ||= "";
my $fields = ref $args[-1] eq 'fields' ? ${ pop @args } : undef;
my $infptr = weechat::infolist_get($infolist, $ptr, do { local $" = ','; "@args" });
my @infolist;
while (weechat::infolist_next($infptr)) {
my @fields = map {
my ($t, $v) = split ':', $_, 2;
bless \$v, $i2htm{$t};
}
split ',',
($fields || weechat::infolist_fields($infptr));
push @infolist, +{ do {
my (%list, %local, @local);
map {
my $fn = 'weechat::infolist_'.ref $_;
my $r = do { no strict 'refs'; &$fn($infptr, $$_) };
if ($$_ =~ /^localvar_name_(\d+)$/) {
$local[$1] = $r;
()
}
elsif ($$_ =~ /^(localvar)_value_(\d+)$/) {
$local{$local[$2]} = $r;
$1 => \%local
}
elsif ($$_ =~ /(.*?)((?:_\d+)+)$/) {
my ($key, $idx) = ($1, $2);
my @idx = split '_', $idx; shift @idx;
my $target = \$list{$key};
for my $x (@idx) {
my $o = 1;
if ($key eq 'key' or $key eq 'key_command') {
$o = 0;
}
if ($x-$o < 0) {
local $" = '|';
weechat::print('',"list error: $target/$$_/$key/$x/$idx/@idx(@_)");
$o = 0;
}
$target = \$$target->[$x-$o]
}
$$target = $r;
$key => $list{$key}
}
else {
$$_ => $r
}
} @fields
} };
}
weechat::infolist_free($infptr);
!wantarray && @infolist ? \@infolist : @infolist
}
## hdh -- hdata helper
## $_[0] - arg pointer or hdata list name
## $_[1] - hdata name
## $_[2..$#_] - hdata variable name
## $_[-1] - hashref with key/value to update (optional)
## returns value of hdata, and hdata name in list ctx, or number of variables updated
sub hdh {
if (@_ > 1 && $_[0] !~ /^0x/ && $_[0] !~ /^\d+$/) {
my $arg = shift;
unshift @_, weechat::hdata_get_list(weechat::hdata_get($_[0]), $arg);
}
while (@_ > 2) {
my ($arg, $name, $var) = splice @_, 0, 3;
my $hdata = weechat::hdata_get($name);
unless (ref $var eq 'HASH') {
$var =~ s/!(.*)/weechat::hdata_get_string($hdata, $1)/e;
(my $plain_var = $var) =~ s/^\d+\|//;
my $type = weechat::hdata_get_var_type_string($hdata, $plain_var);
if ($type eq 'pointer') {
my $name = weechat::hdata_get_var_hdata($hdata, $var);
unshift @_, $name if $name;
}
my $fn = "weechat::hdata_$type";
unshift @_, do { no strict 'refs';
&$fn($hdata, $arg, $var) };
}
else {
return weechat::hdata_update($hdata, $arg, $var);
}
}
wantarray ? @_ : $_[0]
}
use Pod::Select qw();
use Pod::Simple::TextContent;
## get_desc_from_pod -- return setting description from pod documentation
## $file - filename with pod
## $setting - name of setting
## returns description as text
sub get_desc_from_pod {
my $file = shift;
return unless -s $file;
my $setting = shift;
open my $pod_sel, '>', \my $ss;
Pod::Select::podselect({
-output => $pod_sel,
-sections => ["SETTINGS/$setting"]}, $file);
my $pt = new Pod::Simple::TextContent;
$pt->output_string(\my $ss_f);
$pt->parse_string_document($ss);
my ($res) = $ss_f =~ /^\s*\Q$setting\E\s+(.*)\s*/;
$res
}
## get_settings_from_pod -- retrieve all settings in settings section of pod
## $file - file with pod
## returns list of all settings
sub get_settings_from_pod {
my $file = shift;
return unless -s $file;
open my $pod_sel, '>', \my $ss;
Pod::Select::podselect({
-output => $pod_sel,
-sections => ["SETTINGS//!.+"]}, $file);
$ss =~ /^=head2\s+(.*)\s*$/mg
}
## mangle_man_for_wee -- turn man output into weechat codes
## @_ - list of grotty lines that should be turned into weechat attributes
## returns modified lines and modifies lines in-place
sub mangle_man_for_wee {
for (@_) {
s/_\x08(.)/weechat::color('underline').$1.weechat::color('-underline')/ge;
s/(.)\x08\1/weechat::color('bold').$1.weechat::color('-bold')/ge;
}
wantarray ? @_ : $_[0]
}
## read_manpage -- read a man page in weechat window
## $file - file with pod
## $name - buffer name
sub read_manpage {
my $caller_package = (caller)[0];
my $file = shift;
my $name = shift;
if (my $obuf = weechat::buffer_search('perl', "man $name")) {
eval qq{
package $caller_package;
weechat::buffer_close(\$obuf);
};
}
my @wee_keys = Nlib::i2h('key');
my @keys;
my $winptr = weechat::current_window();
my ($wininfo) = Nlib::i2h('window', $winptr);
my $buf = weechat::buffer_new("man $name", '', '', '', '');
return weechat::WEECHAT_RC_OK unless $buf;
my $width = $wininfo->{chat_width};
--$width if $wininfo->{chat_width} < $wininfo->{width} || ($wininfo->{width_pct} < 100 && (grep { $_->{y} == $wininfo->{y} } Nlib::i2h('window'))[-1]{x} > $wininfo->{x});
$width -= 2; # when prefix is shown
weechat::buffer_set($buf, 'time_for_each_line', 0);
eval qq{
package $caller_package;
weechat::buffer_set(\$buf, 'display', 'auto');
};
die $@ if $@;
@keys = map { $_->{key} }
grep { $_->{command} eq '/input history_previous' ||
$_->{command} eq '/input history_global_previous' } @wee_keys;
@keys = 'meta2-A' unless @keys;
weechat::buffer_set($buf, "key_bind_$_", '/window scroll -1') for @keys;
@keys = map { $_->{key} }
grep { $_->{command} eq '/input history_next' ||
$_->{command} eq '/input history_global_next' } @wee_keys;
@keys = 'meta2-B' unless @keys;
weechat::buffer_set($buf, "key_bind_$_", '/window scroll +1') for @keys;
weechat::buffer_set($buf, 'key_bind_ ', '/window page_down');
@keys = map { $_->{key} }
grep { $_->{command} eq '/input delete_previous_char' } @wee_keys;
@keys = ('ctrl-?', 'ctrl-H') unless @keys;
weechat::buffer_set($buf, "key_bind_$_", '/window page_up') for @keys;
weechat::buffer_set($buf, 'key_bind_g', '/window scroll_top');
weechat::buffer_set($buf, 'key_bind_G', '/window scroll_bottom');
weechat::buffer_set($buf, 'key_bind_q', '/buffer close');
weechat::print($buf, " \t".mangle_man_for_wee($_)) # weird bug with \t\t showing nothing?
for `pod2man \Q$file\E 2>/dev/null | GROFF_NO_SGR=1 nroff -mandoc -rLL=${width}n -rLT=${width}n -Tutf8 2>/dev/null`;
weechat::command($buf, '/window scroll_top');
unless (hdh($buf, 'buffer', 'lines', 'lines_count') > 0) {
weechat::print($buf, weechat::prefix('error').$_)
for "Unfortunately, your @{[weechat::color('underline')]}nroff".
"@{[weechat::color('-underline')]} command did not produce".
" any output.",
"Working pod2man and nroff commands are required for the ".
"help viewer to work.",
"In the meantime, please use the command ", '',
"\tperldoc $file", '',
"on your shell instead in order to read the manual.",
"Thank you and sorry for the inconvenience."
}
}
1
}
our $MAGIC_ENTER_TIMER;
our $MAGIC_LOCK;
our $MAGIC_LOCK_TIMER;
our $WEECHAT_PASTE_FIX_CTRLJ_CMD;
our $INPUT_CHANGED_EATER_FLAG;
our $IGNORE_INPUT_CHANGED;
our $IGNORE_INPUT_CHANGED2;
use constant KEY_RET => 'ctrl-M';
use constant INPUT_NL => '/input insert \x0a';
use constant INPUT_MAGIC => '/input magic_enter';
our $NL = "\x0a";
init_multiline();
my $magic_enter_cancel_dynamic = 1;
my $paste_undo_start_ignore_dynamic = 0;
my $input_changed_eater_dynamic = 0;
my $multiline_complete_fix_dynamic = 1;
sub magic_enter_cancel_dynamic { $magic_enter_cancel_dynamic ? &magic_enter_cancel : weechat::WEECHAT_RC_OK }
sub paste_undo_start_ignore_dynamic { $paste_undo_start_ignore_dynamic ? &paste_undo_start_ignore : weechat::WEECHAT_RC_OK }
sub input_changed_eater_dynamic { $input_changed_eater_dynamic ? &input_changed_eater : weechat::WEECHAT_RC_OK }
sub multiline_complete_fix_dynamic { $multiline_complete_fix_dynamic ? &multiline_complete_fix : weechat::WEECHAT_RC_OK }
weechat::hook_config('plugins.var.perl.'.SCRIPT_NAME.'.*', 'default_options', '');
weechat::hook_modifier('input_text_display_with_cursor', 'multiline_display', '');
weechat::hook_command_run('/help '.SCRIPT_NAME, 'help_cmd', '');
weechat::hook_command_run(INPUT_MAGIC, 'magic_enter', '');
weechat::hook_signal('input_text_*', 'magic_enter_cancel_dynamic', '');
weechat::hook_command_run('/input *', 'paste_undo_start_ignore_dynamic', '');
weechat::hook_signal('2000|input_text_changed', 'input_changed_eater_dynamic', '');
weechat::hook_signal('key_pressed', 'magic_lock_hatch', '');
# we need lower than default priority here or the first character is separated
weechat::hook_signal('500|input_text_changed', 'paste_undo_hack', '')
# can only do this on weechat 0.4.0
if (weechat::info_get('version_number', '') || 0) >= 0x00040000;
weechat::hook_command_run("1500|/input complete*", 'multiline_complete_fix_dynamic', 'complete*');
weechat::hook_command_run("1500|/input delete_*", 'multiline_complete_fix_dynamic', 'delete_*');
weechat::hook_command_run("1500|/input move_*", 'multiline_complete_fix_dynamic', 'move_*');
sub _stack_depth {
my $depth = -1;
1 while caller(++$depth);
$depth;
}
## multiline_display -- show multi-lines on display of input string
## () - modifier handler
## $_[2] - buffer pointer
## $_[3] - input string
## returns modified input string
sub multiline_display {
Encode::_utf8_on($_[3]);
Encode::_utf8_on(my $nl = weechat::config_get_plugin('char') || ' ');
Encode::_utf8_on(my $tab = weechat::config_get_plugin('tab'));
my $cb = weechat::current_buffer() eq $_[2] && $MAGIC_ENTER_TIMER;
if ($cb) {
$_[3] =~ s/$NL\x19b#/\x19b#/ if weechat::config_string_to_boolean(weechat::config_get_plugin('hide_magic_nl'));
}
if ($_[3] =~ s/$NL/$nl\x0d/g) {
$_[3] =~ s/\A/ \x0d/ if weechat::config_string_to_boolean(weechat::config_get_plugin('lead_linebreak'));
}
$_[3] =~ s/\x09/$tab/g if $tab;
if ($cb) {
Encode::_utf8_on(my $magic = weechat::config_get_plugin('magic'));
$_[3] =~ s/\Z/$magic/ if $magic;
}
$_[3]
}
## lock_timer_exp -- expire the magic lock timer
sub lock_timer_exp {
if ($MAGIC_LOCK_TIMER) {
weechat::unhook($MAGIC_LOCK_TIMER);
$MAGIC_LOCK_TIMER = undef;
}
weechat::WEECHAT_RC_OK
}
## paste_undo_stop_ignore -- unset ignore2 flag
sub paste_undo_stop_ignore {
$IGNORE_INPUT_CHANGED2 = undef;
weechat::WEECHAT_RC_OK
}
## paste_undo_start_ignore -- set ignore2 flag when /input is received so to allow /input undo/redo
## () - command_run handler
## $_[2] - command that was called
sub paste_undo_start_ignore {
return weechat::WEECHAT_RC_OK if $IGNORE_INPUT_CHANGED;
return weechat::WEECHAT_RC_OK if $_[2] =~ /insert/;
$IGNORE_INPUT_CHANGED2 = 1;
weechat::WEECHAT_RC_OK
}
## paste_undo_hack -- fix up undo stack when paste is detected by calling /input undo
## () - signal handler
## $_[2] - buffer pointer
sub paste_undo_hack {
return weechat::WEECHAT_RC_OK if $IGNORE_INPUT_CHANGED;
return paste_undo_stop_ignore() if $IGNORE_INPUT_CHANGED2;
if ($MAGIC_LOCK > 0 && get_lock_enabled()) {
signall_ignore_input_changed(1);
$paste_undo_start_ignore_dynamic = 1;
Encode::_utf8_on(my $input = weechat::buffer_get_string($_[2], 'input'));
my $pos = weechat::buffer_get_integer($_[2], 'input_pos');
weechat::command($_[2], '/input undo') for 1..2;
weechat::buffer_set($_[2], 'input', $input);
weechat::buffer_set($_[2], 'input_pos', $pos);
$paste_undo_start_ignore_dynamic = 0;
signall_ignore_input_changed(0);
}
weechat::WEECHAT_RC_OK
}
## input_changed_eater -- suppress input_text_changed signal on new weechats
## () - signal handler
sub input_changed_eater {
$INPUT_CHANGED_EATER_FLAG = undef;
weechat::WEECHAT_RC_OK_EAT
}
## signall_ignore_input_changed -- use various methods to "ignore" input_text_changed signal
## $_[0] - start ignore or stop ignore
sub signall_ignore_input_changed {
if ($_[0]) {
weechat::hook_signal_send('input_flow_free', weechat::WEECHAT_HOOK_SIGNAL_INT, 1);
$input_changed_eater_dynamic = 1;
$IGNORE_INPUT_CHANGED = 1;
weechat::buffer_set('', 'completion_freeze', '1');
}
else {
weechat::buffer_set('', 'completion_freeze', '0');
$IGNORE_INPUT_CHANGED = undef;
$input_changed_eater_dynamic = 0;
weechat::hook_signal_send('input_flow_free', weechat::WEECHAT_HOOK_SIGNAL_INT, 0);
}
}
## multiline_complete_fix -- add per line /input handling for completion, movement and deletion
## () - command_run handler
## $_[0] - original bound data
## $_[1] - buffer pointer
## $_[2] - original command
sub multiline_complete_fix {
$magic_enter_cancel_dynamic = 0;
$multiline_complete_fix_dynamic = 0;
if ($_[2] =~ s/_message$/_line/ || !weechat::config_string_to_boolean(weechat::config_get_plugin('modify_keys'))) {
weechat::command($_[1], $_[2]);
}
else {
signall_ignore_input_changed(1);
Encode::_utf8_on(my $input = weechat::buffer_get_string($_[1], 'input'));
my $pos = weechat::buffer_get_integer($_[1], 'input_pos');
if ($pos && $_[2] =~ /(?:previous|beginning_of)_/ && (substr $input, $pos-1, 1) eq $NL) {
substr $input, $pos-1, 1, "\0"
}
elsif ($pos < length $input && $_[2] =~ /(?:next|end_of)_/ && (substr $input, $pos, 1) eq $NL) {
substr $input, $pos, 1, "\0"
}
my @lines = $pos ? (split /$NL/, (substr $input, 0, $pos), -1) : '';
my @after = $pos < length $input ? (split /$NL/, (substr $input, $pos), -1) : '';
$lines[-1] =~ s/\0$/$NL/;
$after[0] =~ s/^\0/$NL/;
my ($p1, $p2) = (pop @lines, shift @after);
weechat::buffer_set($_[1], 'input', $p1.$p2);
weechat::buffer_set($_[1], 'input_pos', length $p1);
$magic_enter_cancel_dynamic = 1;
$INPUT_CHANGED_EATER_FLAG = 1;
weechat::command($_[1], $_[2]);
my $changed_later = !$INPUT_CHANGED_EATER_FLAG;
magic_enter_cancel() if $changed_later;
$magic_enter_cancel_dynamic = 0;
Encode::_utf8_on(my $p = weechat::buffer_get_string($_[1], 'input'));
$pos = weechat::buffer_get_integer($_[1], 'input_pos');
weechat::command($_[1], '/input undo') if @lines || @after;
weechat::command($_[1], '/input undo');
weechat::buffer_set($_[1], 'input', join $NL, @lines, $p, @after);
weechat::buffer_set($_[1], 'input_pos', $pos+length join $NL, @lines, '');
signall_ignore_input_changed(0);
weechat::hook_signal_send('input_text_changed', weechat::WEECHAT_HOOK_SIGNAL_POINTER, $_[1]) if $changed_later;
}
$multiline_complete_fix_dynamic = 1;
$magic_enter_cancel_dynamic = 1;
weechat::WEECHAT_RC_OK_EAT
}
## help_cmd -- show multi-line script documentation
## () - command_run handler
sub help_cmd {
Nlib::read_manpage(SCRIPT_FILE, SCRIPT_NAME);
weechat::WEECHAT_RC_OK_EAT
}
## get_lock_time -- gets timeout for paste detection according to setting
## returns timeout (at least 1)
sub get_lock_time {
my $lock_time = weechat::config_get_plugin('paste_lock');
$lock_time = 1 unless $lock_time =~ /^\d+$/ && $lock_time;
$lock_time
}
## get_lock_enabled -- checks whether the paste detection lock is enabled
## returns bool
sub get_lock_enabled {
my $lock = weechat::config_get_plugin('paste_lock');
$lock = weechat::config_string_to_boolean($lock)
unless $lock =~ /^\d+$/;
$lock
}
## magic_lock_hatch -- set a timer for paste detection
## () - signal handler
sub magic_lock_hatch {
lock_timer_exp();
$MAGIC_LOCK_TIMER = weechat::hook_timer(get_lock_time(), 0, 1, 'lock_timer_exp', '');
weechat::WEECHAT_RC_OK
}
## magic_unlock -- reduce the lock added by paste detection
## () - timer handler
sub magic_unlock {
if ($MAGIC_LOCK_TIMER) {
weechat::hook_timer(get_lock_time(), 0, 1, 'magic_unlock', '');
}
else {
--$MAGIC_LOCK;
if (!$MAGIC_LOCK && $WEECHAT_PASTE_FIX_CTRLJ_CMD) {
do_key_bind('ctrl-J', $WEECHAT_PASTE_FIX_CTRLJ_CMD);
$WEECHAT_PASTE_FIX_CTRLJ_CMD = undef;
}
}
weechat::WEECHAT_RC_OK
}
## get_magic_enter_time -- get timeout for auto-sending messages according to config
## returns timeout
sub get_magic_enter_time {
my $magic_enter = weechat::config_get_plugin('magic_enter_time');
$magic_enter = 1000 * weechat::config_string_to_boolean($magic_enter)
unless $magic_enter =~ /^\d+$/;
$magic_enter
}
## magic_enter -- receive enter key and do magic things: set up a timer for sending the message, add newline
## () - command_run handler
## $_[1] - buffer pointer
sub magic_enter {
Encode::_utf8_on(my $input = weechat::buffer_get_string($_[1], 'input'));
if (!length $input && weechat::config_string_to_boolean(weechat::config_get_plugin('send_empty'))) {
weechat::command($_[1], '/input return');
}
else {
magic_enter_cancel();
weechat::command($_[1], INPUT_NL);
unless (get_lock_enabled() && $MAGIC_LOCK) {
if (weechat::config_string_to_boolean(weechat::config_get_plugin('magic_paste_only')) &&
$input !~ /$NL/) {
magic_enter_send($_[1]);
}
elsif (my $magic_enter = get_magic_enter_time()) {
$MAGIC_ENTER_TIMER = weechat::hook_timer($magic_enter, 0, 1, 'magic_enter_send', $_[1]);
}
}
}
weechat::WEECHAT_RC_OK_EAT
}
## magic_enter_send -- actually send enter key when triggered by magic_enter, remove preceding newline
## $_[0] - buffer pointer
## sending is delayed by 1ms to circumvent crash bug in api
sub magic_enter_send {
magic_enter_cancel();
weechat::command($_[0], '/input delete_previous_char');
weechat::command($_[0], '/wait 1ms /input return');
weechat::WEECHAT_RC_OK
}
## magic_enter_cancel -- cancel the timer for automatic sending of message, for example when more text was added, increase the paste lock for paste detection when used as signal handler
## () - signal handler when @_ is set
sub magic_enter_cancel {
if ($MAGIC_ENTER_TIMER) {
weechat::unhook($MAGIC_ENTER_TIMER);
$MAGIC_ENTER_TIMER = undef;
}
if ($MAGIC_LOCK_TIMER && @_) {
if (!$MAGIC_LOCK && !$WEECHAT_PASTE_FIX_CTRLJ_CMD &&
weechat::config_string_to_boolean(weechat::config_get_plugin('weechat_paste_fix'))) {
($WEECHAT_PASTE_FIX_CTRLJ_CMD) = get_key_command('ctrl-J');
$WEECHAT_PASTE_FIX_CTRLJ_CMD = '-' unless defined $WEECHAT_PASTE_FIX_CTRLJ_CMD;
do_key_bind('ctrl-J', '-');
}
if ($MAGIC_LOCK < 1) {
my $lock_time = get_lock_time();
++$MAGIC_LOCK;
weechat::hook_timer(get_lock_time(), 0, 1, 'magic_unlock', '');
}
}
weechat::WEECHAT_RC_OK
}
## need_magic_enter -- check if magic enter keybinding is needed according to config settings
## returns bool
sub need_magic_enter {
weechat::config_string_to_boolean(weechat::config_get_plugin('send_empty')) || get_magic_enter_time() ||
weechat::config_string_to_boolean(weechat::config_get_plugin('magic_paste_only'))
}
## do_key_bind -- mute execute a key binding, or unbind if $_[-1] is '-'
## @_ - arguments to /key bind
sub do_key_bind {
if ($_[-1] eq '-') {
pop;
weechat::command('', "/mute /key unbind @_");
}
elsif ($_[-1] eq '!') {
pop;
weechat::command('', "/mute /key reset @_");
}
else {
weechat::command('', "/mute /key bind @_");
}
}
{ my %keys;
## get_key_command -- get the command bound to a key
## $_[0] - key in weechat syntax
## returns the command
sub get_key_command {
unless (exists $keys{$_[0]}) {
($keys{$_[0]}) =
map { $_->{command} } grep { $_->{key} eq $_[0] }
Nlib::i2h('key')
}
$keys{$_[0]}
}
}
## default_options -- set up default option values on start and when unset
## () - config handler if @_ is set
sub default_options {
my %defaults = (
char => '↩',
tab => '──▶▏',
magic => '‼',
ipl => 'on',
lead_linebreak => 'on',
modify_keys => 'on',
send_empty => 'on',
magic_enter_time => '1000',
paste_lock => '1',
magic_paste_only => 'off',
hide_magic_nl => 'on',
weechat_paste_fix => 'on',
);
unless (weechat::config_is_set_plugin('ipl')) {
if (my $bar = weechat::bar_search('input')) {
weechat::bar_set($bar, $_, '0') for 'size', 'size_max';
}
}
for (keys %defaults) {
weechat::config_set_plugin($_, $defaults{$_})
unless weechat::config_is_set_plugin($_);
}
do_key_bind(KEY_RET, INPUT_NL)
if weechat::config_string_to_boolean(weechat::config_get_plugin('ipl'));
my ($enter_key) = get_key_command(KEY_RET);
if (need_magic_enter()) {
do_key_bind(KEY_RET, INPUT_MAGIC)
if $enter_key eq INPUT_NL;
}
else {
do_key_bind(KEY_RET, INPUT_NL)
if $enter_key eq INPUT_MAGIC;
}
weechat::WEECHAT_RC_OK
}
sub init_multiline {
$MAGIC_LOCK = -1;
default_options();
my $sf = SCRIPT_FILE;
for (Nlib::get_settings_from_pod($sf)) {
weechat::config_set_desc_plugin($_, Nlib::get_desc_from_pod($sf, $_));
}
weechat::WEECHAT_RC_OK
}
sub stop_multiline {
magic_enter_cancel();
if (need_magic_enter()) {
my ($enter_key) = get_key_command(KEY_RET);
do_key_bind(KEY_RET, INPUT_NL)
if $enter_key eq INPUT_MAGIC;
}
if ($WEECHAT_PASTE_FIX_CTRLJ_CMD) {
do_key_bind('ctrl-J', $WEECHAT_PASTE_FIX_CTRLJ_CMD);
$WEECHAT_PASTE_FIX_CTRLJ_CMD = undef;
}
if (weechat::config_string_to_boolean(weechat::config_get_plugin('ipl'))) {
do_key_bind(KEY_RET, '!');
}
weechat::WEECHAT_RC_OK
}

+ 47
- 12
config/weechat/plugins.conf View File

@ -39,6 +39,24 @@ perl.multiline.paste_lock = "1"
perl.multiline.send_empty = "on"
perl.multiline.tab = "──▶▏"
perl.multiline.weechat_paste_fix = "on"
perl.notify_send.command = "notify-send $type: $name &>/dev/null"
perl.notify_send.ignore_nicks = ""
perl.notify_send.wait_highlight = "60"
perl.notify_send.wait_pm = "180"
python.anotify.icon = "/usr/share/pixmaps/weechat.xpm"
python.anotify.show_channel_topic = "on"
python.anotify.show_dcc = "on"
python.anotify.show_highlighted_message = "on"
python.anotify.show_invite_message = "on"
python.anotify.show_notice_message = "off"
python.anotify.show_private_action_message = "on"
python.anotify.show_private_message = "on"
python.anotify.show_public_action_message = "off"
python.anotify.show_public_message = "off"
python.anotify.show_server = "on"
python.anotify.show_upgrade_ended = "on"
python.anotify.sticky = "off"
python.anotify.sticky_away = "on"
python.chanotify.filters = "*:*"
python.chanotify.status = "on"
python.go.auto_jump = "off"
@ -54,26 +72,34 @@ python.go.message = "Go to: "
python.go.short_name = "off"
python.go.sort = "number,beginning"
python.go.use_core_instead_weechat = "off"
python.styurl.buffer_type = "formatted"
python.styurl.format = "${color:*_32}"
python.styurl.ignored_buffers = "core.weechat,python.grep"
python.styurl.ignored_tags = "irc_quit,irc_join"
python.styurl.regex = "((?:https?|ftp)://[^\s/$.?#].\S*)"
python.vimode.copy_clipboard_cmd = "xclip -selection c"
python.vimode.imap_esc = ""
python.vimode.imap_esc_timeout = "1000"
python.vimode.line_number_prefix = ""
python.vimode.line_number_suffix = " "
python.vimode.mode_indicator_cmd_color = "white"
python.vimode.mode_indicator_cmd_color_bg = "cyan"
python.vimode.mode_indicator_insert_color = "white"
python.vimode.mode_indicator_insert_color_bg = "blue"
python.vimode.mode_indicator_normal_color = "white"
python.vimode.mode_indicator_normal_color_bg = "gray"
python.vimode.mode_indicator_prefix = ""
python.vimode.line_number_suffix = ": "
python.vimode.mode_indicator_cmd_color = "13"
python.vimode.mode_indicator_cmd_color_bg = "default"
python.vimode.mode_indicator_cmd_color_fg = "13"
python.vimode.mode_indicator_insert_color = "2"
python.vimode.mode_indicator_insert_color_bg = "default"
python.vimode.mode_indicator_insert_color_fg = "2"
python.vimode.mode_indicator_normal_color = "4"
python.vimode.mode_indicator_normal_color_bg = "default"
python.vimode.mode_indicator_normal_color_fg = "19"
python.vimode.mode_indicator_prefix = "--"
python.vimode.mode_indicator_replace_color = "white"
python.vimode.mode_indicator_replace_color_bg = "red"
python.vimode.mode_indicator_search_color = "white"
python.vimode.mode_indicator_search_color_bg = "magenta"
python.vimode.mode_indicator_suffix = ""
python.vimode.mode_indicator_search_color = "1"
python.vimode.mode_indicator_search_color_bg = "default"
python.vimode.mode_indicator_suffix = "--"
python.vimode.no_warn = "off"
python.vimode.paste_clipboard_cmd = "xclip -selection c -o"
python.vimode.search_vim = "off"
python.vimode.search_vim = "on"
python.vimode.user_mappings = ""
[desc]
@ -90,6 +116,10 @@ perl.multiline.paste_lock = "time-out to detect pastes (disable the weechat buil
perl.multiline.send_empty = "set to on to automatically disregard enter key on empty line"
perl.multiline.tab = "character(s) which should be displayed instead of Tab key character"
perl.multiline.weechat_paste_fix = "disable ctrl-J binding when paste is detected to stop silly weechat sending out pastes without allowing to edit them"
perl.notify_send.command = "systemcommand to be executed ($type, $name, and $messagewill be interpreted as values) (default: "notify-send $type: $name &>/dev/null")"
perl.notify_send.ignore_nicks = "comma-separated list of nicks to ignore (default: "")"
perl.notify_send.wait_highlight = "necessary time delay between highlights(seconds) for command to be executed (default: "60")"
perl.notify_send.wait_pm = "necessary time delay between private messages(seconds) for command to be executed (default: "180")"
python.go.auto_jump = "automatically jump to buffer when it is uniquely selected (default: "off")"
python.go.buffer_number = "display buffer number (default: "on")"
python.go.color_name = "color for buffer name (not selected) (default: "black,cyan")"
@ -103,6 +133,11 @@ python.go.message = "message to display before list of buffers (default: "Go to:
python.go.short_name = "display and search in short names instead of buffer name (default: "off")"
python.go.sort = "comma-separated list of keys to sort buffers (the order is important, sorts are performed in the given order): name = sort by name (or short name), (default: "number,beginning")"
python.go.use_core_instead_weechat = "use name "core" instead of "weechat" for core buffer (default: "off")"
python.styurl.buffer_type = "the type of buffers to run on (options are "formatted", "free", or "*" for both) (default: "formatted")"
python.styurl.format = "the style that should be applied to the URL(evaluated, see /help eval) (default: "${color:*_32}")"
python.styurl.ignored_buffers = "comma-separated list of buffers to ignore URLs in (full name like "irc.freenode.#alacritty") (default: "core.weechat,python.grep")"
python.styurl.ignored_tags = "comma-separated list of tags to ignore URLs from (default: "irc_quit,irc_join")"
python.styurl.regex = "the URL-parsing regex using Python syntax (make sure capturing group 1 is the full URL) (default: "((?:https?|ftp)://[^\s/$.?#].\S*)")"
python.vimode.copy_clipboard_cmd = "command used to copy to clipboard; must read input from stdin (default: "xclip -selection c")"
python.vimode.imap_esc = "use alternate mapping to enter Normal mode while in Insert mode; having it set to 'jk' is similar to `:imap jk <Esc>` in vim (default: "")"
python.vimode.imap_esc_timeout = "time in ms to wait for the imap_esc sequence to complete (default: "1000")"


+ 10
- 6
config/weechat/python/anotify.py View File

@ -64,9 +64,10 @@ SETTINGS = {
# -----------------------------------------------------------------------------
try:
import re
import os
import weechat
import gi
import notify2
import subprocess
IMPORT_OK = True
except ImportError as error:
IMPORT_OK = False
@ -413,11 +414,14 @@ def a_notify(notification, title, description, priority=notify2.URGENCY_LOW):
if weechat.config_get_plugin('sticky_away') == 'on' and is_away:
time_out = 0
try:
notify2.init("wee-notifier")
wn = notify2.Notification(title, description, icon)
wn.set_urgency(priority)
wn.set_timeout(time_out)
wn.show()
# notify2.init("wee-notifier")
# wn = notify2.Notification(title, description, icon)
# wn.set_urgency(priority)
# wn.set_timeout(time_out)
# wn.show()
subprocess.run(["notify-send", "-a", " WeeChat", title, description])
if title != "Server Connected" and title != "Server Disconnected":
subprocess.run(["canberra-gtk-play", "-i", "message-new-instant", "-V", "15"])
except Exception as error:
weechat.prnt('', 'anotify: {0}'.format(error))


+ 1
- 0
config/weechat/python/autoload/styurl.py View File

@ -0,0 +1 @@
../styurl.py

+ 178
- 0
config/weechat/python/styurl.py View File

@ -0,0 +1,178 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Cole Helbling <cole.e.helbling@outlook.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Changelog:
# 2019-12-14, Cole Helbling <cole.e.helbling@outlook.com>
# version 1.0: initial release
SCRIPT_NAME = "styurl"
SCRIPT_AUTHOR = "Cole Helbling <cole.e.helbling@outlook.com>"
SCRIPT_VERSION = "1.0"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = "Style URLs with a Python regex"
import_ok = True
try:
import weechat as w
except ImportError:
print("This script must be run under WeeChat.")
print("Get WeeChat now at: https://weechat.org")
import_ok = False
try:
import re
except ImportError as message:
print("Missing package for %s: %s" % (SCRIPT_NAME, message))
import_ok = False
# https://mathiasbynens.be/demo/url-regex
# If you don't want to create your own regex, see the above link for options or
# ideas on creating your own
styurl_settings = {
"buffer_type": (
"formatted",
"the type of buffers to run on (options are \"formatted\", \"free\", "
"or \"*\" for both)"
),
"format": (
"${color:*_32}",
"the style that should be applied to the URL"
"(evaluated, see /help eval)"
),
"ignored_buffers": (
"core.weechat,python.grep",
"comma-separated list of buffers to ignore URLs in "
"(full name like \"irc.freenode.#alacritty\")"
),
"ignored_tags": (
"irc_quit,irc_join",
"comma-separated list of tags to ignore URLs from"
),
"regex": (
r"((?:https?|ftp)://[^\s/$.?#].\S*)",
"the URL-parsing regex using Python syntax "
"(make sure capturing group 1 is the full URL)"
),
}
line_hook = None
def styurl_line_cb(data, line):
"""
Callback called when a line is displayed.
This parses the message for any URLs and styles them according to
styurl_settings["format"].
"""
global styurl_settings
# Don't style the line if it's not going to be displayed... duh
if line["displayed"] != "1":
return line
tags = line["tags"].split(',')
ignored_tags = styurl_settings["ignored_tags"]
# Ignore specified message tags
if ignored_tags:
if any(tag in tags for tag in ignored_tags.split(',')):
return line
bufname = line["buffer_name"]
ignored_buffers = styurl_settings["ignored_buffers"]
# Ignore specified buffers
if ignored_buffers and bufname in ignored_buffers.split(','):
return line
message = line["message"]
# TODO: enforce presence of a properly-formatted color object at
# styurl_settings["format"] (eval object would also be valid, if it eval'd
# to a color)
regex = re.compile(styurl_settings["regex"])
url_style = w.string_eval_expression(styurl_settings["format"], {}, {}, {})
reset = w.color("reset")
# Search for URLs and surround them with the defined URL styling
formatted = regex.sub(r"%s\1%s" % (url_style, reset), message)
line["message"] = line["message"].replace(message, formatted)
return line
def styurl_config_cb(data, option, value):
"""Callback called when a script option is changed."""
global styurl_settings, line_hook
pos = option.rfind('.')
if pos > 0:
name = option[pos+1:]
if name in styurl_settings:
# Changing the buffer target requires us to re-hook to prevent
# obsolete buffer types from getting styled
if name == "buffer_type":
if value in ("free", "formatted", "*"):
w.unhook(line_hook)
line_hook = w.hook_line(value, "", "", "styurl_line_cb",
"")
else:
# Don't change buffer type if it is invalid
w.prnt("", SCRIPT_NAME + ": Invalid buffer type: '%s', "
"not changing." % value)
w.config_set_plugin(name, styurl_settings[name])
return w.WEECHAT_RC_ERROR
styurl_settings[name] = value
return w.WEECHAT_RC_OK
def styurl_unload_cb():
"""Callback called when the script is unloaded."""
global line_hook
w.unhook(line_hook)
del line_hook
return w.WEECHAT_RC_OK
if __name__ == "__main__" and import_ok:
if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
SCRIPT_DESC, "styurl_unload_cb", ""):
version = w.info_get("version_number", "") or 0
for option, value in styurl_settings.items():
if w.config_is_set_plugin(option):
styurl_settings[option] = w.config_get_plugin(option)
else:
w.config_set_plugin(option, value[0])
styurl_settings[option] = value[0]
if int(version) >= 0x00030500:
w.config_set_desc_plugin(option, "%s (default: \"%s\")"
% (value[1], value[0]))
w.hook_config("plugins.var.python." + SCRIPT_NAME + ".*",
"styurl_config_cb", "")
# Style URLs
line_hook = w.hook_line(styurl_settings["buffer_type"], "", "",
"styurl_line_cb", "")

BIN
config/weechat/relay.upgrade View File


+ 1
- 1
config/weechat/script.conf View File

@ -28,7 +28,7 @@ status_popular = yellow
status_running = lightgreen
status_unknown = lightred
text = default
text_bg = default
text_bg = 2
text_bg_selected = red
text_date = default
text_date_selected = white


BIN
config/weechat/script/plugins.xml.gz View File


+ 2
- 1
config/weechat/sec.conf View File

@ -17,4 +17,5 @@ salt = on
[data]
__passphrase__ = on
freenode = "A7FBA84A57B6D4851F67C06A8F7DD64C052326B709F30C9B2985750CE610F35EE7CA3B2A83127306B5FCCE536E889C63DF7A687BBE3BB41F4CBB6D"
oftc_password = "54F228ABE6002B823EF5004E9C426C6854F58B066FFFBB9D8EBB1F5851E6A2C1106F01FA34E481E88D1E006E51D319529961629D2E9D95"
freenode = "5581FF7F5A3E8E0CA3FC94A160B1E1B9D1D785692EDBE3F59B05D63D17D2995478DD2E594FF6498D4F44532C4642089D9EA252F0E6BB7FF1D23025"

+ 44
- 28
config/weechat/weechat.conf View File

@ -147,7 +147,7 @@ word_chars_input = "!\u00A0,-,_,|,alnum"
bar_more = lightmagenta
chat = default
chat_bg = default
chat_buffer = white
chat_buffer = 2
chat_channel = white
chat_day_change = cyan
chat_delimiters = green
@ -203,11 +203,11 @@ status_data_private = lightgreen
status_filter = green
status_more = yellow
status_mouse = green
status_name = white
status_name = 5
status_name_ssl = lightgreen
status_nicklist_count = default
status_number = yellow
status_time = default
status_number = 9
status_time = 2
[completion]
base_word_until_cursor = on
@ -249,7 +249,7 @@ save_config_on_unload = on
[bar]
buflist.color_bg = default
buflist.color_bg_inactive = default
buflist.color_bg_inactive = 1
buflist.color_delim = default
buflist.color_fg = default
buflist.conditions = ""
@ -286,13 +286,28 @@ input.conditions = ""
input.filling_left_right = vertical
input.filling_top_bottom = horizontal
input.hidden = off
input.items = "[input_prompt]+(away),[input_search],[input_paste],input_text"
input.items = "mode_indicator+[input_prompt]+(away),[input_search],[input_paste],input_text,[vi_buffer]"
input.position = bottom
input.priority = 1000
input.separator = off
input.size = 0
input.size_max = 0
input.type = window
isetbar.color_bg = default
isetbar.color_bg_inactive = default
isetbar.color_delim = cyan
isetbar.color_fg = default
isetbar.conditions = ""
isetbar.filling_left_right = vertical
isetbar.filling_top_bottom = horizontal
isetbar.hidden = on
isetbar.items = "isetbar_help"
isetbar.position = top
isetbar.priority = 0
isetbar.separator = on
isetbar.size = 3
isetbar.size_max = 3
isetbar.type = window
nicklist.color_bg = default
nicklist.color_bg_inactive = default
nicklist.color_delim = cyan
@ -308,25 +323,25 @@ nicklist.separator = on
nicklist.size = 0
nicklist.size_max = 0
nicklist.type = window
status.color_bg = blue
status.color_bg_inactive = darkgray
status.color_delim = cyan
status.color_fg = default
status.color_bg = 8
status.color_bg_inactive = default
status.color_delim = 3
status.color_fg = 15
status.conditions = ""
status.filling_left_right = vertical
status.filling_top_bottom = horizontal
status.hidden = off
status.items = "[time],[buffer_last_number],[buffer_plugin],buffer_number+:+buffer_name+(buffer_modes)+{buffer_nicklist_count}+buffer_zoom+buffer_filter,scroll,[lag],[hotlist],completion"
status.items = "[time],[buffer_last_number],[buffer_plugin],buffer_number+:+buffer_name+(buffer_modes)+{buffer_nicklist_count}+buffer_zoom+buffer_filter,scroll,[lag],[hotlist],completion,cmd_completion"
status.position = bottom
status.priority = 500
status.priority = 0
status.separator = off
status.size = 1
status.size_max = 0
status.type = window
title.color_bg = blue
title.color_bg = 8
title.color_bg_inactive = darkgray
title.color_delim = cyan
title.color_fg = default
title.color_fg = 7
title.conditions = ""
title.filling_left_right = vertical
title.filling_top_bottom = horizontal
@ -360,6 +375,7 @@ vi_line_numbers.type = window
perl.highmon = none
[filter]
irc_smart = on;*;irc_smart_filter;*
[key]
ctrl-? = "/input delete_previous_char"
@ -387,6 +403,15 @@ ctrl-Sctrl-U = "/input set_unread"
ctrl-T = "/input transpose_chars"
ctrl-U = "/input delete_beginning_of_line"
ctrl-W = "/input delete_previous_word"
ctrl-W= = "/window balance"
ctrl-Wh = "/window left"
ctrl-Wj = "/window down"
ctrl-Wk = "/window up"
ctrl-Wl = "/window right"
ctrl-Wq = "/window merge"
ctrl-Ws = "/window splith"
ctrl-Wv = "/window splitv"
ctrl-Wx = "/window swap"
ctrl-X = "/input switch_active_buffer"
ctrl-Y = "/input clipboard_paste"
meta-ctrl-M = "/input insert \n"
@ -494,10 +519,6 @@ meta-b = "/input move_previous_word"
meta-d = "/input delete_next_word"
meta-f = "/input move_next_word"
meta-h = "/input hotlist_clear"
meta-jmeta-f = "/buffer -"
meta-jmeta-l = "/buffer +"
meta-jmeta-r = "/server raw"
meta-jmeta-s = "/server jump"
meta-j01 = "/buffer *1"
meta-j02 = "/buffer *2"
meta-j03 = "/buffer *3"
@ -605,18 +626,9 @@ meta-p = "/window scroll_previous_highlight"
meta-r = "/input delete_line"
meta-s = "/mute spell toggle"
meta-u = "/window scroll_unread"
meta-wmeta-meta2-A = "/window up"
meta-wmeta-meta2-B = "/window down"
meta-wmeta-meta2-C = "/window right"
meta-wmeta-meta2-D = "/window left"
meta-wmeta2-1;3A = "/window up"
meta-wmeta2-1;3B = "/window down"
meta-wmeta2-1;3C = "/window right"
meta-wmeta2-1;3D = "/window left"
meta-wmeta-b = "/window balance"
meta-wmeta-s = "/window swap"
meta-x = "/input zoom_merged_buffer"
meta-z = "/window zoom"
ctrl-^ = "/input jump_last_buffer_displayed"
ctrl-_ = "/input undo"
[key_search]
@ -665,6 +677,10 @@ meta2-D = "/cursor move left"
@chat(fset.fset):button2* = "hsignal:fset_mouse"
@chat(fset.fset):wheeldown = "/fset -down 5"
@chat(fset.fset):wheelup = "/fset -up 5"
@chat(perl.iset):button1 = "hsignal:iset_mouse"
@chat(perl.iset):button2* = "hsignal:iset_mouse"
@chat(perl.iset):wheeldown = "/repeat 5 /iset **down"
@chat(perl.iset):wheelup = "/repeat 5 /iset **up"
@chat(script.scripts):button1 = "/window ${_window_number};/script go ${_chat_line_y}"
@chat(script.scripts):button2 = "/window ${_window_number};/script go ${_chat_line_y};/script installremove -q ${script_name_with_extension}"
@chat(script.scripts):wheeldown = "/script down 5"


+ 29
- 27
config/weechat/weechat.log View File

@ -1,27 +1,29 @@
[2021-04-07 00:54:24] WeeChat 3.1 (compiled on Mar 11 2021 22:01:30)
[2021-04-07 00:54:24] Reading configuration file sec.conf
[2021-04-07 00:54:24] Reading configuration file weechat.conf
[2021-04-07 00:54:24] Reading configuration file plugins.conf
[2021-04-07 00:54:24] Reading configuration file charset.conf
[2021-04-07 00:54:24] Reading configuration file logger.conf
[2021-04-07 00:54:24] Reading configuration file exec.conf
[2021-04-07 00:54:24] Reading configuration file trigger.conf
[2021-04-07 00:54:24] Reading configuration file spell.conf
[2021-04-07 00:54:24] Reading configuration file alias.conf
[2021-04-07 00:54:24] Reading configuration file buflist.conf
[2021-04-07 00:54:24] Reading configuration file fifo.conf
[2021-04-07 00:54:24] Reading configuration file xfer.conf
[2021-04-07 00:54:24] Reading configuration file irc.conf
[2021-04-07 00:54:24] Reading configuration file relay.conf
[2021-04-07 00:54:24] Reading configuration file perl.conf
[2021-04-07 00:54:24] Reading configuration file guile.conf
[2021-04-07 00:54:24] Reading configuration file python.conf
[2021-04-07 00:54:24] Reading configuration file colorize_nicks.conf
[2021-04-07 00:54:24] Reading configuration file autosort.conf
[2021-04-07 00:54:24] Writing configuration file autosort.conf
[2021-04-07 00:54:24] Reading configuration file lua.conf
[2021-04-07 00:54:24] Reading configuration file ruby.conf
[2021-04-07 00:54:24] Reading configuration file tcl.conf
[2021-04-07 00:54:24] Reading configuration file script.conf
[2021-04-07 00:54:25] Reading configuration file fset.conf
[2021-04-07 00:54:25] irc: connecting to server chat.freenode.net/6697 (SSL)...
[2021-04-08 15:27:31] WeeChat 3.1 (compiled on Mar 11 2021 22:01:30)
[2021-04-08 15:27:31] Reading configuration file sec.conf
[2021-04-08 15:27:31] Reading configuration file weechat.conf
[2021-04-08 15:27:31] Reading configuration file plugins.conf
[2021-04-08 15:27:31] Reading configuration file charset.conf
[2021-04-08 15:27:31] Reading configuration file logger.conf
[2021-04-08 15:27:31] Reading configuration file exec.conf
[2021-04-08 15:27:31] Reading configuration file trigger.conf
[2021-04-08 15:27:31] Reading configuration file spell.conf
[2021-04-08 15:27:31] Reading configuration file alias.conf
[2021-04-08 15:27:31] Reading configuration file buflist.conf
[2021-04-08 15:27:31] Reading configuration file fifo.conf
[2021-04-08 15:27:31] Reading configuration file xfer.conf
[2021-04-08 15:27:31] Reading configuration file irc.conf
[2021-04-08 15:27:31] Reading configuration file relay.conf
[2021-04-08 15:27:31] Reading configuration file perl.conf
[2021-04-08 15:27:31] Reading configuration file iset.conf
[2021-04-08 15:27:31] Reading configuration file guile.conf
[2021-04-08 15:27:31] Reading configuration file python.conf
[2021-04-08 15:27:31] Reading configuration file colorize_nicks.conf
[2021-04-08 15:27:31] Reading configuration file autosort.conf
[2021-04-08 15:27:31] Writing configuration file autosort.conf
[2021-04-08 15:27:31] Reading configuration file lua.conf
[2021-04-08 15:27:31] Reading configuration file ruby.conf
[2021-04-08 15:27:31] Reading configuration file tcl.conf
[2021-04-08 15:27:31] Reading configuration file script.conf
[2021-04-08 15:27:31] Reading configuration file fset.conf
[2021-04-08 15:27:31] irc: connecting to server chat.freenode.net/6697 (SSL)...
[2021-04-08 15:27:31] irc: connecting to server irc.oftc.net/6667...

BIN
config/weechat/weechat.upgrade View File


+ 2
- 2
config/weechat/xfer.conf View File

@ -22,8 +22,8 @@ status_done = lightgreen
status_failed = lightred
status_waiting = lightcyan
text = default
text_bg = default
text_selected = white
text_bg = 2
text_selected = black
[network]
blocksize = 65536


BIN
config/weechat/xfer.upgrade View File


+ 12
- 3
config/zsh/aliases View File

@ -11,13 +11,21 @@ alias g="git "
alias tmux="TERM=screen-256color-bce tmux"
alias t="tmux"
alias tn="tmux new -s "
alias tat="tmux a -t "
alias tat="tmux a -t "
alias yain="yay -Syu "
alias ls="ls --color"
alias yay="yay --sudoloop"
alias lf=lf-ueberzug
alias vim=nvim
alias weechat="tat weechat"
weechat(){
tmux has-session -t weechat 2> /dev/null
if [ $? != 0 ]; then
tmux new-session -s weechat weechat > /dev/null 2> /dev/null
else
tat weechat
fi
}
# Suffix aliases
alias -g G=" | rg"
@ -25,7 +33,7 @@ alias gshh="gcloud cloud-shell ssh --authorize-session"
# Git
alias ga="git add"
alias gcl="git clone --recursive"
alias gcl="git clone --recursive --depth=16"
alias gc="git commit"
alias gcm="git commit -m"
alias gp="git push"
@ -37,3 +45,4 @@ alias wget="wget --hsts-file=\"$XDG_CACHE_HOME/wget-hsts\""
alias yarn="yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/config"
alias tmate="tmate -f $XDG_CONFIG_HOME/tmate/tmate.conf"
alias mc="mc --config-dir=$XDG_CONFIG_HOME/mc"
alias abook="abook --config \"$XDG_CONFIG_HOME\"/abook/abookrc --datafile \"$XDG_DATA_HOME\"/abook/addressbook"

+ 1
- 0
local/bin/.gitignore View File

@ -62,3 +62,4 @@
!check-updates
!password_manager
!bwsync
!calsync

+ 9
- 0
local/bin/calsync View File

@ -0,0 +1,9 @@
#!/bin/bash
eval "$(grep -h -- \
"^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\|XDG_DATA_HOME\|XDG_CONFIG_HOME\)=" \
"$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \
"$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" "$HOME/.pam_environment" 2>/dev/null)"
CALCURSE_CALDAV_PASSWORD=$(pass show Server/drive.yigitcolakoglu.com/yigitcolakoglu)
calcurse-caldav

+ 1
- 1
local/bin/check-updates View File

@ -24,7 +24,7 @@ Check your internet connection, if pacman is already running, or run update manu
if pacman -Qu | grep -v "\[ignored\]"
then
checkupdates 2> /dev/null > ~/.cache/pacman_updates
notify " Repository Sync" "$(pacman -Qu | grep -v "\[ignored\]" | wc -l) Updates available. Click statusbar icon () for update."
notify " Repository Sync" "$(pacman -Qu | grep -v "\[ignored\]" | wc -l) Updates available. Click statusbar icon ( ) for update."
else
notify " Repository Sync" "Sync complete. No new packages for update."
fi


+ 14
- 10
local/bin/mailsync View File

@ -1,8 +1,5 @@
#!/bin/sh
export XDG_CONFIG_HOME="$HOME"/.config
export MBSYNCRC="$XDG_CONFIG_HOME"/isync/mbsyncrc
# - Syncs mail for all accounts, or a single account given as an argument.
# - Displays a notification showing the number of new mails.
# - Displays a notification for each new mail with its subject displayed.
@ -17,17 +14,19 @@ export MBSYNCRC="$XDG_CONFIG_HOME"/isync/mbsyncrc
# Run only if user logged in (prevent cron errors)
pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync will not run."; exit ;}
# Run only if not already running in other instance
pidof -s mbsync >/dev/null && { echo "mbsync is already running." ; exit ;}
pgrep -x mbsync >/dev/null && { echo "mbsync is already running." ; exit ;}
# First, we have to get the right variables for the mbsync file, the pass
# archive, notmuch and the GPG home. This is done by searching common profile
# files for variable assignments. This is ugly, but there are few options that
# will work on the maximum number of machines.
eval "$(grep -h -- \
"^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\)=" \
"^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\|XDG_DATA_HOME\|XDG_CONFIG_HOME\|XDG_RUNTIME_DIR)=" \
"$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \
"$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" "$HOME/.pam_environment" 2>/dev/null)"
sound=0
case "$(readlink -f /sbin/init)" in
*systemd*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;;
esac
@ -47,11 +46,15 @@ case "$(uname)" in
displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | sort -u)"
notify() { [ -n "$pgrepoutput" ] && for x in ${displays:-:0}; do
export DISPLAY=$x
notify-send --app-name="mutt-wizard" "ﯬ $2 new mail(s) in \`$1\` account."
notify-send --app-name="NeoMutt" " $2 new mail(s) in \`$1\` account."
if [ $sound = 0 ]; then
canberra-gtk-play -i message -V 25
sound=1
fi
done ;}
messageinfo() { [ -n "$pgrepoutput" ] && for x in ${displays:-:0}; do
export DISPLAY=$x
notify-send --app-name="mutt-wizard" " $from:" "$subject"
notify-send --app-name="NeoMutt" " $from:" "$subject"
done ;}
;;
esac
@ -60,11 +63,10 @@ esac
syncandnotify() {
acc="$(echo "$account" | sed "s/.*\///")"
if [ -z "$opts" ]; then mbsync "$acc"; else mbsync "$opts" "$acc"; fi
new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2> /dev/null)
new=$(find "$HOME/.local/share/mail/$acc/INBOX/new/" "$HOME/.local/share/mail/$acc/Inbox/new/" "$HOME/.local/share/mail/$acc/inbox/new/" -type f -newer "${XDG_CACHE_HOME:-$HOME/.cache}/.mailsynclastrun" 2> /dev/null)
newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l)
echo -n "$newcount" > ~/.cache/mcount
if [ "$newcount" -gt "0" ]; then
notify "$acc" "$newcount" &
notify "$acc" "$newcount" &
for file in $new; do
# Extract subject and sender from mail.
from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//')
@ -93,4 +95,6 @@ wait
notmuch new 2>/dev/null
touch "${XDG_CACHE_HOME:-$HOME/.cache}/.mailsynclastrun"
kill -57 $(pidof dwmblocks)

+ 1
- 3
local/bin/nextcloud-sync View File

@ -1,6 +1,6 @@
#!/bin/bash
source $HOME/.config/nextcloud/nextcloud
$HOME/.config/nextcloud/nextcloud
rm -rf $XDG_RUNTIME_DIR/nextcloud.out
rm -rf $XDG_RUNTIME_DIR/nextcloud.err
@ -14,5 +14,3 @@ done
echo $(date '+%R') > $HOME/.cache/nextcloud-track
kill -59 $(pidof dwmblocks)

+ 1
- 1
local/bin/status-bar/date View File

@ -30,7 +30,7 @@ if [ ! "$next" = "" ]; then
if [ "$(grep "$name" "$XDG_CACHE_HOME/calcurse")" = "" ]; then
time=$(calcurse -a | grep -E "\s*$name\$" -B 1 | head -n 1 | cut -c4-8)
echo "$name" > "$XDG_CACHE_HOME/calcurse"
canberra-gtk-play -i message -V 20
canberra-gtk-play -i bell -V 20
dunstify -a " Event approaching" "[$time] $name"
fi
fi


+ 2
- 5
profile View File

@ -59,7 +59,7 @@ export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc
export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
export SCREENRC="$XDG_CONFIG_HOME"/screen/screenrc
# Setup PATH
export PATH=$ANDROID_HOME/tools:$PATH
@ -81,7 +81,6 @@ export LF_ICONS
# Setup dbus
case "$(readlink -f /sbin/init)" in
*systemd*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;;
*) eval "$(dbus-launch --exit-with-session --sh-syntax)"
esac
# Setup SSH
@ -93,10 +92,8 @@ fi
# Start xinit if logged in from tty1
if [ "$DISPLAY" = "" ] && [ "$(tty)" = /dev/tty1 ]; then
if [ "$DBUS_SESSION_BUS_ADDRESS" = "" ] && [ ! $(command -v dbus-launch) = "" ]; then
sleep 1
exec xinit 2> $XDG_RUNTIME_DIR/xinit.err > $XDG_RUNTIME_DIR/xinit
exec dbus-launch --exit-with-session xinit 2> $XDG_RUNTIME_DIR/xinit.err > $XDG_RUNTIME_DIR/xinit
else
sleep 1
exec xinit 2> $XDG_RUNTIME_DIR/xinit.err > $XDG_RUNTIME_DIR/xinit
fi
exit


+ 21
- 0
suckless/paleofetch/logos/artix.h View File

@ -0,0 +1,21 @@
char *LOGO[] = {
" 'o' ",
" 'ooo' ",
" 'ooxoo' ",
" 'ooxxxoo' ",
" 'oookkxxoo' ",
" 'oiioxkkxxoo' ",
" ':;:iiiioxxxoo' ",
" `'.;::ioxxoo' ",
" '-. `':;jiooo' ",
" 'oooio-.. `'i:io' ",
" 'ooooxxxxoio:,. `'-;' ",
" 'ooooxxxxxkkxoooIi:-. `' ",
" 'ooooxxxxxkkkkxoiiiiiji' ",
" 'ooooxxxxxkxxoiiii:'` .i' ",
" 'ooooxxxxxoi:::'` .;ioxo' ",
" 'ooooxooi::'` .:iiixkxxo' ",
" 'ooooi:'` `'';ioxxo' ",
" 'i:'` '':io' ",
"'` `' "
};

+ 4
- 0
suckless/st/config.h View File

@ -124,6 +124,8 @@ static const char *colorname[] = {
/* special colors */
[256] = "#0f111a", /* background */
[257] = "#d8dee9", /* foreground */
/* More special colors */
};
/*
@ -225,6 +227,8 @@ static Shortcut shortcuts[] = {
{ MODKEY, XK_d, kscrolldown, {.i = -1} },
{ MODKEY, XK_k, kscrollup, {.i = 2} },
{ MODKEY, XK_j, kscrolldown, {.i = 2} },
{ MODKEY, XK_s, changealpha, {.f = -0.05} },
{ MODKEY, XK_a, changealpha, {.f = +0.05} },
};
/*


+ 15
- 0
suckless/st/x.c View File

@ -53,6 +53,7 @@ typedef struct {
/* function definitions used in config.h */
static void clipcopy(const Arg *);
static void clippaste(const Arg *);
static void changealpha(const Arg *);
static void numlock(const Arg *);
static void selpaste(const Arg *);
static void zoom(const Arg *);
@ -334,6 +335,20 @@ ttysend(const Arg *arg)
ttywrite(arg->s, strlen(arg->s), 1);
}
void
changealpha(const Arg *arg)
{
if((alpha > 0 && arg->f < 0) || (alpha < 1 && arg->f > 0))
alpha += arg->f;
if(alpha < 0)
alpha = 0;
if(alpha > 1)
alpha = 1;
xloadcols();
redraw();
}
int
evcol(XEvent *e)
{


Loading…
Cancel
Save