diff --git a/apply.sh b/apply.sh index c0241f4..e32d3a5 100755 --- a/apply.sh +++ b/apply.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env zsh sudo rsync -ah --delete --progress `pwd`/ /root/nixos/ sudo rm /etc/nixos/configuration.nix diff --git a/configs/.bin/rofi-default-sink.sh b/configs/.bin/rofi-default-sink.sh new file mode 100644 index 0000000..f67fc82 --- /dev/null +++ b/configs/.bin/rofi-default-sink.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env zsh +sink=$(ponymix -t sink list | awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}' | rofi -dmenu -p 'default sink' | grep -Po '[0-9]+(?=:)') && +ponymix set-default -d $sink && +for input in $(ponymix list -t sink-input | grep -Po '[0-9]+(?=:)');do + echo "$input -> $sink" + ponymix -t sink-input -d $input move $sink +done diff --git a/configs/desktop.nix b/configs/desktop.nix index 443d689..0fd90ac 100644 --- a/configs/desktop.nix +++ b/configs/desktop.nix @@ -1,157 +1,6 @@ { pkgs, ... }: { - environment.etc."polybar.conf" = { - text = '' - [colors] - foreground = #666 - foreground-alt = #FFF - background = #000 - background-alt = #ABC - accent = #333 - info = #689eca - warn = #d08292 - - [bar/default] - monitor = ''${env:MONITOR:VGA-1} - width = 100% - height = 32 - offset-x = 0 - offset-y = 0 - ;radius = 8.0 - fixed-center = true - ; Put the bar at the bottom of the screen - ;bottom = true - - background = ''${colors.background} - foreground = ''${colors.foreground} - - border-size = 1 - border-color = ''${colors.background-alt} - - padding-left = 3 - padding-right = 1 - - module-margin-left = 0 - module-margin-right = 1 - - font-0 = Liberation Sans Regular:size=16;4 - font-1 = Font Awesome 5 Free Solid:size=14;3 - font-2 = Noto Emoji:size=14;4 - font-3 = DejaVu Sans:size=14;2 - font-4 = Font Awesome 5 Free Regular:size=14;3 - - modules-left = xwindow - modules-center = - modules-right = temperature clock bspwm - - tray-position = center - tray-padding = 2 - tray-maxsize = 24 - - wm-restack = bspwm - override-redirect = false - - scroll-up = bspwm-desknext - scroll-down = bspwm-deskprev - - cursor-click = default - cursor-scroll = default - enable-ipc = true - - [module/onboard] - type = custom/script - exec-if = test -x /usr/bin/onboard - exec = echo  - click-left = onboard & - interval = 3600 - format-foreground = ''${colors.foreground-alt} - - [module/clock] - type = custom/script - exec = date '+ %a %_d %b %_H:%M ' | sed 's/ / /g' - interval = 30 - format-foreground = ''${colors.foreground} - label-font = 1 - - [module/xwindow] - type = internal/xwindow - label = %title:0:92:…% - label-font = 1 - label-empty = - label-empty-font = 3 - label-empty-foreground = ''${colors.accent} - - [module/bspwm] - type = internal/bspwm - - format = - format-foreground = ''${colors.foreground} - - label-focused = " " - label-focused-foreground = ''${colors.accent} - label-focused-padding = 0 - label-focused-font = 2 - - label-occupied = " " - label-occupied-padding = 0 - label-occupied-foreground = ''${colors.foreground-alt} - label-occupied-font = 5 - - label-urgent = " " - label-urgent-foreground = ''${colors.info} - label-urgent-padding = 0 - label-urgent-font = 2 - - label-empty = " " - label-empty-foreground = ''${colors.background-alt} - label-empty-padding = 0 - label-empty-font = 5 - - label-dimmed-focused = " " - label-dimmed-focused-foreground = ''${colors.foreground-alt} - label-dimmed-font = 2 - - label-floating = " " - label-pseudotiled = " " - label-floating-foreground = ''${colors.foreground-alt} - label-pseudotiled-foreground = ''${colors.foreground-alt} - - [module/temperature] - type = internal/temperature - thermal-zone = 2 - warn-temperature = 75 - interval = 5 - - format = - format-underline = - format-warn = - - label = %temperature-c% - label-font = 1 - label-warn = %temperature-c% - label-warn-foreground = ''${colors.warn} - label-warn-font = 1 - - ramp-0 =  - ramp-1 =  - ramp-2 =  - ramp-foreground = ''${colors.warn} - - [settings] - screenchange-reload = true - compositing-overline = source - compositing-underline = source - compositing-background = source - compositing-foreground = source - compositing-border = source - - [global/wm] - margin-top = 0 - margin-bottom = 0 - ''; - }; - environment.etc.bspwmrc = { mode = "0645"; text = '' diff --git a/configs/gui.nix b/configs/gui.nix index 040c277..eabea1f 100644 --- a/configs/gui.nix +++ b/configs/gui.nix @@ -16,6 +16,7 @@ }; environment.systemPackages = with pkgs; [ + ponymix libsecret baobab barrier diff --git a/configs/user-gui.nix b/configs/user-gui.nix index 7aa7f16..bfc326f 100644 --- a/configs/user-gui.nix +++ b/configs/user-gui.nix @@ -3,11 +3,28 @@ imports = [ ]; home-manager.users.alex = { pkgs, ... }: { - home.packages = with pkgs; [ - spotify - signal-desktop - bitwarden - ]; + home = { + file = { + ".bin/rofi-default-sink.sh" = { + executable = true; + source = ./.bin/rofi-default-sink.sh; + }; + }; + packages = with pkgs; [ + spotify + signal-desktop + bitwarden + teams + ]; + }; + + xdg.desktopEntries = { + defaultSink = { + name = "Default Sink"; + exec = "/home/alex/.bin/rofi-default-sink.sh"; + terminal = false; + }; + }; programs = { vscode = { @@ -180,8 +197,8 @@ sxhkd = { enable = true; keybindings = { - "super + z" = "notify-send Time $(date '+%H:%M')"; - "super + x" = "notify-send Battery $(cat /sys/class/power_supply/BAT0/capacity)%"; + "super + x" = "notify-send Time $(date '+%H:%M')"; + "super + z" = "notify-send Battery $(cat /sys/class/power_supply/BAT0/capacity)%"; "alt + Tab" = "rofi -show window"; "super + Return" = "kitty"; "super + shift + Return" = "rofi -show drun"; @@ -214,6 +231,8 @@ duskTime = "21:00-22:00"; dawnTime = "06:30-07:00"; }; + + flameshot.enable = true; }; # manuals not needed