diff --git a/config/home.nix b/config/home.nix index 81a2d14..635fdcc 100644 --- a/config/home.nix +++ b/config/home.nix @@ -20,6 +20,10 @@ in { homeDirectory = "/home/${username}"; stateVersion = "24.05"; + file = { + `/home/${username}/.scripts/audio/get-sink-name.sh`.source = ./home/scripts/audio/get-sink-name.sh; + }; + packages = with pkgs; [ alacritty cups @@ -59,7 +63,6 @@ in { pm2 plexamp polybar - pulseaudio rofi rofi-emoji steam @@ -71,6 +74,7 @@ in { wget xclip yarn + yt-dlp zip zsh zsh-powerlevel10k diff --git a/config/home/scripts/audio/get-sink-name.sh b/config/home/scripts/audio/get-sink-name.sh new file mode 100644 index 0000000..66671d8 --- /dev/null +++ b/config/home/scripts/audio/get-sink-name.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +SINK=$(pactl get-default-sink) + +if [ $SINK = "alsa_output.pci-0000_1f_00.3.analog-stereo" ]; then + echo "Speakers" +elif [ $SINK = "alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo" ]; then + echo "Headphones" +else + echo "-" +fi + diff --git a/config/packages/alacritty/alacritty.yml b/config/packages/alacritty/alacritty.yml index 009d20e..7b82870 100644 --- a/config/packages/alacritty/alacritty.yml +++ b/config/packages/alacritty/alacritty.yml @@ -53,7 +53,3 @@ key_bindings: - { key: PageDown, mods: Shift, action: ScrollPageDown } - { key: Home, mods: Shift, action: ScrollToTop } - { key: End, mods: Shift, action: ScrollToBottom } - -shell: - program: /bin/zsh - diff --git a/system/shared.nix b/system/shared.nix index e3a44e6..8390665 100644 --- a/system/shared.nix +++ b/system/shared.nix @@ -66,6 +66,7 @@ "flatpak" "wheel" ]; + shell = pkgs.zsh }; programs.steam = { @@ -73,6 +74,26 @@ remotePlay.openFirewall = true; }; + programs.zsh = { + enable = true; + programs.zsh.promptInit = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; + + shellAliases = { + lss = "ls -lah"; + + gss = "git status -s"; + gaa = "git add -A"; + gcm = "git commit -m"; + gco = "git checkout"; + + yt-mp3 = "yt-mp3 -xi --audio-format mp3"; + yt-mp3-meta = "yt-mp3 -xi --audio-format mp3 --parse-metadata \"playlist_index:%(track_number)s\" --add-metadata"; + yt-mp3-meta-cookies = "yt-mp3 -xi --audio-format mp3 --parse-metadata \"playlist_index:%(track_number)s\" --add-metadata --cookies-from-browser firefox"; + }; + }; + + programs.neovim.defaultEditor = true; + fonts = { packages = with pkgs; [ noto-fonts @@ -93,15 +114,18 @@ environment.systemPackages = with pkgs; [ docker + pulseaudio ]; virtualisation.docker.enable = true; - xdg.portal = { - enable = true; - config.common.default = "*"; - extraPortals = [pkgs.xdg-desktop-portal-gtk]; - }; + xdg.portal = { + enable = true; + config.common.default = "*"; + extraPortals = [pkgs.xdg-desktop-portal-gtk]; + }; + + hardware.pulseaudio.enable = true; system.stateVersion = "24.05"; }