summaryrefslogtreecommitdiffstats
path: root/makefu/5pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/5pkgs')
-rw-r--r--makefu/5pkgs/awesomecfg/default.nix4
-rw-r--r--makefu/5pkgs/awesomecfg/full.cfg21
-rw-r--r--makefu/5pkgs/chapter-marker/default.nix9
-rw-r--r--makefu/5pkgs/kalauerbot/default.nix18
-rw-r--r--makefu/5pkgs/kalauerbot/matrixbot.patch12
-rw-r--r--makefu/5pkgs/kalauerbot/python-matrixbot.nix31
-rw-r--r--makefu/5pkgs/kalauerbot/translate.patch17
-rw-r--r--makefu/5pkgs/nsrenamer/default.nix3
-rwxr-xr-xmakefu/5pkgs/nsrenamer/nsrenamer.sh58
-rw-r--r--makefu/5pkgs/tt-rss/default.nix25
10 files changed, 189 insertions, 9 deletions
diff --git a/makefu/5pkgs/awesomecfg/default.nix b/makefu/5pkgs/awesomecfg/default.nix
index 1ae2f50d..acbe61f3 100644
--- a/makefu/5pkgs/awesomecfg/default.nix
+++ b/makefu/5pkgs/awesomecfg/default.nix
@@ -6,15 +6,17 @@
, blueman
, clipit
, flameshot
+, chapter-marker
, modkey ? "Mod4"
, locker? "${pkgs.xlock}/bin/xlock -mode blank"
, ... }:
{
- # replace: @alsaUtils@ @xlockmore@ @xbacklight@ @modkey@
+ # replace: @alsaUtils@ @xlockmore@ @xbacklight@ @modkey@ @chapter-marker@
full = lib.makeOverridable pkgs.substituteAll {
name = "awesome_full_config";
inherit alsaUtils locker xbacklight modkey networkmanagerapplet blueman clipit flameshot ;
+ chaptermarker = chapter-marker;
isExecutable = false;
src = ./full.cfg;
};
diff --git a/makefu/5pkgs/awesomecfg/full.cfg b/makefu/5pkgs/awesomecfg/full.cfg
index d96b61ad..86b401cf 100644
--- a/makefu/5pkgs/awesomecfg/full.cfg
+++ b/makefu/5pkgs/awesomecfg/full.cfg
@@ -376,6 +376,12 @@ globalkeys = awful.util.table.join(
awful.key({ }, "XF86AudioMute", function ()
awful.util.spawn("@alsaUtils@/bin/amixer -q -D default sset Master toggle", false) end),
+ -- chapter-marker
+ awful.key({ "Control" }, "u", function () awful.spawn("@chaptermarker@/bin/chapter-start") end,
+ {description = "start the chapter marker",}),
+ awful.key({ "Control" }, "j", function () awful.spawn("@chaptermarker@/bin/chapter-mark") end,
+ {description = "create a chapter mark",}),
+
-- Prompt
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
{description = "run prompt", group = "launcher"}),
@@ -492,9 +498,16 @@ awful.rules.rules = {
properties = { floating = true } },
--{ rule = { class = "gimp" },
-- properties = { floating = true } },
- -- Set Firefox to always map on tags number 2 of screen 1.
- -- { rule = { class = "Firefox" },
- -- properties = { tag = tags[1][2] } },
+ { rule = { class = "Firefox" },
+ properties = { tag = tags[3] } },
+ { rule = { class = "signal-desktop" },
+ properties = { tag = tags[4] } },
+ { rule = { class = "telegram-desktop" },
+ properties = { tag = tags[4] } },
+ { rule = { class = "mutt" },
+ properties = { tag = tags[5] } },
+ { rule = { class = "mosh" },
+ properties = { tag = tags[2] } },
}
-- }}}
@@ -569,7 +582,7 @@ local os = {
-- {{{ autostart
do
- awful.spawn("urxvt", { tag = tags[1] }) -- dev shell
+ -- awful.spawn("urxvt", { tag = tags[1] }) -- dev shell
awful.spawn("urxvt -e mosh makefu@gum.i", { tag = tags[2] })
awful.spawn("firefox", { tag = tags[3] })
awful.spawn("telegram-desktop", { tag = tags[4] })
diff --git a/makefu/5pkgs/chapter-marker/default.nix b/makefu/5pkgs/chapter-marker/default.nix
index fe3e4814..5ffb63ae 100644
--- a/makefu/5pkgs/chapter-marker/default.nix
+++ b/makefu/5pkgs/chapter-marker/default.nix
@@ -1,4 +1,4 @@
-{ coreutils, fetchFromGitHub, makeWrapper, xdotool, stdenv, ... }:
+{ coreutils, fetchFromGitHub, makeWrapper, xclip, libnotify, stdenv, ... }:
stdenv.mkDerivation rec {
name = "chapter-marker-${version}";
@@ -6,8 +6,8 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "makefu";
repo = "chapter-marker";
- rev = "7602b611fb3d67fdb8a86db23220074dfa9dfa1e";
- sha256 = "0cwh650c3qhdrcvrqfzgrwpsnj4lbq64fw2sfwvnbxz94b4q36av";
+ rev = "71b9bb8bc4d6fa87de6bea8f42d5486d05cf5443";
+ sha256 = "13cvk24pwwyv9i21h57690s5niwkcrcvn8l24zfxwbgq0wwzw38x";
};
buildInputs = [ makeWrapper ];
@@ -16,7 +16,8 @@ stdenv.mkDerivation rec {
let
path = stdenv.lib.makeBinPath [
coreutils
- xdotool
+ libnotify
+ xclip
];
in
''
diff --git a/makefu/5pkgs/kalauerbot/default.nix b/makefu/5pkgs/kalauerbot/default.nix
new file mode 100644
index 00000000..2cecbc3f
--- /dev/null
+++ b/makefu/5pkgs/kalauerbot/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, python3, fetchgit }:
+python3.pkgs.buildPythonPackage rec {
+name = "kalauerbot";
+rev = "08d98aa";
+ src = fetchgit {
+ url = "http://cgit.euer.krebsco.de/kalauerbot";
+ inherit rev;
+ sha256 = "017hh61smgq4zsxd10brgwmykwgwabgllxjs31xayvs1hnqmkv2v";
+ };
+ propagatedBuildInputs = with python3.pkgs;[
+ (callPackage ./python-matrixbot.nix {})
+ (stdenv.lib.overrideDerivation googletrans (self: {
+ patches = [ ./translate.patch ];
+ }))
+ ];
+ checkInputs = [ python3.pkgs.black ];
+}
+
diff --git a/makefu/5pkgs/kalauerbot/matrixbot.patch b/makefu/5pkgs/kalauerbot/matrixbot.patch
new file mode 100644
index 00000000..2b9bbbea
--- /dev/null
+++ b/makefu/5pkgs/kalauerbot/matrixbot.patch
@@ -0,0 +1,12 @@
+diff --git a/matrixbot/matrixbot.py b/matrixbot/matrixbot.py
+index 8e5598c..d8c23d2 100644
+--- a/matrixbot/matrixbot.py
++++ b/matrixbot/matrixbot.py
+@@ -51,7 +51,6 @@ class MatrixBot:
+ self.user = None
+ if self.token is not None and self.user_id is not None:
+ self.user = self.client.get_user(self.user_id)
+- self.user.set_display_name(self.display_name)
+ self.init_rooms(self.client.rooms)
+ self.invite_listener = self.client.add_invite_listener(self.handle_invite)
+ self.cache = Cache(dbfile=cache_db)
diff --git a/makefu/5pkgs/kalauerbot/python-matrixbot.nix b/makefu/5pkgs/kalauerbot/python-matrixbot.nix
new file mode 100644
index 00000000..7bc5aa7f
--- /dev/null
+++ b/makefu/5pkgs/kalauerbot/python-matrixbot.nix
@@ -0,0 +1,31 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, markdown
+, matrix-client
+}:
+
+buildPythonPackage rec {
+ pname = "python-matrixbot";
+ version = "0.0.7";
+ CI_COMMIT_TAG = version;
+
+ #src = ./python-matrixbot;
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "9412981b14ff3ab7ffbb1bfc1691758113ab8d71f731b3093d8808c286b69c71";
+ };
+ patches = [ ./matrixbot.patch ];
+
+ propagatedBuildInputs = [
+ markdown
+ matrix-client
+ ];
+
+ meta = with lib; {
+ description = "A basic bot for Matrix";
+ homepage = https://gitlab.com/gibberfish/python-matrixbot;
+ license = licenses.mit;
+ # maintainers = [ maintainers. ];
+ };
+}
diff --git a/makefu/5pkgs/kalauerbot/translate.patch b/makefu/5pkgs/kalauerbot/translate.patch
new file mode 100644
index 00000000..6ff82072
--- /dev/null
+++ b/makefu/5pkgs/kalauerbot/translate.patch
@@ -0,0 +1,17 @@
+diff --git a/googletrans/client.py b/googletrans/client.py
+index 89c2237..c203b44 100644
+--- a/googletrans/client.py
++++ b/googletrans/client.py
+@@ -190,6 +190,13 @@ class Translator(object):
+ pass
+ if not PY3 and isinstance(pron, unicode) and isinstance(origin, str): # pragma: nocover
+ origin = origin.decode('utf-8')
++
++ if pron is None:
++ try:
++ pron = data[0][2][2]
++ except: # pragma: nocover
++ pass
++
+ if dest in EXCLUDES and pron == origin:
+ pron = translated
diff --git a/makefu/5pkgs/nsrenamer/default.nix b/makefu/5pkgs/nsrenamer/default.nix
new file mode 100644
index 00000000..16b9a4f2
--- /dev/null
+++ b/makefu/5pkgs/nsrenamer/default.nix
@@ -0,0 +1,3 @@
+{ pkgs,... }:
+# TODO: dependencies: coreutils, nx_game_info,
+pkgs.writeScriptBin "nsrenamer" (builtins.readFile ./nsrenamer.sh)
diff --git a/makefu/5pkgs/nsrenamer/nsrenamer.sh b/makefu/5pkgs/nsrenamer/nsrenamer.sh
new file mode 100755
index 00000000..16aec311
--- /dev/null
+++ b/makefu/5pkgs/nsrenamer/nsrenamer.sh
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+set -euf
+indir=$(dirname "$1")
+inname=$(basename "$1")
+out=$(nxgameinfo_cli "$1")
+ext=${1##*.}
+id=$(awk -F: '/├ Title ID:/{print $2}' <<<"$out" |xargs)
+baseid=$(awk -F: '/Base Title ID:/{print $2}' <<<"$out" |xargs)
+version=$(awk -F: '/├ Version:/{print $2}' <<<"$out" |xargs)
+name=$(awk -F: '/Title Name/{print $2}' <<<"$out" | sed "s/[:']//g" | xargs )
+type=$(awk -F: '/Type:/{print $2}' <<<"$out" | xargs)
+
+! test -n "$id" && echo "Title ID cannot be empty!" && exit 1
+! test -n "$type" && echo "type cannot be empty!" && exit 1
+
+if test "$type" == Base;then
+ ! test -n "$name" && echo "Title Name cannot be empty!" && exit 1
+ NAME="$name [$id][v$version].$ext"
+elif test "$type" == Update;then
+ ! test -n "$name" && echo "Title Name cannot be empty!" && exit 1
+ ! test -n "$version" && echo "Version cannot be empty!" && exit 1
+ NAME="$name [UPD][$id][v$version].$ext"
+elif test "$type" == DLC;then
+ dlcname=$(jq -r --arg id "$id" '.[$id].name' < ~/.switch/titles.US.en.json | sed "s/[:']//g")
+ if test -n "$dlcname" ;then
+ NAME="$dlcname [DLC][$id][v$version].$ext"
+ else
+ ! test -n "$name" && echo "dlcname cannot be found in titles.US.en.json and $name is empty!" && exit 1
+ NAME="$dlcname [DLC][$id][v$version].$ext"
+ fi
+else
+ echo "unknown type '$type'"
+ exit 1
+fi
+newname=$indir/$NAME
+
+if test "$NAME" == "${inname}";then
+ echo "name didn't change,doing nothing"
+ exit 0
+fi
+if test -e "$newname" ;then
+ echo "'$NAME' already exists, will not override"
+ exit 1
+fi
+
+if test -n "${FORCE:-}" ;then
+ CONFIRM=y
+else
+ read -p "rename '$inname' to '$NAME' - [y/N]" CONFIRM
+fi
+
+if test -n "${FORCE:-}" -o "$CONFIRM" == "y" -o "$CONFIRM" == "Y";then
+ mv -nv "$1" "$newname"
+else
+ echo "bailing out"
+ exit 1
+fi
+
diff --git a/makefu/5pkgs/tt-rss/default.nix b/makefu/5pkgs/tt-rss/default.nix
new file mode 100644
index 00000000..4907a73a
--- /dev/null
+++ b/makefu/5pkgs/tt-rss/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+ pname = "tt-rss";
+ version = "2020-09-23";
+ rev = "d0ed7890df";
+
+ src = fetchurl {
+ url = "https://git.tt-rss.org/git/tt-rss/archive/${rev}.tar.gz";
+ sha256 = "1b2fczd41bqg9bq37r99svrqswr9qrp35m6gn3nz032yqcwc22ij";
+ };
+
+ installPhase = ''
+ mkdir $out
+ cp -ra * $out/
+ '';
+
+ meta = with stdenv.lib; {
+ description = "Web-based news feed (RSS/Atom) aggregator";
+ license = licenses.gpl2Plus;
+ homepage = "https://tt-rss.org";
+ maintainers = with maintainers; [ globin zohl ];
+ platforms = platforms.all;
+ };
+}