diff options
author | lassulus <lassulus@lassul.us> | 2020-09-15 20:16:44 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2020-09-15 20:16:44 +0200 |
commit | 624deaddd03101890d2974fc9340a26c00051bf3 (patch) | |
tree | 32b0f765be65385f092dff92ae09285a29a4845e /makefu/5pkgs | |
parent | 91b7a2a58490a59d6090870a9db9eca8d11d9ab4 (diff) | |
parent | 57e6296ac4ca6b600f9e57b2c347f413096d09ed (diff) |
Merge remote-tracking branch 'gum/master' into HEAD
Diffstat (limited to 'makefu/5pkgs')
-rw-r--r-- | makefu/5pkgs/awesomecfg/full.cfg | 21 | ||||
-rw-r--r-- | makefu/5pkgs/chapter-marker/default.nix | 9 | ||||
-rw-r--r-- | makefu/5pkgs/nsrenamer/default.nix | 3 | ||||
-rwxr-xr-x | makefu/5pkgs/nsrenamer/nsrenamer.sh | 58 |
4 files changed, 83 insertions, 8 deletions
diff --git a/makefu/5pkgs/awesomecfg/full.cfg b/makefu/5pkgs/awesomecfg/full.cfg index d96b61ad6..86b401cfa 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 fe3e48142..5ffb63ae9 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/nsrenamer/default.nix b/makefu/5pkgs/nsrenamer/default.nix new file mode 100644 index 000000000..16b9a4f20 --- /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 000000000..16aec3113 --- /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 + |