diff --git a/home/programs/alacritty/default.nix b/home/programs/alacritty/default.nix
index 4153b3f..f2e0456 100644
--- a/home/programs/alacritty/default.nix
+++ b/home/programs/alacritty/default.nix
@@ -17,7 +17,7 @@ in {
import = "${theme}";
};
font = {
- size = 9;
+ size = 7;
normal.family = "Fira Code";
bold.family = "Fira Code";
italic.family = "Fira Code";
diff --git a/home/programs/default.nix b/home/programs/default.nix
index 7732ac1..c45319b 100644
--- a/home/programs/default.nix
+++ b/home/programs/default.nix
@@ -2,8 +2,10 @@
imports = [
./alacritty
./anki.nix
+ ./discord.nix
./element.nix
./git.nix
+ ./ktouch.nix
./neovim
./obs
./planify.nix
diff --git a/home/programs/discord.nix b/home/programs/discord.nix
new file mode 100644
index 0000000..65b19d6
--- /dev/null
+++ b/home/programs/discord.nix
@@ -0,0 +1,5 @@
+{ pkgs, ... }:
+
+{
+ home.packages = with pkgs; [ discord ];
+}
diff --git a/home/programs/ktouch.nix b/home/programs/ktouch.nix
new file mode 100644
index 0000000..4b99284
--- /dev/null
+++ b/home/programs/ktouch.nix
@@ -0,0 +1,5 @@
+{ pkgs, ... }:
+
+{
+ home.programs = with pkgs.libsForQt5; [ ktouch ];
+}
diff --git a/home/programs/neovim/coc-settings.json b/home/programs/neovim/coc-settings.json
index da3dbd4..ae6e85d 100644
--- a/home/programs/neovim/coc-settings.json
+++ b/home/programs/neovim/coc-settings.json
@@ -1,18 +1,26 @@
-"languageserver": {
- "haskell": {
- "command": "haskell-language-server-wrapper",
- "args": ["--lsp"],
- "rootPatterns": ["*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml"],
- "filetypes": ["haskell", "lhaskell"],
- // Settings are optional, here are some example values
- "settings": {
- "haskell": {
- "checkParents": "CheckOnSave",
- "checkProject": true,
- "maxCompletions": 40,
- "formattingProvider": "ormolu",
- "plugin": {
- "stan": { "globalOn": true }
+{
+ "languageserver": {
+ "haskell": {
+ "command": "haskell-language-server-wrapper",
+ "args": ["--lsp"],
+ "rootPatterns": [
+ "*.cabal",
+ "stack.yaml",
+ "cabal.project",
+ "package.yaml",
+ "hie.yaml"
+ ],
+ "filetypes": ["haskell", "lhaskell"],
+ // Settings are optional, here are some example values
+ "settings": {
+ "haskell": {
+ "checkParents": "CheckOnSave",
+ "checkProject": true,
+ "maxCompletions": 40,
+ "formattingProvider": "ormolu",
+ "plugin": {
+ "stan": { "globalOn": true }
+ }
}
}
}
diff --git a/home/programs/xmonad/src/xmobar/Plugins/Audio.hs b/home/programs/xmonad/src/xmobar/Plugins/Audio.hs
index 6a8a4c6..ebd20b0 100644
--- a/home/programs/xmonad/src/xmobar/Plugins/Audio.hs
+++ b/home/programs/xmonad/src/xmobar/Plugins/Audio.hs
@@ -1,24 +1,33 @@
module Plugins.Audio where
import Xmobar
-import Xmobar.Run.Timer (doEveryTenthSeconds)
import System.Process
-import System.Exit
-import System.IO (hClose, hGetLine)
+import Control.Concurrent
-data Audio = Audio String Int deriving (Read, Show)
+data Audio = Audio Int deriving (Read, Show)
instance Exec Audio where
- alias (Audio _ _) = "audio"
- start (Audio f r) cb = if r > 0 then (doEveryTenthSeconds r (audio f cb)) else audio f cb
+ alias (Audio _) = "audio"
+ start (Audio r) cb = if r > 0 then go cb r else go cb 1000
+ where
+ go :: (String -> IO ()) -> Int -> IO ()
+ go cb r = do
+ response <- readProcess "/bin/sh" ["-c", "pulseaudio-ctl full-status"] ""
+ let list = [w | w <- words (init response)]
+ audio (head list) (list !! 1) (last list) cb
+ threadDelay r
+ go cb r
-audio :: String -> (String -> IO ()) -> IO ()
-audio format cb = do
- (i,o,e,p) <- runInteractiveProcess "pulseaudio-ctl full-status" [] Nothing Nothing
- exit <- waitForProcess p
- let closeHandles = hClose o >> hClose i >> hClose e
- getL = hGetLine o
- str <- getL
- closeHandles
- cb str
---readProcess "pulseaudio-ctl full-status" []
+audio :: String -> String -> String -> (String -> IO ()) -> IO ()
+audio vol speaker mic cb
+ | speaker == "yes" = chooseMic vol "#f38ba8" "\xf466" mic cb
+ | elem vol [show i | i <- [0..49]] = chooseMic vol "#a6e3a1" "\xf027" mic cb
+ | otherwise = chooseMic vol "#a6e3a1" "\xf028" mic cb
+ | otherwise = formatAudio vol "a" "c" "d" "e" cb
+ where
+ chooseMic :: String -> String -> String -> String -> (String -> IO ()) -> IO ()
+ chooseMic vol speakerC speakerI mic cb
+ | mic == "yes" = formatAudio vol speakerC speakerI "#f38ba8" "\xf036d" cb
+ | otherwise = formatAudio vol speakerC speakerI "#a6e3a1" "\xf036c" cb
+ formatAudio :: String -> String -> String -> String -> String -> (String -> IO ()) -> IO ()
+ formatAudio vol speakerC speakerI micC micI cb = cb ("" ++ speakerI ++ " " ++ vol ++ "% " ++ micI ++ "")
diff --git a/home/programs/xmonad/src/xmobar/cabal.project b/home/programs/xmonad/src/xmobar/cabal.project
deleted file mode 100644
index c7ad71d..0000000
--- a/home/programs/xmonad/src/xmobar/cabal.project
+++ /dev/null
@@ -1,6 +0,0 @@
-packages: .
-
-with-compiler: ghc-9.2.4
-
-package xmobar
- flags: +all_extensions
diff --git a/home/programs/xmonad/src/xmobar/xmobar.hs b/home/programs/xmonad/src/xmobar/xmobar.hs
index 0070254..d410df6 100644
--- a/home/programs/xmonad/src/xmobar/xmobar.hs
+++ b/home/programs/xmonad/src/xmobar/xmobar.hs
@@ -17,8 +17,8 @@ config =
, fgColor = "#f5e0dc"
, commands =
[
- Run $ Audio "abc" 200
- --Run $ Com "/bin/sh" ["-c", "Status=$(pulseaudio-ctl full-status); Volume=$(cut -d ' ' -f 1 <<<$Status); Mute=$(cut -d ' ' -f 2 <<<$Status); Microphone=$(cut -d ' ' -f 3 <<<$Status); SpeakerColor=\"#a6e3a1\"; MicColor=\"#a6e3a1\"; if [[ $Mute == \"yes\" ]]; then Symbol=\"\xf466\"; SpeakerColor=\"#f38ba8\"; elif [[ $Volume -le 50 ]]; then Symbol=\"\xf027\"; elseSymbol=\"\xf028\"; fi; if [[ $Microphone == \"yes\" ]]; then MicOut=\"\xf036d\"; MicColor=\"#f38ba8\"; else MicOut=\"\xf036c\"; fi; echo \"$Symbol $Volume% $MicOut\""] "audio" 10
+ --Run $ Audio 10
+ Run $ Com "/bin/sh" ["-c", "Status=$(pulseaudio-ctl full-status); Volume=$(cut -d ' ' -f 1 <<<$Status); Mute=$(cut -d ' ' -f 2 <<<$Status); Microphone=$(cut -d ' ' -f 3 <<<$Status); SpeakerColor=\"#a6e3a1\"; MicColor=\"#a6e3a1\"; if [[ $Mute == \"yes\" ]]; then Symbol=\"\xf466\"; SpeakerColor=\"#f38ba8\"; elif [[ $Volume -le 50 ]]; then Symbol=\"\xf027\"; elseSymbol=\"\xf028\"; fi; if [[ $Microphone == \"yes\" ]]; then MicOut=\"\xf036d\"; MicColor=\"#f38ba8\"; else MicOut=\"\xf036c\"; fi; echo \"$Symbol $Volume% $MicOut\""] "audio" 60
--Run $ Com "/bin/sh" ["-c", "Status=$(pulseaudio-ctl full-status);
-- Volume=$(cut -d ' ' -f 1 <<<$Status);
-- Mute=$(cut -d ' ' -f 2 <<<$Status);
@@ -40,7 +40,7 @@ config =
-- MicOut=\"\xf036d\";
-- MicColor=\"#f38ba8\";
-- else MicOut=\"\xf036c\";
- -- fi;
+ -- fi;xmobar.Run not found
--
-- echo \"$Symbol $Volume% $MicOut\""] "audio" 10
--Run $ Audio
diff --git a/home/programs/xmonad/src/xmonad.hs b/home/programs/xmonad/src/xmonad.hs
index bc2df02..fa718b4 100644
--- a/home/programs/xmonad/src/xmonad.hs
+++ b/home/programs/xmonad/src/xmonad.hs
@@ -54,7 +54,7 @@ myconfig = def
, ("", spawn "pulseaudio-ctl down 5")
, ("", spawn "pulseaudio-ctl mute-input")
]
- `removeKeysP` []
+ `removeKeysP` [ "M-S-q" ]
myXmobarPP :: PP
myXmobarPP = def