diff --git a/bin/ala-fzf-pass.sh b/bin/ala-fzf-pass.sh new file mode 100755 index 0000000..f6c5e7f --- /dev/null +++ b/bin/ala-fzf-pass.sh @@ -0,0 +1,3 @@ +set -euo pipefail + +exec alacritty --class ala-fzf -e "$HOME/dotfiles/bin/fzf-pass-inner.sh" diff --git a/i3/spotify.sh b/i3/spotify.sh index deaeac6..e54d1bd 100755 --- a/i3/spotify.sh +++ b/i3/spotify.sh @@ -1,20 +1,3 @@ #!/bin/sh #Spotify -spotify_status(){ - current_track=$(playerctl -p spotify metadata xesam:title) - album=$(playerctl -p spotify metadata xesam:artist) - echo -e $album" - " $current_track -} - -spotify_control(){ - current_status=$(playerctl -p spotify status) - if echo $current_status | grep -q "Playing" - then echo "%{F#FF1DB954}%{A:i3-msg [class=Spotify] focus:}%{A}%{F-} %{A:playerctl -p spotify previous:}  %{A}%{A:playerctl -p spotify play-pause:} $(spotify_status) %{A}%{A:playerctl -p spotify next:}  %{A}" - elif echo $current_status | grep -q "Paused" - then echo "%{F#FF1DB954}%{A:i3-msg [class=Spotify] focus:}%{A}%{F-} %{A:playerctl -p spotify previous:}  %{A}%{A:playerctl -p spotify play-pause:}  $(spotify_status) %{A}%{A:playerctl -p spotify next:}  %{A}" - else - echo "" - fi -} - -spotify_control +exec playerctl metadata -f '{{emoji(status)}} {{xesam:artist}} - {{xesam:title}}' -F diff --git a/nix/.config/nixpkgs/overlays/02-extrapkgs.nix b/nix/.config/nixpkgs/overlays/02-extrapkgs.nix index 9ddc751..74b5c20 100644 --- a/nix/.config/nixpkgs/overlays/02-extrapkgs.nix +++ b/nix/.config/nixpkgs/overlays/02-extrapkgs.nix @@ -6,6 +6,7 @@ self: super: { nottetris2 = self.callPackage ../pkgs/nottetris2.nix {}; mailpile = self.callPackage ../pkgs/mailpile.nix {}; lejos = self.callPackage ../pkgs/lejos.nix {}; + playerctl = self.callPackage ../pkgs/playerctl.nix {}; libinput-gestures = super.libinput-gestures.override { extraUtilsPath = [ self.xdotool self.python3 ];}; diff --git a/nix/.config/nixpkgs/pkgs/alacritty.nix b/nix/.config/nixpkgs/pkgs/alacritty.nix new file mode 100644 index 0000000..4f15f05 --- /dev/null +++ b/nix/.config/nixpkgs/pkgs/alacritty.nix @@ -0,0 +1,108 @@ +{ stdenv, + lib, + fetchFromGitHub, + rustPlatform, + cmake, + makeWrapper, + ncurses, + expat, + pkgconfig, + freetype, + fontconfig, + libX11, + gzip, + libXcursor, + libXxf86vm, + libXi, + libXrandr, + libGL, + wayland, + libxkbcommon, + python3, + libxcb + # Darwin Frameworks + }: + +with rustPlatform; + +let + rpathLibs = [ + expat + freetype + fontconfig + libX11 + libXcursor + libXxf86vm + libXrandr + libGL + libXi + python3 + libxcb + ] ++ lib.optionals stdenv.isLinux [ + wayland + libxkbcommon + ]; +in buildRustPackage rec { + pname = "alacritty"; + version = "0.3.3-20190430"; + + src = fetchFromGitHub { + owner = "jwilm"; + repo = pname; + rev = "bc038f8295830cbd66851d308fd2963f2e0eb60c"; + sha256 = "14kjlilbkh589vb2xq2agw54blwn3vk0lxs0plkhnf3jrib3k6nd"; + }; + + cargoSha256 = "04mfdm0b7jj0mkchrzzq9bm99m5y9h4ajj848kkf679k5wfiqc12"; + + nativeBuildInputs = [ + cmake + makeWrapper + pkgconfig + ncurses + gzip + ]; + + buildInputs = rpathLibs; + + outputs = [ "out" "terminfo" ]; + + installPhase = '' + runHook preInstall + + install -D target/release/alacritty $out/bin/alacritty + + '' + (if stdenv.isDarwin then '' + mkdir $out/Applications + cp -r target/release/osx/Alacritty.app $out/Applications/Alacritty.app + '' else '' + install -D extra/linux/alacritty.desktop -t $out/share/applications/ + install -D extra/logo/alacritty-term.svg $out/share/icons/hicolor/scalable/apps/Alacritty.svg + patchelf --set-rpath "${stdenv.lib.makeLibraryPath rpathLibs}" $out/bin/alacritty + '') + '' + + install -D extra/completions/_alacritty -t "$out/share/zsh/site-functions/" + install -D extra/completions/alacritty.bash -t "$out/etc/bash_completion.d/" + install -D extra/completions/alacritty.fish -t "$out/share/fish/vendor_completions.d/" + + install -dm 755 "$out/share/man/man1" + gzip -c extra/alacritty.man > "$out/share/man/man1/alacritty.1.gz" + + install -dm 755 "$terminfo/share/terminfo/a/" + tic -x -o "$terminfo/share/terminfo" extra/alacritty.info + mkdir -p $out/nix-support + echo "$terminfo" >> $out/nix-support/propagated-user-env-packages + + runHook postInstall + ''; + + dontPatchELF = true; + + meta = with stdenv.lib; { + description = "GPU-accelerated terminal emulator"; + homepage = https://github.com/jwilm/alacritty; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ mic92 ]; + platforms = [ "x86_64-linux" "x86_64-darwin" ]; + }; +} diff --git a/nix/.config/nixpkgs/pkgs/playerctl.nix b/nix/.config/nixpkgs/pkgs/playerctl.nix new file mode 100644 index 0000000..6ece819 --- /dev/null +++ b/nix/.config/nixpkgs/pkgs/playerctl.nix @@ -0,0 +1,28 @@ +{ stdenv, meson, ninja, fetchFromGitHub, glib, pkgconfig, gobjectIntrospection }: + +stdenv.mkDerivation rec { + name = "playerctl-${version}"; + version = "2.0.1"; + + src = fetchFromGitHub { + owner = "acrisci"; + repo = "playerctl"; + rev = "v${version}"; + sha256 = "0j1fvcc80307ybl1z9l752sr4bcza2fmb8qdivpnm4xmm82faigb"; + }; + + nativeBuildInputs = [ meson ninja pkgconfig gobjectIntrospection ]; + buildInputs = [ glib ]; + + # docs somehow crashes the install phase: + # https://github.com/acrisci/playerctl/issues/85 + mesonFlags = [ "-Dgtk-doc=false" ]; + + meta = with stdenv.lib; { + description = "Command-line utility and library for controlling media players that implement MPRIS"; + homepage = https://github.com/acrisci/playerctl; + license = licenses.lgpl3; + platforms = platforms.unix; + maintainers = with maintainers; [ puffnfresh ]; + }; +} diff --git a/nix/.config/nixpkgs/pkgs/pyroscope/default.nix b/nix/.config/nixpkgs/pkgs/pyroscope/default.nix index 7385217..49d0eb5 100644 --- a/nix/.config/nixpkgs/pkgs/pyroscope/default.nix +++ b/nix/.config/nixpkgs/pkgs/pyroscope/default.nix @@ -1,40 +1,35 @@ -let pkgs = import {}; -in -{ fetchurl ? pkgs.fetchurl, - fetchFromGitHub ? pkgs.fetchFromGitHub, - python27Packages ? pkgs.python27Packages }: - -with python27Packages; +{ fetchurl, fetchFromGitHub, python2Packages }: +with python2Packages; let ProxyTypes = buildPythonPackage rec { - name = "ProxyTypes-0.9"; - src = pkgs.fetchurl { - url = "https://pypi.python.org/packages/72/bd/24f45710e7e6909b2129332363be2c981179ed2eda1166f18bc2baef98a1/${name}.zip"; - sha256 = "03zfq1ib23dc9rq759n43ri2ki6841yjisdcb59jvp5dqww5bcr0"; - }; - + pname = "ProxyTypes"; + version = "0.10.0"; + src = fetchPypi { + inherit pname version; + sha256 = "11cr6c39vq9fky4c4h2ai2v2dva8fk4cfhaja0mrh4y9wzal3k42"; + }; }; pyrobase = buildPythonApplication rec { - name = "pyrobase-0.3"; + pname = "pyrobase"; + version = "0.5.2"; src = fetchFromGitHub { - repo = "pyrobase"; owner = "pyroscope"; - rev = "cf64da5d89df1c1174e0184c63a51a46f2f955fd"; - sha256 = "12qn1gx64byi76kkx8p7y5gdrq016fw2s23l4yik0q1hdg2b99y8"; + repo = pname; owner = "pyroscope"; + rev = "v${version}"; + sha256 = "170lsls3dmhlfa5abk40l365pk8486w48vkxjgs3pnqnhpp67z18"; }; doCheck = false; - patches = [./fix_readme.diff]; - buildInputs = [paver]; + buildInputs = [six paver]; }; in buildPythonApplication rec { - name = "pyrocore-0.4.3"; + pname = "pyrocore"; + version = "0.5.3"; src = fetchFromGitHub { - repo = "pyrocore"; owner = "pyroscope"; - rev = "a8d81af33959333a42a95714631c69870b717329"; - sha256 = "1fvahnkhh4nj7qy9m4j2c0djmf4ichy29s7b9wkn7ivhlcgv9hs0"; + repo = pname; owner = "pyroscope"; + rev = "v${version}"; + sha256 = "0yg11nhrx8jzx8g09npf0pcpiscyh35nahhw473mir418plji5jw"; }; - doCheck = false; - buildInputs = [python27Packages.paver]; - propagatedBuildInputs = [pyrobase ProxyTypes]; + buildInputs = [paver]; + propagatedBuildInputs = [six pyrobase ProxyTypes]; }