From b81598ccd93ed2583ce6e9366184992b6f41a177 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 3 Jan 2023 16:58:37 +0100 Subject: tv alacritty: mkdir and cp only when needed --- tv/5pkgs/simple/alacritty-tv.nix | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index d80c46cbb..fd4dec9ec 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -51,6 +51,20 @@ let scrolling.multiplier = 8; }; config-file = pkgs.writeJSON "alacritty-tv.json" config; + profile = pkgs.writeText "alacritty-tv.profile" /* sh */ '' + # Use home so Alacritty can find the configuration without arguments. + # HOME will be reset once in Alacritty. + HOME=$TMPDIR/Alacritty + export HOME + + # Install stored configuration if it has changed. + # This allows for both declarative updates and runtime modifications. + ${pkgs.coreutils}/bin/mkdir -p "$HOME" + if test "$(${pkgs.coreutils}/bin/cat "$HOME"/ref)" != ${config-file}; then + echo ${config-file} > "$HOME"/ref + ${pkgs.coreutils}/bin/cp ${config-file} "$HOME"/.alacritty.yml + fi + ''; in pkgs.symlinkJoin { @@ -62,27 +76,16 @@ pkgs.symlinkJoin { set -efu - # Use home so Alacritty can find the configuration without arguments. - # HOME will be reset once in Alacritty. - HOME=$TMPDIR/Alacritty - export HOME - - # Install stored configuration if it has changed. - # This allows for both declarative updates and runtime modifications. - ${pkgs.coreutils}/bin/mkdir -p "$HOME" - if test "$(${pkgs.coreutils}/bin/cat "$HOME"/ref)" != ${config-file}; then - echo ${config-file} > "$HOME"/ref - ${pkgs.coreutils}/bin/cp ${config-file} "$HOME"/.alacritty.yml - fi - case ''${1-} in --singleton) shift if ! ${pkgs.alacritty}/bin/alacritty msg create-window "$@"; then + . ${profile} ${pkgs.alacritty}/bin/alacritty "$@" & fi ;; *) + . ${profile} exec ${pkgs.alacritty}/bin/alacritty "$@" ;; esac -- cgit v1.2.3 From ffa810484c16ffb0a1d1a9f27b77dbcf24212da9 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 27 Nov 2022 22:05:55 +0100 Subject: tv xmonad: Full -> StateFull --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index c921d428b..d7c45f189 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -1,4 +1,5 @@ {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE PatternSynonyms #-} module Main (main) where @@ -20,6 +21,7 @@ import XMonad.Actions.CycleWS (toggleWS) import XMonad.Layout.NoBorders ( smartBorders ) import XMonad.Layout.ResizableTile (ResizableTall(ResizableTall)) import XMonad.Layout.ResizableTile (MirrorResize(MirrorExpand,MirrorShrink)) +import XMonad.Layout.StateFull (pattern StateFull) import qualified XMonad.Prompt import qualified XMonad.StackSet as W import Data.Map (Map) @@ -67,7 +69,7 @@ mainNoArgs = do (fromIntegral (80 * myTermFontWidth + 2 * (myTermPadding + borderWidth def)) / fromIntegral myScreenWidth) [] ||| - Full + StateFull , manageHook = composeAll [ appName =? "fzmenu-urxvt" --> doCenterFloat -- cgit v1.2.3 From d27b33d5efe50d88fc326084c839375bca0ab915 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 6 Apr 2022 00:24:49 +0200 Subject: tv xmonad: add audioMicMute --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index d7c45f189..2a1793616 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -164,6 +164,7 @@ myKeys conf = Map.fromList $ , ((0, xF86XK_AudioLowerVolume), audioLowerVolume) , ((0, xF86XK_AudioRaiseVolume), audioRaiseVolume) , ((0, xF86XK_AudioMute), audioMute) + , ((0, xF86XK_AudioMicMute), audioMicMute) , ((_4, xF86XK_AudioMute), pavucontrol []) , ((_4, xK_Prior), forkFile {-pkg-}"xcalib" ["-invert", "-alter"] Nothing) @@ -190,6 +191,7 @@ myKeys conf = Map.fromList $ audioLowerVolume = amixer ["-q", "sset", "Master", "5%-"] audioRaiseVolume = amixer ["-q", "sset", "Master", "5%+"] audioMute = amixer ["-q", "sset", "Master", "toggle"] + audioMicMute = amixer ["-q", "sset", "Capture", "toggle"] resetLayout = setLayout $ XMonad.layoutHook conf -- cgit v1.2.3 From 09ea97a7f265d61e4627816d471f05ddf8d8888e Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 31 Mar 2022 23:12:39 +0200 Subject: tv xmonad: use BorderUrgencyHook --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index 2a1793616..d4c9c6adf 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -26,7 +26,13 @@ import qualified XMonad.Prompt import qualified XMonad.StackSet as W import Data.Map (Map) import qualified Data.Map as Map -import XMonad.Hooks.UrgencyHook (SpawnUrgencyHook(..), withUrgencyHook) +import XMonad.Hooks.UrgencyHook + ( BorderUrgencyHook(BorderUrgencyHook,urgencyBorderColor) + , RemindWhen(Dont) + , SuppressWhen(Never) + , UrgencyConfig(UrgencyConfig,remindWhen,suppressWhen) + , withUrgencyHookC + ) import XMonad.Hooks.ManageHelpers (doCenterFloat,doRectFloat) import Data.Ratio import XMonad.Hooks.Place (placeHook, smart) @@ -55,7 +61,14 @@ mainNoArgs = do let config = id - $ withUrgencyHook (SpawnUrgencyHook "echo emit Urgency ") + $ withUrgencyHookC + BorderUrgencyHook + { urgencyBorderColor = "#ff0000" + } + UrgencyConfig + { remindWhen = Dont + , suppressWhen = Never + } $ def { terminal = {-pkg:rxvt_unicode-}"urxvtc" , modMask = mod4Mask -- cgit v1.2.3 From 59a447ac046424c27fa926a2416885c4f6724a7a Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Jan 2023 15:17:10 +0100 Subject: tv xmonad: get font and screen info from env --- tv/5pkgs/haskell/xmonad-tv/src/Build.hs | 24 ------------- tv/5pkgs/haskell/xmonad-tv/src/THEnv/JSON.hs | 18 ---------- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 47 +++++++++++++++----------- tv/5pkgs/haskell/xmonad-tv/src/xmonad-tv.cabal | 3 +- 4 files changed, 29 insertions(+), 63 deletions(-) delete mode 100644 tv/5pkgs/haskell/xmonad-tv/src/Build.hs delete mode 100644 tv/5pkgs/haskell/xmonad-tv/src/THEnv/JSON.hs (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/Build.hs b/tv/5pkgs/haskell/xmonad-tv/src/Build.hs deleted file mode 100644 index 553a129b1..000000000 --- a/tv/5pkgs/haskell/xmonad-tv/src/Build.hs +++ /dev/null @@ -1,24 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} -{-# LANGUAGE TypeApplications #-} - -module Build where - -import XMonad (Dimension) -import THEnv.JSON (getCompileEnvJSONExp) - - -myFont :: String -myFont = - "-schumacher-*-*-*-*-*-*-*-*-*-*-*-iso10646-*" - -myScreenWidth :: Dimension -myScreenWidth = - $(getCompileEnvJSONExp (id @Dimension) "XMONAD_BUILD_SCREEN_WIDTH") - -myTermFontWidth :: Dimension -myTermFontWidth = - $(getCompileEnvJSONExp (id @Dimension) "XMONAD_BUILD_TERM_FONT_WIDTH") - -myTermPadding :: Dimension -myTermPadding = - 2 diff --git a/tv/5pkgs/haskell/xmonad-tv/src/THEnv/JSON.hs b/tv/5pkgs/haskell/xmonad-tv/src/THEnv/JSON.hs deleted file mode 100644 index 2a3a0e523..000000000 --- a/tv/5pkgs/haskell/xmonad-tv/src/THEnv/JSON.hs +++ /dev/null @@ -1,18 +0,0 @@ -{-# LANGUAGE ScopedTypeVariables #-} - -module THEnv.JSON where - -import Data.Aeson (eitherDecode,FromJSON) -import Data.ByteString.Lazy.Char8 (pack) -import Language.Haskell.TH.Syntax (Exp,Lift(lift),Q) -import THEnv (getCompileEnv) -import Control.Monad - -getCompileEnvJSON :: (FromJSON a) => String -> Q a -getCompileEnvJSON name = - either error (id :: a -> a) . eitherDecode . pack <$> getCompileEnv name - -getCompileEnvJSONExp :: - forall proxy a. (FromJSON a, Lift a) => proxy a -> String -> Q Exp -getCompileEnvJSONExp _ = - (lift :: a -> Q Exp) <=< getCompileEnvJSON diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index d4c9c6adf..a5b3489bc 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -7,7 +7,10 @@ import System.Exit (exitFailure) import Control.Exception import Control.Monad.Extra (whenJustM) +import qualified Data.Aeson +import qualified Data.ByteString.Char8 import qualified Data.List +import qualified Data.Maybe import Graphics.X11.ExtraTypes.XF86 import Text.Read (readEither) import XMonad @@ -40,8 +43,6 @@ import XMonad.Actions.PerWorkspaceKeys (chooseAction) import Shutdown (shutdown, newShutdownEventHandler) -import Build (myFont, myScreenWidth, myTermFontWidth, myTermPadding) - main :: IO () main = getArgs >>= \case @@ -53,9 +54,19 @@ main = getArgs >>= \case (=??) :: Query a -> (a -> Bool) -> Query Bool (=??) x p = fmap p x +readEnv :: Data.Aeson.FromJSON b => String -> IO b +readEnv name = + Data.Maybe.fromJust + . Data.Aeson.decodeStrict' + . Data.ByteString.Char8.pack + <$> getEnv name mainNoArgs :: IO () mainNoArgs = do + myScreenWidth <- readEnv "XMONAD_SCREEN_WIDTH" :: IO Dimension + myTermFont <- getEnv "XMONAD_TERM_FONT" + myTermFontWidth <- readEnv "XMONAD_TERM_FONT_WIDTH" :: IO Dimension + myTermPadding <- readEnv "XMONAD_TERM_PADDING" :: IO Dimension workspaces0 <- getWorkspaces0 handleShutdownEvent <- newShutdownEventHandler let @@ -72,7 +83,7 @@ mainNoArgs = do $ def { terminal = {-pkg:rxvt_unicode-}"urxvtc" , modMask = mod4Mask - , keys = myKeys + , keys = myKeys myTermFont , workspaces = workspaces0 , layoutHook = smartBorders $ @@ -133,8 +144,8 @@ spawnRootTerm = Nothing -myKeys :: XConfig Layout -> Map (KeyMask, KeySym) (X ()) -myKeys conf = Map.fromList $ +myKeys :: String -> XConfig Layout -> Map (KeyMask, KeySym) (X ()) +myKeys font conf = Map.fromList $ [ ((_4 , xK_Escape ), forkFile {-pkg-}"slock" [] Nothing) , ((_4S , xK_c ), kill) @@ -209,17 +220,15 @@ myKeys conf = Map.fromList $ resetLayout = setLayout $ XMonad.layoutHook conf promptXPConfig = - def { XMonad.Prompt.font = myFont } - - -xdeny :: X () -xdeny = - forkFile - {-pkg-}"xterm" - [ "-fn", myFont - , "-geometry", "300x100" - , "-name", "AlertFloat" - , "-bg", "#E4002B" - , "-e", "sleep", "0.05" - ] - Nothing + def { XMonad.Prompt.font = font } + + xdeny = + forkFile + {-pkg-}"xterm" + [ "-fn", font + , "-geometry", "300x100" + , "-name", "AlertFloat" + , "-bg", "#E4002B" + , "-e", "sleep", "0.05" + ] + Nothing diff --git a/tv/5pkgs/haskell/xmonad-tv/src/xmonad-tv.cabal b/tv/5pkgs/haskell/xmonad-tv/src/xmonad-tv.cabal index a3ddcb039..62faf2f00 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/xmonad-tv.cabal +++ b/tv/5pkgs/haskell/xmonad-tv/src/xmonad-tv.cabal @@ -23,7 +23,6 @@ executable xmonad xmonad, xmonad-contrib other-modules: - Shutdown, - THEnv.JSON + Shutdown default-language: Haskell2010 ghc-options: -O2 -Wall -threaded -- cgit v1.2.3 From 48f91cbeb1b6bfd751cc7ed26ddee2fcf97a4f99 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Jan 2023 17:14:19 +0100 Subject: tv alacritty: add support for multiple profiles --- tv/5pkgs/simple/alacritty-tv.nix | 46 +++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 8 deletions(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index fd4dec9ec..f66bcdc0b 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -6,7 +6,7 @@ let program = "${pkgs.font-size-alacritty}/bin/font-size-alacritty"; args = [arg]; }; - config = { + configs.default = { bell.animation = "EaseOut"; bell.duration = 50; bell.color = "#ff00ff"; @@ -50,16 +50,31 @@ let ]; scrolling.multiplier = 8; }; - config-file = pkgs.writeJSON "alacritty-tv.json" config; - profile = pkgs.writeText "alacritty-tv.profile" /* sh */ '' + writeProfile = name: config: let + config-file = + assert lib.types.filename.check name; + pkgs.writeJSON "alacritty-tv-${name}.json" config; + in pkgs.writeText "alacritty-tv-${name}.profile" /* sh */ '' # Use home so Alacritty can find the configuration without arguments. # HOME will be reset once in Alacritty. - HOME=$TMPDIR/Alacritty + HOME=$TMPDIR/Alacritty-${name} export HOME + # Tell Alacritty via XDG_RUNTIME_DIR where to create sockets. + # XDG_RUNTIME_DIR needs to be reset manually. + export ALACRITTY_XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" + export BASH_EXTRA_INIT=${pkgs.writeDash "alacritty-tv.cleanup.sh" '' + XDG_RUNTIME_DIR=$ALACRITTY_XDG_RUNTIME_DIR + unset ALACRITTY_XDG_RUNTIME_DIR + unset BASH_EXTRA_INIT + ''} + export XDG_RUNTIME_DIR="$HOME" + # Install stored configuration if it has changed. # This allows for both declarative updates and runtime modifications. - ${pkgs.coreutils}/bin/mkdir -p "$HOME" + # rust-xdg requires XDG_RUNTIME_DIR to be secure: + # https://docs.rs/xdg/2.4.1/src/xdg/lib.rs.html#311 + ${pkgs.coreutils}/bin/mkdir -m 0700 -p "$HOME" if test "$(${pkgs.coreutils}/bin/cat "$HOME"/ref)" != ${config-file}; then echo ${config-file} > "$HOME"/ref ${pkgs.coreutils}/bin/cp ${config-file} "$HOME"/.alacritty.yml @@ -72,20 +87,35 @@ pkgs.symlinkJoin { paths = [ (pkgs.writeDashBin "alacritty" '' # usage: - # alacritty [--singleton] [ARGS...] + # alacritty [--profile=PROFILE] [--singleton] [ARGS...] + # where + # PROFILE one of ${lib.toJSON (lib.attrNames configs)} set -efu + case ''${1-} in + ${lib.concatMapStringsSep "\n" (name: /* sh */ '' + --${lib.shell.escape name}|--profile=${lib.shell.escape name}) + shift + profile=${writeProfile name configs.${name}} + ;; + '') (lib.attrNames configs)} + *) + profile=${writeProfile "default" configs.default} + ;; + esac + + case ''${1-} in --singleton) shift if ! ${pkgs.alacritty}/bin/alacritty msg create-window "$@"; then - . ${profile} + . "$profile" ${pkgs.alacritty}/bin/alacritty "$@" & fi ;; *) - . ${profile} + . "$profile" exec ${pkgs.alacritty}/bin/alacritty "$@" ;; esac -- cgit v1.2.3 From a7a0dc6982f5399598ce4261a03fb1355620c1d2 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Jan 2023 17:16:32 +0100 Subject: tv alacritty: add root profile --- tv/5pkgs/simple/alacritty-tv.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index f66bcdc0b..bca779df7 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -50,6 +50,11 @@ let ]; scrolling.multiplier = 8; }; + configs.root = lib.recursiveUpdate configs.default { + colors.primary.background = "#230000"; + colors.primary.foreground = "#e0c0c0"; + colors.normal.black = "#800000"; + }; writeProfile = name: config: let config-file = assert lib.types.filename.check name; -- cgit v1.2.3 From 93cba42c36634e83a128cd73f85a4302adb27f5b Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Jan 2023 17:20:34 +0100 Subject: tv xmonad: urxvt -> alacritty --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index a5b3489bc..6ac6b6b10 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -81,7 +81,7 @@ mainNoArgs = do , suppressWhen = Never } $ def - { terminal = {-pkg:rxvt_unicode-}"urxvtc" + { terminal = {-pkg:alacritty-tv-}"alacritty" , modMask = mod4Mask , keys = myKeys myTermFont , workspaces = workspaces0 @@ -139,8 +139,8 @@ forkFile path args env = spawnRootTerm :: X () spawnRootTerm = forkFile - {-pkg:rxvt_unicode-}"urxvtc" - ["-name", "root-urxvt", "-e", "/run/wrappers/bin/su", "-"] + {-pkg:alacritty-tv-}"alacritty" + ["--profile=root", "-e", "/run/wrappers/bin/su", "-"] Nothing @@ -152,7 +152,7 @@ myKeys font conf = Map.fromList $ , ((_4 , xK_o ), forkFile {-pkg:fzmenu-}"otpmenu" [] Nothing) , ((_4 , xK_p ), forkFile {-pkg:fzmenu-}"passmenu" [] Nothing) - , ((_4 , xK_x ), forkFile {-pkg:rxvt_unicode-}"urxvtc" [] Nothing) + , ((_4 , xK_x ), forkFile {-pkg:alacritty-tv-}"alacritty" ["--singleton"] Nothing) , ((_4C , xK_x ), spawnRootTerm) , ((_C , xK_Menu ), toggleWS) -- cgit v1.2.3 From 9c4a8aa82bea9407f3ce1b140e20cf8a34c93c30 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Jan 2023 17:23:21 +0100 Subject: tv alacritty: add fzmenu profile --- tv/5pkgs/simple/alacritty-tv.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index bca779df7..447926cfb 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -55,6 +55,11 @@ let colors.primary.foreground = "#e0c0c0"; colors.normal.black = "#800000"; }; + configs.fzmenu = lib.recursiveUpdate configs.default { + colors.primary.background = "#2A172A"; + window.dimensions.columns = 70; + window.dimensions.lines = 9; + }; writeProfile = name: config: let config-file = assert lib.types.filename.check name; -- cgit v1.2.3 From 52c5f6ee553c5af8e3daaaa2bdcfc47094f96965 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Jan 2023 17:21:51 +0100 Subject: tv fzmenu: urxvt -> alacritty --- tv/5pkgs/simple/fzmenu/bin/otpmenu | 2 +- tv/5pkgs/simple/fzmenu/bin/passmenu | 2 +- tv/5pkgs/simple/fzmenu/default.nix | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/simple/fzmenu/bin/otpmenu b/tv/5pkgs/simple/fzmenu/bin/otpmenu index ad8a0fda9..12bd60a9d 100755 --- a/tv/5pkgs/simple/fzmenu/bin/otpmenu +++ b/tv/5pkgs/simple/fzmenu/bin/otpmenu @@ -6,7 +6,7 @@ set -efu case ${FZMENU_PHASE-0} in 0) export FZMENU_PHASE=1 - exec setsid -f urxvt -name fzmenu-urxvt -e dash "$0" + exec setsid -f terminal dash "$0" ;; 1) if result=$( diff --git a/tv/5pkgs/simple/fzmenu/bin/passmenu b/tv/5pkgs/simple/fzmenu/bin/passmenu index 00b36c3af..da8e739ee 100755 --- a/tv/5pkgs/simple/fzmenu/bin/passmenu +++ b/tv/5pkgs/simple/fzmenu/bin/passmenu @@ -6,7 +6,7 @@ set -efu case ${FZMENU_PHASE-0} in 0) export FZMENU_PHASE=1 - exec setsid -f urxvt -name fzmenu-urxvt -e dash "$0" + exec setsid -f terminal dash "$0" ;; 1) if result=$( diff --git a/tv/5pkgs/simple/fzmenu/default.nix b/tv/5pkgs/simple/fzmenu/default.nix index 634d8338b..7e19505c1 100644 --- a/tv/5pkgs/simple/fzmenu/default.nix +++ b/tv/5pkgs/simple/fzmenu/default.nix @@ -1,5 +1,15 @@ { lib, pkgs, stdenv }: +let + terminal = pkgs.writeDashBin "terminal" '' + # usage: terminal COMMAND [ARGS...] + exec ${pkgs.alacritty-tv}/bin/alacritty \ + --profile=fzmenu \ + --class AlacrittyFzmenuFloat \ + -e "$@" + ''; +in + pkgs.runCommand "fzmenu" { } /* sh */ '' mkdir $out @@ -16,9 +26,9 @@ pkgs.runCommand "fzmenu" { (pkgs.pass.withExtensions (ext: [ ext.pass-otp ])) - pkgs.rxvt_unicode pkgs.utillinux pkgs.xdotool + terminal ]} substituteInPlace $out/bin/passmenu \ @@ -31,8 +41,8 @@ pkgs.runCommand "fzmenu" { (pkgs.pass.withExtensions (ext: [ ext.pass-otp ])) - pkgs.rxvt_unicode pkgs.utillinux pkgs.xdotool + terminal ]} '' -- cgit v1.2.3 From 339f5d7ad3a45bad7bc090178ecefcf9d308b465 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Jan 2023 17:35:55 +0100 Subject: tv iosevka-tv-1: init --- tv/5pkgs/simple/iosevka-tv-1.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tv/5pkgs/simple/iosevka-tv-1.nix (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/simple/iosevka-tv-1.nix b/tv/5pkgs/simple/iosevka-tv-1.nix new file mode 100644 index 000000000..f72565bc7 --- /dev/null +++ b/tv/5pkgs/simple/iosevka-tv-1.nix @@ -0,0 +1,18 @@ +{ pkgs }: + +pkgs.iosevka.override { + # https://typeof.net/Iosevka/customizer + privateBuildPlan = { + family = "iosevka-tv-1"; + spacing = "term"; + serifs = "sans"; + export-glyph-names = true; + no-ligation = true; + no-cv-ss = false; + + widths.normal.shape = 600; + widths.normal.menu = 5; + widths.normal.css = "normal"; + }; + set = "iosevka-tv-1"; +} -- cgit v1.2.3 From dba0afc600eb447b3fa088b0ef96d891fc7be2cc Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 11 Jan 2023 17:34:26 +0100 Subject: tv alacritty: add x220 and hidpi variants --- tv/5pkgs/simple/alacritty-tv.nix | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index 447926cfb..9da850620 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -1,4 +1,6 @@ -{ pkgs }: +{ pkgs +, variant ? "x220" +}: let lib = import ./lib; @@ -6,7 +8,7 @@ let program = "${pkgs.font-size-alacritty}/bin/font-size-alacritty"; args = [arg]; }; - configs.default = { + configs.default = lib.recursiveUpdate variants.${variant} { bell.animation = "EaseOut"; bell.duration = 50; bell.color = "#ff00ff"; @@ -30,10 +32,6 @@ let colors.bright.cyan = "#72fbfb"; colors.bright.white = "#fbfbfb"; draw_bold_text_with_bright_colors = true; - font.normal.family = "Clean"; - font.bold.family = "Clean"; - font.bold.style = "Regular"; - font.size = 10; hints.enabled = [ { regex = "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\\u0000-\\u001F\\u007F-\\u009F<>\"\\s{-}\\^⟨⟩`]+"; @@ -42,12 +40,6 @@ let action = "Select"; } ]; - key_bindings = [ - { key = "Up"; mods = "Shift|Control"; command = font-size "=14"; } - { key = "Up"; mods = "Control"; command = font-size "+1"; } - { key = "Down"; mods = "Control"; command = font-size "-1"; } - { key = "Down"; mods = "Shift|Control"; command = font-size "=0"; } - ]; scrolling.multiplier = 8; }; configs.root = lib.recursiveUpdate configs.default { @@ -60,6 +52,30 @@ let window.dimensions.columns = 70; window.dimensions.lines = 9; }; + variants.hidpi = { + font.normal.family = "iosevka-tv-1"; + font.bold.family = "iosevka-tv-1"; + font.italic.family = "iosevka-tv-1"; + font.bold_italic.family = "iosevka-tv-1"; + font.size = 5; + key_bindings = [ + { key = "Up"; mods = "Control"; action = "IncreaseFontSize"; } + { key = "Down"; mods = "Control"; action = "DecreaseFontSize"; } + { key = "Down"; mods = "Shift|Control"; action = "ResetFontSize"; } + ]; + }; + variants.x220 = { + font.normal.family = "Clean"; + font.bold.family = "Clean"; + font.bold.style = "Regular"; + font.size = 10; + key_bindings = [ + { key = "Up"; mods = "Shift|Control"; command = font-size "=14"; } + { key = "Up"; mods = "Control"; command = font-size "+1"; } + { key = "Down"; mods = "Control"; command = font-size "-1"; } + { key = "Down"; mods = "Shift|Control"; command = font-size "=0"; } + ]; + }; writeProfile = name: config: let config-file = assert lib.types.filename.check name; -- cgit v1.2.3 From 99667ab5fbb90adaaa1c40aae0fedd9b480c2474 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 13 Jan 2023 04:36:51 +0100 Subject: tv alacritty: add touchscreen support --- tv/5pkgs/override/alacritty.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tv/5pkgs/override/alacritty.nix (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/override/alacritty.nix b/tv/5pkgs/override/alacritty.nix new file mode 100644 index 000000000..17baa048f --- /dev/null +++ b/tv/5pkgs/override/alacritty.nix @@ -0,0 +1,14 @@ +self: super: + +super.alacritty.overrideAttrs (old: + assert self.lib.versions.majorMinor old.version == "0.11"; + { + version = "${old.version}-tv"; + src = self.fetchFromGitHub { + owner = "4z3"; + repo = "alacritty"; + rev = "touchscreen-support-0.11"; + hash = "sha256-oA4earrJ7lPVSBm9vRccWatAQ49hfDKsa7M72B5uQpY="; + }; + } +) -- cgit v1.2.3 From 2c05d17476932ecd23e3ce902366d4c3d08dcaca Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 15 Jan 2023 01:50:04 +0100 Subject: tv vim: split plugins into base and extra --- tv/5pkgs/vim/tv.nix | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/vim/tv.nix b/tv/5pkgs/vim/tv.nix index dee6b2df8..10816ce96 100644 --- a/tv/5pkgs/vim/tv.nix +++ b/tv/5pkgs/vim/tv.nix @@ -1,17 +1,6 @@ { pkgs }: pkgs.tv.vim.makePlugin (pkgs.write "vim-tv" { - # - # Haskell - # - "/ftplugin/haskell.vim".text = '' - if exists("g:vim_tv_ftplugin_haskell_loaded") - finish - endif - let g:vim_tv_ftplugin_haskell_loaded = 1 - - setlocal iskeyword+=' - ''; # # TODO # -- cgit v1.2.3 From 29bbb02a427d2fed5fbe39792ab46db9f8b55c1e Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 15 Jan 2023 03:08:23 +0100 Subject: tv uqmi: init at unstable-2022-05-04 --- tv/5pkgs/override/uqmi.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tv/5pkgs/override/uqmi.nix (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/override/uqmi.nix b/tv/5pkgs/override/uqmi.nix new file mode 100644 index 000000000..1eaecbd67 --- /dev/null +++ b/tv/5pkgs/override/uqmi.nix @@ -0,0 +1,10 @@ +self: super: + +super.uqmi.overrideAttrs (old: { + version = "unstable-2022-05-04"; + src = self.fetchgit { + url = "https://git.openwrt.org/project/uqmi.git"; + rev = "56cb2d4056fef132ccf78dfb6f3074ae5d109992"; + hash = "sha256-PwnR24PbNKfLrsBlU5JTOHDzs/9Wgcuwfnu3dJuuZcM="; + }; +}) -- cgit v1.2.3 From deb83ad51fa7153bb777381412366532f4e23f61 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Jan 2023 11:52:19 +0100 Subject: tv vim hack: hi TabLine{,Fill} --- tv/5pkgs/vim/hack.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/vim/hack.nix b/tv/5pkgs/vim/hack.nix index 922d85ba2..d378f355b 100644 --- a/tv/5pkgs/vim/hack.nix +++ b/tv/5pkgs/vim/hack.nix @@ -42,5 +42,8 @@ in { hi diffRemoved ctermfg=009 hi Search cterm=NONE ctermbg=216 + + hi TabLine cterm=underline guifg=#424242 guibg=#232323 + hi TabLineFill cterm=underline guifg=#424242 guibg=#232323 ''; })) -- cgit v1.2.3 From 051dd045d3f0e3ab14d63347bd46b887c1c34e6d Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Jan 2023 12:40:21 +0100 Subject: tv fzf.vim: 2018-11-14 -> 2023-01-16 --- tv/5pkgs/vim/fzf.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/vim/fzf.nix b/tv/5pkgs/vim/fzf.nix index 14b6900b5..e24bee5d4 100644 --- a/tv/5pkgs/vim/fzf.nix +++ b/tv/5pkgs/vim/fzf.nix @@ -2,10 +2,10 @@ # cannot use pkgs.vimPlugins.fzf-vim as it's missing :Rg pkgs.vimUtils.buildVimPlugin { - name = "fzf-2018-11-14"; + name = "fzf-2023-01-16"; src = pkgs.fetchgit { url = https://github.com/junegunn/fzf.vim; - rev = "ad1833ecbc9153b6e34a4292dc089a58c4bcb8dc"; - sha256 = "1z2q71q6l9hq9fqfqpj1svhyk4yk1bzw1ljhksx4bnpz8gkfbx2m"; + rev = "bdf48c282ad2174c25c059b3cdb7956427b07a99"; + hash = "sha256-eCCk+Q596Ljjdtjd0cYGqR77K3Me5gf+ts5icP22S3Y="; }; } -- cgit v1.2.3 From 70472d8c45caba8df6f57b43cec686e4df459135 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 17 Jan 2023 00:37:46 +0100 Subject: tv alacritty: TMPDIR -> XDG_RUNTIME_DIR --- tv/5pkgs/simple/alacritty-tv.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index 9da850620..7e24b7e1b 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -83,7 +83,7 @@ let in pkgs.writeText "alacritty-tv-${name}.profile" /* sh */ '' # Use home so Alacritty can find the configuration without arguments. # HOME will be reset once in Alacritty. - HOME=$TMPDIR/Alacritty-${name} + HOME=$XDG_RUNTIME_DIR/Alacritty-${name} export HOME # Tell Alacritty via XDG_RUNTIME_DIR where to create sockets. -- cgit v1.2.3 From 29c8c3ecf1cc66a638020a564e1b72966c259a8b Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 17 Jan 2023 00:42:15 +0100 Subject: tv alacritty: admit missing ref file --- tv/5pkgs/simple/alacritty-tv.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index 7e24b7e1b..1c7730a71 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -101,7 +101,8 @@ let # rust-xdg requires XDG_RUNTIME_DIR to be secure: # https://docs.rs/xdg/2.4.1/src/xdg/lib.rs.html#311 ${pkgs.coreutils}/bin/mkdir -m 0700 -p "$HOME" - if test "$(${pkgs.coreutils}/bin/cat "$HOME"/ref)" != ${config-file}; then + ref=$(! test -e "$HOME"/ref || ${pkgs.coreutils}/bin/cat "$HOME"/ref) + if test "$ref" != ${config-file}; then echo ${config-file} > "$HOME"/ref ${pkgs.coreutils}/bin/cp ${config-file} "$HOME"/.alacritty.yml fi -- cgit v1.2.3 From a8cb1328737926cf948d1a7dfbdfd6eff35428d9 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 18 Jan 2023 21:20:08 +0100 Subject: tv xmonad: add ewmh --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index 6ac6b6b10..2061ae4b9 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -4,6 +4,7 @@ module Main (main) where import System.Exit (exitFailure) +import XMonad.Hooks.EwmhDesktops (ewmh) import Control.Exception import Control.Monad.Extra (whenJustM) @@ -71,7 +72,7 @@ mainNoArgs = do handleShutdownEvent <- newShutdownEventHandler let config = - id + ewmh $ withUrgencyHookC BorderUrgencyHook { urgencyBorderColor = "#ff0000" -- cgit v1.2.3 From b3ebccb032e0f8e5baba4a96e289807a209cadfb Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 18 Jan 2023 21:22:53 +0100 Subject: tv xmonad: add toggleFocus --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tv/5pkgs') diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index 2061ae4b9..eb61bd5cf 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -5,6 +5,7 @@ module Main (main) where import System.Exit (exitFailure) import XMonad.Hooks.EwmhDesktops (ewmh) +import XMonad.Hooks.RefocusLast (refocusLastLayoutHook, toggleFocus) import Control.Exception import Control.Monad.Extra (whenJustM) @@ -87,6 +88,7 @@ mainNoArgs = do , keys = myKeys myTermFont , workspaces = workspaces0 , layoutHook = + refocusLastLayoutHook $ smartBorders $ ResizableTall 1 @@ -161,6 +163,8 @@ myKeys font conf = Map.fromList $ , ((_4 , xK_space ), withFocused $ \w -> ifM (isFloatingX w) xdeny $ sendMessage NextLayout) , ((_4M , xK_space ), withFocused $ \w -> ifM (isFloatingX w) xdeny $ resetLayout) + , ((_4 , xK_l ), toggleFocus) + , ((_4 , xK_m ), windows W.focusMaster) , ((_4 , xK_j ), windows W.focusDown) , ((_4 , xK_k ), windows W.focusUp) -- cgit v1.2.3