From 4a3d2a8ddaf4e546df360656bc54b2947bdb890b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 3 Jan 2021 00:55:29 +0100 Subject: gkleen@sif: import --- overlays/nerdfonts.nix | 5 +++++ overlays/pidgin.nix | 20 ++++++++++++++++++++ overlays/urxvt/52-osc.pl | 41 +++++++++++++++++++++++++++++++++++++++++ overlays/urxvt/default.nix | 21 +++++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 overlays/nerdfonts.nix create mode 100644 overlays/pidgin.nix create mode 100644 overlays/urxvt/52-osc.pl create mode 100644 overlays/urxvt/default.nix (limited to 'overlays') diff --git a/overlays/nerdfonts.nix b/overlays/nerdfonts.nix new file mode 100644 index 00000000..28581d72 --- /dev/null +++ b/overlays/nerdfonts.nix @@ -0,0 +1,5 @@ +final: prev: { + nerdfonts = prev.nerdfonts.override { + fonts = ["FiraMono" "FiraCode"]; + }; +} diff --git a/overlays/pidgin.nix b/overlays/pidgin.nix new file mode 100644 index 00000000..09103ade --- /dev/null +++ b/overlays/pidgin.nix @@ -0,0 +1,20 @@ +final: prev: +prev.lib.composeManyExtensions [ + (final: prev: + let + mucHistory = prev.fetchpatch { + url = "https://developer.pidgin.im/raw-attachment/ticket/16524/0001-only-request-unseed-chat-history-from-jabber-group-c.patch"; + sha256 = "083wvmq7417xz55fxxhllqwql1hgjvin2sak08844121yw1jvc44"; + }; + in { + pidgin = prev.pidgin.overrideAttrs (oldAttrs: { + patches = (oldAttrs.patches or []) ++ [mucHistory]; + }); + }) + (final: prev: { + pidgin-with-plugins = import (/. + prev.path + "/pkgs/applications/networking/instant-messengers/pidgin/wrapper.nix") { + inherit (prev) makeWrapper symlinkJoin pidgin; + plugins = with final; [ purple-lurch pidgin-carbons pidgin-opensteamworks pidgin-xmpp-receipts ]; + }; + }) +] final prev diff --git a/overlays/urxvt/52-osc.pl b/overlays/urxvt/52-osc.pl new file mode 100644 index 00000000..3292e8c4 --- /dev/null +++ b/overlays/urxvt/52-osc.pl @@ -0,0 +1,41 @@ +#! perl + +=head1 NAME + +52-osc - Implement OSC 32 ; Interact with X11 clipboard + +=head1 SYNOPSIS + + urxvt -pe 52-osc + +=head1 DESCRIPTION + +This extension implements OSC 52 for interacting with system clipboard + +Most code stolen from: +http://ailin.tucana.uberspace.de/static/nei/*/Code/urxvt/ + +=cut + +use MIME::Base64; +use Encode; + +sub on_osc_seq { + my ($term, $op, $args) = @_; + return () unless $op eq 52; + + my ($clip, $data) = split ';', $args, 2; + if ($data eq '?') { + # my $data_free = $term->selection(); + # Encode::_utf8_off($data_free); # XXX + # $term->tt_write("\e]52;$clip;".encode_base64($data_free, '')."\a"); + } + else { + my $data_decoded = decode_base64($data); + Encode::_utf8_on($data_decoded); # XXX + $term->selection($data_decoded, $clip =~ /c|^$/); + $term->selection_grab(urxvt::CurrentTime, $clip =~ /c|^$/); + } + + () +} diff --git a/overlays/urxvt/default.nix b/overlays/urxvt/default.nix new file mode 100644 index 00000000..3c57d000 --- /dev/null +++ b/overlays/urxvt/default.nix @@ -0,0 +1,21 @@ +final: prev: { + rxvt_unicode-with-plugins = prev.rxvt-unicode.override { + configure = { availablePlugins, ... }: { + plugins = [ final.urxvt_osc_52 ] ++ builtins.attrValues availablePlugins; + }; + }; + urxvt_osc_52 = prev.stdenv.mkDerivation { + name = "rxvt_unicode-osc_52-0"; + src = ./52-osc.pl; + unpackPhase = '' + cp $src 52-osc + ''; + buildPhase = '' + sed -i 's|#! perl|#! ${final.perl}/bin/perl|g' 52-osc + ''; + installPhase = '' + mkdir -p $out/lib/urxvt/perl + cp 52-osc $out/lib/urxvt/perl + ''; + }; +} -- cgit v1.2.3