From e203311de813949dec992b76b04410068768eaf5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 10 Mar 2021 21:21:55 +0100 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- accounts/gkleen@sif/default.nix | 59 +++++++++++++++++++++++++++++----- accounts/gkleen@sif/dunst-settings.nix | 3 ++ accounts/gkleen@sif/emacs.el | 7 ++++ accounts/gkleen@sif/scripts/mute.zsh | 18 +++++++++++ accounts/gkleen@sif/ssh-hosts.nix | 22 +++++++++---- accounts/gkleen@sif/xmobar/xmobar.hs | 2 +- accounts/gkleen@sif/xmonad/xmonad.hs | 7 ++-- 7 files changed, 100 insertions(+), 18 deletions(-) create mode 100755 accounts/gkleen@sif/scripts/mute.zsh (limited to 'accounts/gkleen@sif') diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 9dbe4634..991d7f7f 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -10,6 +10,43 @@ let mimeType = "text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;"; exec = "${config.home-manager.users.${userName}.programs.emacs.package}/bin/emacsclient -a \"\" %F"; }; + emacsScratch = pkgs.stdenv.mkDerivation rec { + pname = "scratch"; + version = "0077334cc299aa7885f804d88f52cdb1b35caf71"; + + src = pkgs.fetchFromGitHub { + owner = "ffevotte"; + repo = "scratch.el"; + rev = version; + sha256 = "sha256-FUkKJ+1COGzgllzzv51yUIjMZI6slOFVExdwWl2ZEBA="; + }; + + phases = [ "installPhase" ]; + + installPhase = '' + mkdir -p $out/share/emacs/site-lisp + cp $src/scratch.el $out/share/emacs/site-lisp/default.el + ''; + }; + muteScript = pkgs.stdenv.mkDerivation { + name = "mute"; + src = ./scripts/mute.zsh; + + buildInputs = with pkgs; [ makeWrapper ]; + + phases = [ "installPhase" ]; + + installPhase = '' + mkdir -p $out/bin + install -m 0755 $src $out/bin/mute + wrapProgram $out/bin/mute \ + --prefix PATH : ${pkgs.zsh}/bin \ + --prefix PATH : ${pkgs.findutils}/bin \ + --prefix PATH : ${pkgs.util-linux}/bin \ + --prefix PATH : ${pkgs.coreutils}/bin \ + --prefix PATH : ${pkgs.pulseaudio}/bin + ''; + }; in { imports = with flake.nixosModules.userProfiles.${userName}; [ mpv @@ -20,8 +57,8 @@ in { ssh = { matchBlocks = import ./ssh-hosts.nix; # customUtils.recImport { dir = ./ssh-hosts; }; extraConfig = '' - Match host uniworx3.ifi.lmu.de,uniworx4.ifi.lmu.de,uni2workgw.ifi.lmu.de,blackbeard.tcs.ifi.lmu.de,gitlab2.rz.ifi.lmu.de,oregon.tcs.ifi.lmu.de !exec "nc -z -w 1 %h %p &>/dev/null" - ProxyJump gate + Match host uniworx3.ifi.lmu.de,uniworx4.ifi.lmu.de,uniworx5.ifi.lmu.de,uni2workgw.ifi.lmu.de,blackbeard.tcs.ifi.lmu.de,gitlab2.rz.ifi.lmu.de,oregon.tcs.ifi.lmu.de !exec "nc -z -w 1 %h %p &>/dev/null" + ProxyJump gate2 Host * ''; @@ -33,8 +70,8 @@ in { evil evil-dvorak evil-magit undo-tree magit haskell-mode nix-mode yaml-mode json-mode shakespeare-mode smart-mode-line highlight-parentheses highlight-symbol - notmuch ag sass-mode lua-mode fira-code-mode - use-package use-package-ensure-system-package git-gutter + notmuch ag sass-mode lua-mode fira-code-mode use-package + use-package-ensure-system-package git-gutter emacsScratch ]; }; firefox = { @@ -97,12 +134,18 @@ in { docs = "$HOME/documents"; dl = "$HOME/Downloads"; flk = "$HOME/config/nixos-flakes"; + fsk-timi = "$HOME/projects/21s/fsk-timi"; + }; + + obs-studio = { + enable = true; + plugins = with pkgs; [obs-v4l2sink]; }; }; services = { dunst = { - settings = import ./dunst-settings.nix; + settings = import ./dunst-settings.nix inputs; iconTheme = cfg.gtk.iconTheme; enable = true; }; @@ -130,8 +173,8 @@ in { sxhkd = { enable = true; keybindings = { - "button8" = "${pkgs.pulseaudio}/bin/pacmd set-source-mute @DEFAULT_SOURCE@ 0"; - "@button8" = "${pkgs.pulseaudio}/bin/pacmd set-source-mute @DEFAULT_SOURCE@ 1"; + "button8" = "${muteScript}/bin/mute unmute"; + "@button8" = "${muteScript}/bin/mute mute"; "button9" = "${pkgs.pulseaudio}/bin/pacmd set-sink-mute @DEFAULT_SINK@ 1"; "@button9" = "${pkgs.pulseaudio}/bin/pacmd set-sink-mute @DEFAULT_SINK@ 0"; }; @@ -179,7 +222,7 @@ in { google-play-music-desktop-player qt5ct playerctl evince thunderbird zulip zoom-us steam steam-run wireshark skype virt-manager rclone cached-nix-shell xournal discord xmonad - worktime fira-code-symbols emacsclientDesktopItem + worktime fira-code-symbols emacsclientDesktopItem libreoffice ]; file = { diff --git a/accounts/gkleen@sif/dunst-settings.nix b/accounts/gkleen@sif/dunst-settings.nix index 8319da03..8abdfc5a 100644 --- a/accounts/gkleen@sif/dunst-settings.nix +++ b/accounts/gkleen@sif/dunst-settings.nix @@ -1,3 +1,4 @@ +{ pkgs, ... }: { global = { font = "Monospace 6"; @@ -25,6 +26,8 @@ icon_position = "right"; sort = false; sticky_history = false; + + dmenu = "${pkgs.dmenu}/bin/dmenu"; }; shortcuts = { close = "ctrl+space"; diff --git a/accounts/gkleen@sif/emacs.el b/accounts/gkleen@sif/emacs.el index d7080e36..c8356bf2 100644 --- a/accounts/gkleen@sif/emacs.el +++ b/accounts/gkleen@sif/emacs.el @@ -31,6 +31,13 @@ (custom-set-variables '(git-gutter:update-interval 2)) (custom-set-variables '(git-gutter:hide-gutter t)) +;; (require 'scratch) +(global-set-key (kbd "C-x B") 'scratch-create) +(setq initial-major-mode 'scratch-mode) +(setq initial-scratch-message "") + +(global-set-key (kbd "C-x K") 'kill-current-buffer) + (setq backup-directory-alist `(("." . "~/.saves"))) (setq undo-tree-history-directory-alist `(("." . "~/.undo"))) (setq delete-old-versions t diff --git a/accounts/gkleen@sif/scripts/mute.zsh b/accounts/gkleen@sif/scripts/mute.zsh new file mode 100755 index 00000000..1b30ad67 --- /dev/null +++ b/accounts/gkleen@sif/scripts/mute.zsh @@ -0,0 +1,18 @@ +#!/usr/bin/env zsh + +lockFile=~/.mute.flock + +case $1 in + mute) + ( + flock -n 9 || exit 1 + sleep 0.2 + pacmd set-source-mute @DEFAULT_SOURCE@ 1 + ) 9<>${lockFile} & + ;; + unmute) + set -o pipefail + while fuser ${lockFile} 2>/dev/null | cut -d ':' -f 2- | xargs -r -- kill; do sleep 0.001; done + pacmd set-source-mute @DEFAULT_SOURCE@ 0 + ;; +esac diff --git a/accounts/gkleen@sif/ssh-hosts.nix b/accounts/gkleen@sif/ssh-hosts.nix index 8937e743..0db4e342 100644 --- a/accounts/gkleen@sif/ssh-hosts.nix +++ b/accounts/gkleen@sif/ssh-hosts.nix @@ -77,7 +77,10 @@ port = 30363; identityFile = "~/.ssh/testworx"; }; - "remote.cip.ifi.lmu.de".user = "kleen"; + "remote.cip.ifi.lmu.de" = + { user = "kleen"; + identityFile = "~/.ssh/gkleen@sif.midgard.yggdrasil"; + }; "uniworx3" = { hostname = "uniworx3.ifi.lmu.de"; user = "root"; @@ -93,15 +96,14 @@ user = "root"; identityFile = "~/.ssh/uni2work"; }; - "uniworxdb" = - { hostname = "uniworxdb"; + "uniworxdb2" = + { hostname = "uniworxdb2"; proxyJump = "uniworx4"; user = "root"; identityFile = "~/.ssh/uni2work"; }; - "uniworxdb2" = - { hostname = "uniworxdb2"; - proxyJump = "uniworx4"; + "uniworx5" = + { hostname = "uniworx5.ifi.lmu.de"; user = "root"; identityFile = "~/.ssh/uni2work"; }; @@ -109,12 +111,14 @@ { hostname = "gate2.tcs.ifi.lmu.de"; user = "gkleen"; identityFile = "~/.ssh/tcs"; + serverAliveInterval = 0; }; "proxy.gate2" = { hostname = "gate2.tcs.ifi.lmu.de"; user = "gkleen"; identityFile = "~/.ssh/proxy.gkleen@tcs.ifi.lmu.de"; dynamicForwards = [ { port = 8118; } ]; + serverAliveInterval = 0; extraOptions = { ExitOnForwardFailure = "yes"; }; @@ -123,6 +127,7 @@ { hostname = "gate2.tcs.ifi.lmu.de"; user = "gkleen"; identityFile = "~/.ssh/proxy.gkleen@tcs.ifi.lmu.de"; + serverAliveInterval = 0; extraOptions = { ExitOnForwardFailure = "yes"; }; @@ -196,4 +201,9 @@ { hostname = "gitlab.haskell.org"; identityFile = "~/.ssh/gkleen@gitlab.haskell.org"; }; + "gitlab.lrz.de" = + { hostname = "gitlab.lrz.de"; + user = "git"; + identityFile = "~/.ssh/gkleen@gitlab.lrz.de"; + }; } diff --git a/accounts/gkleen@sif/xmobar/xmobar.hs b/accounts/gkleen@sif/xmobar/xmobar.hs index ed1f6e55..74ce7347 100644 --- a/accounts/gkleen@sif/xmobar/xmobar.hs +++ b/accounts/gkleen@sif/xmobar/xmobar.hs @@ -10,7 +10,7 @@ main = xmobar config { font = "xft:FiraCode Nerd Font Mono:style=Regular:pixelsize=21" , position = OnScreen 0 $ TopP 0 307 , bgColor = "black" - , fgColor = "grey" + , fgColor = "#808080" , overrideRedirect = False , template = let left = intercalate " | " diff --git a/accounts/gkleen@sif/xmonad/xmonad.hs b/accounts/gkleen@sif/xmonad/xmonad.hs index 7113b4e3..425beaf4 100644 --- a/accounts/gkleen@sif/xmonad/xmonad.hs +++ b/accounts/gkleen@sif/xmonad/xmonad.hs @@ -234,6 +234,7 @@ hostFromName h -- , (xK_p, [mkPassPrompt "Type password" pwType xPConfig, mkPassPrompt "Show password" pwShow xPConfig, mkPassPrompt "Copy password" pwClip xPConfig]) , (xK_w, ["sudo rewacom"]) , (xK_y, [ "tmux new-window -dt media /var/media/link.hs $(xclip -o)" + , "tmux new-window -dt media /var/media/download.hs $(xclip -o)" , "urxvtc -name media -e tmuxp load /var/media" ]) , (xK_l, [ "tmux new-window -dt media mpv $(xclip -o)" @@ -548,10 +549,10 @@ main = do sqrtTwo = approxRational (sqrt 2) (1 / 2560) xmobarPP' = xmobarPP { ppTitle = shorten 80 , ppSort = (liftM2 (.)) getSortByIndex $ return scratchpadFilterOutWorkspace - , ppUrgent = wrap "(" ")" . xmobarColor "red" "" + , ppUrgent = wrap "(" ")" . xmobarColor "#800000" "" , ppHiddenNoWindows = xmobarColor "#202020" "" . wrap "(" ")" - , ppVisible = wrap "(" ")" . xmobarColor "yellow" "" - , ppCurrent = wrap "(" ")" . xmobarColor "green" "" + , ppVisible = wrap "(" ")" . xmobarColor "#808000" "" + , ppCurrent = wrap "(" ")" . xmobarColor "#008000" "" , ppHidden = wrap "(" ")" , ppWsSep = " " , ppSep = "\n" -- cgit v1.2.3