From f93700b22836af7e92108c697f4638bca433b87e Mon Sep 17 00:00:00 2001 From: tzlil Date: Fri, 24 Mar 2023 14:11:12 +0300 Subject: work on laptop --- hosts/laptop/cfg.nix | 2 ++ hosts/vm/cfg.nix | 9 +++++++-- mixins/greet.nix | 26 +++++++++++++++++--------- mixins/multimedia.nix | 34 ++++++++++++++++++++++++++++++---- mixins/sway.nix | 29 ++++++++++++++++------------- run.sh | 4 +++- 6 files changed, 75 insertions(+), 29 deletions(-) diff --git a/hosts/laptop/cfg.nix b/hosts/laptop/cfg.nix index 49bdbef..01d2f26 100644 --- a/hosts/laptop/cfg.nix +++ b/hosts/laptop/cfg.nix @@ -17,6 +17,8 @@ ../../mixins/greet.nix ../../mixins/hyprland.nix ../../mixins/sway.nix + ../../mixins/pipewire.nix + ../../mixins/multimedia.nix ]; config = { diff --git a/hosts/vm/cfg.nix b/hosts/vm/cfg.nix index 7f822b0..5c47612 100644 --- a/hosts/vm/cfg.nix +++ b/hosts/vm/cfg.nix @@ -13,6 +13,7 @@ ../../mixins/tailscale.nix ../../mixins/cli.nix ../../mixins/greet.nix + ../../mixins/pipewire.nix # ../../mixins/hyprland.nix ../../mixins/sway.nix # (modulesPath + "/profiles/qemu-guest.nix") @@ -81,13 +82,17 @@ algorithm = "zstd"; }; - greeter.initialSession = "sh -c ${pkgs.sway}/bin/sway"; - hardware.opengl = { enable = true; extraPackages = with pkgs; [ rocm-opencl-icd rocm-opencl-runtime ]; driSupport = true; driSupport32Bit = true; }; + + greeter.initialSession = "env WLR_RENDERER=pixman ${pkgs.sway.out}/bin/sway"; + # home-manager.users.tzlil.wayland.windowManager.sway.config.input."type:keyboard".xkb_variant = lib.mkForce ""; + + # nice to work with + security.sudo.wheelNeedsPassword = false; }; } diff --git a/mixins/greet.nix b/mixins/greet.nix index 103b37a..794d322 100644 --- a/mixins/greet.nix +++ b/mixins/greet.nix @@ -10,25 +10,33 @@ greet = "${pkgs.greetd.gtkgreet.out}/bin/gtkgreet -l -s ${pkgs.writeText "gtkgreet.css" " window { background-image: url(\"${pkgs.fetchurl { - url = "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fget.wallhere.com%2Fphoto%2FSerial-Experiments-Lain-anime-1363057.jpg&f=1&nofb=1&ipt=ba4bec61767537f6da6f0298f40e6a8ff2a5f1dc0e075a40bf77ba3a98654e15&ipo=images"; - sha256 = "sha256-oFUfNBdodHP7p/tAlwttzsY2SIyfsEgya6sN2GXEGy8="; + url = "https://i.imgur.com/D6qCaQG.png"; + sha256 = "sha256-Yt5JxmqN6++76cWu8EI/gsmelsJT/3jvLxyeRASQUhI="; }}\"); background-size: cover; background-position: center; + color: white; } box#body { - background-color: rgba(50, 50, 50, 0.5); - border-radius: 10px; + background-color: rgba(50, 50, 50, 0.8); + border-radius: 40px; padding: 50px; } + +# log in text +.text-button { + color: white; +} + + "}"; kiosk = command: "${pkgs.cage.out}/bin/cage -- ${command}"; in { options.greeter.initialSession = lib.mkOption { type = lib.types.str; - default = "sh -c ${pkgs.sway}/bin/sway"; + default = "${pkgs.sway.out}/bin/sway"; }; config = { @@ -43,10 +51,10 @@ in { inherit user; command = kiosk "${greet} -l &>/dev/null"; }; - # initial_session = { - # inherit user; - # command = config.greeter.initialSession; - # }; + initial_session = { + inherit user; + command = config.greeter.initialSession; + }; }; }; }; diff --git a/mixins/multimedia.nix b/mixins/multimedia.nix index d36be17..9d5c4b2 100644 --- a/mixins/multimedia.nix +++ b/mixins/multimedia.nix @@ -6,16 +6,42 @@ ... }: { config = { - home-manager.users.tzlil = {...}: { + home-manager.users.tzlil = {config, ...}: { fonts.fontconfig.enable = true; - home.packages = with pkgs; [ - mpv - zathura ffmpeg gimp transmission + xdg-utils + xdg-user-dirs ]; + xdg = { + enable = true; + mime.enable = true; + mimeApps = { + enable = true; + defaultApplications = { + "application/pdf" = ["${pkgs.zathura}/share/applications/org.pwmt.zathura.desktop"]; + }; + }; + userDirs = { + createDirectories = true; + desktop = "${config.home.homeDirectory}/desktop"; + download = "${config.home.homeDirectory}/downloads"; + }; + }; + + programs = { + mpv = { + enable = true; + scripts = [ + pkgs.mpvScripts.mpris + ]; + }; + zathura = { + enable = true; + }; + }; }; }; } diff --git a/mixins/sway.nix b/mixins/sway.nix index e559602..dd8a44c 100644 --- a/mixins/sway.nix +++ b/mixins/sway.nix @@ -66,6 +66,7 @@ in { font-awesome_6 waypipe foot + alsa-utils ]; services.swayidle = let @@ -207,8 +208,8 @@ in { input = { "type:keyboard" = { xkb_layout = "us"; - xkb_variant = "colemak_dh"; - xkb_options = "altwin:swap_lalt_lwin,caps:backspace"; + # xkb_variant = "colemak_dh"; + xkb_options = "caps:backspace"; }; "type:touchpad" = { tap = "enabled"; @@ -236,6 +237,7 @@ in { hide_edge_borders smart smart_borders on + # if want to use in the future use fetchurl # output * bg ~/tmp/graveyard.png fill @@ -252,15 +254,15 @@ in { font Iosevka 10 bindsym $mod+p exec passmenu $menu_args - bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle - bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% - bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% - bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle + bindsym --locked XF86AudioMute exec ${pkgs.pulseaudio}/bin/playerctl set-sink-mute @DEFAULT_SINK@ toggle + bindsym --locked XF86AudioLowerVolume exec ${pkgs.pulseaudio}/bin/playerctl set-sink-volume @DEFAULT_SINK@ -5% + bindsym --locked XF86AudioRaiseVolume exec ${pkgs.pulseaudio}/bin/playerctl set-sink-volume @DEFAULT_SINK@ +5% + bindsym --locked XF86AudioMicMute exec ${pkgs.pulseaudio}/bin/playerctl set-source-mute @DEFAULT_SOURCE@ toggle - bindsym --locked XF86AudioNext exec playerctl next - bindsym --locked XF86AudioPlay exec playerctl play-pause - bindsym --locked XF86AudioPrev exec playerctl previous - bindsym --locked XF86AudioStop exec playerctl stop + bindsym --locked XF86AudioNext exec ${pkgs.playerctl}/bin/playerctl next + bindsym --locked XF86AudioPlay exec ${pkgs.playerctl}/bin/playerctl play-pause + bindsym --locked XF86AudioPrev exec ${pkgs.playerctl}/bin/playerctl previous + bindsym --locked XF86AudioStop exec ${pkgs.playerctl}/bin/playerctl stop for_window [app_id="^menu$"] floating enable, border none for_window [app_id="mpv"] sticky enable @@ -270,8 +272,8 @@ in { for_window [app_id="imv"] floating enable for_window [class="PacketTracer"] floating enable - bindsym XF86MonBrightnessUp exec light -A 5 - bindsym XF86MonBrightnessDown exec light -U 5 + bindsym XF86MonBrightnessUp exec ${pkgs.brightnessctl}/bin/brightnessctl s +5% + bindsym XF86MonBrightnessDown exec ${pkgs.brightnessctl}/bin/brightnessctl s 5%- bindsym Print exec ${pkgs.grim}/bin/grim - | tee $(xdg-user-dir PICTURES)/$(date +'%s_grim.png') | wl-copy bindsym Shift+Print exec ${pkgs.grim}/bin/grim -g "$(${sel})" - | tee $(xdg-user-dir PICTURES)/$(date +'%s_grim.png') | wl-copy @@ -280,8 +282,9 @@ in { bindsym $mod+l exec ${pkgs.swaylock}/bin/swaylock -c 070D0D exec ${pkgs.mako}/bin/mako >/tmp/mako.log 2>&1 - exec_always kanshi >/tmp/kanshi.log 2>&1 + exec_always ${pkgs.kanshi}/bin/kanshi >/tmp/kanshi.log 2>&1 + exec foot include /etc/sway/config.d/* ''; }; diff --git a/run.sh b/run.sh index 7ac45bc..6cdee23 100755 --- a/run.sh +++ b/run.sh @@ -10,4 +10,6 @@ qemu-system-x86_64 \ -vga none \ -device virtio-gpu-pci \ -audiodev pa,id=snd0 \ - -usb -device usb-mouse + -usb -device usb-mouse \ + -audiodev jack,id=jack0,out.connect-ports=Family \ + -device ich9-intel-hda -device hda-duplex,audiodev=jack0 -- cgit 1.4.1