From 8606da9f284414d3e3322baba8c0969a5d290437 Mon Sep 17 00:00:00 2001 From: aleidk Date: Thu, 13 Jul 2023 11:20:09 -0400 Subject: [PATCH] update sway config --- config/mako/config | 11 ++++++++ config/swappy/config | 10 +++++++ config/sway/config | 58 +++++++++++++++++++++++++++++++---------- config/sway/lock.sh | 17 ++++++++++++ config/zsh/zprofile | 1 + nixos/configuration.nix | 14 +++++++--- 6 files changed, 94 insertions(+), 17 deletions(-) create mode 100644 config/mako/config create mode 100644 config/swappy/config create mode 100755 config/sway/lock.sh diff --git a/config/mako/config b/config/mako/config new file mode 100644 index 0000000..1b7531f --- /dev/null +++ b/config/mako/config @@ -0,0 +1,11 @@ +default-timeout=5000 + +# Colors + +background-color=#24273a +text-color=#cad3f5 +border-color=#8aadf4 +progress-color=over #363a4f + +[urgency=high] +border-color=#f5a97f diff --git a/config/swappy/config b/config/swappy/config new file mode 100644 index 0000000..d0fa954 --- /dev/null +++ b/config/swappy/config @@ -0,0 +1,10 @@ +[Default] +save_dir=$HOME/Pictures +save_filename_format=screenshot-%Y%m%d-%H%M%S.png +show_panel=true +line_size=5 +text_size=20 +text_font=sans-serif +paint_mode=arrow +early_exit=true +fill_shape=false diff --git a/config/sway/config b/config/sway/config index 208af8c..0df742f 100644 --- a/config/sway/config +++ b/config/sway/config @@ -16,7 +16,21 @@ set $term alacritty # Your preferred application launcher # Note: pass the final command to swaymsg so that the resulting window can be opened # on the original workspace that the command was run on. -set $menu bemenu-run +set $menu bemenu-run -iw -l 20 -P '>' -p 'Open:' \ +--fn "JetBrainsMono 13" \ +--ab "#24273add" \ +--af "#f4dbd6" \ +--fb "#24273add" \ +--ff "#8bd5ca" \ +--hb "#24273add" \ +--hf "#a6da95" \ +--nb "#24273add" \ +--nf "#f4dbd6" \ +--nf "#f4dbd6" \ +--tb "#24273add" \ +--tf "#c6a0f6dd" \ +--scb "#24273add" \ +--scf "#c6a0f6" ### Output configuration # @@ -33,11 +47,10 @@ output * bg ~/Pictures/wallpaper.png fill # # Example configuration: # - exec swayidle -w \ - timeout 300 'swaylock -f -c 000000' \ - timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ - before-sleep 'swaylock -f -c 000000' -# +exec swayidle -w \ + timeout 300 'systemctl suspend' \ + before-sleep '~/.config/sway/lock.sh' + # This will lock your screen after 300 seconds of inactivity, then turn off # your displays after another 300 seconds, and turn your screens back on when # resumed. It will also lock your screen before your computer goes to sleep. @@ -112,7 +125,7 @@ input "type:keyboard" { # Workspaces: # # Switch to workspace - bindsym $mod+slash workspace back_and_forth + bindsym $mod+bar workspace back_and_forth bindsym $mod+1 workspace number 1 bindsym $mod+2 workspace number 2 bindsym $mod+3 workspace number 3 @@ -174,12 +187,15 @@ input "type:keyboard" { # # screenshot current window bindsym print exec grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" - | wl-copy + # screenshot area bindsym print+shift exec grim -g "$(slurp)" - | wl-copy + # screenshot area and edit it + bindsym print+ctrl exec grim -g "$(slurp)" - | swappy -f - - bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% - bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% - bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle - bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle + bindsym XF86AudioRaiseVolume exec wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+ + bindsym XF86AudioLowerVolume exec wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%- + bindsym XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle + bindsym XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle bindsym XF86AudioPlay exec playerctl play-pause bindsym XF86AudioNext exec playerctl next bindsym XF86AudioPrev exec playerctl previous @@ -230,13 +246,27 @@ bar { # Start Stuff +# create a master stack layout +exec_always autotiling -l 2 exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK -exec monitor-sensor | bash $DOTS/config/sway/autorotate &> /tmp/autorotate.log +exec mako + +# Auto rotate screen +# 1 option uses accelerometer (requires iio-sensors-proxy) +# 2 option uses tablet events + +# exec monitor-sensor | bash $DOTS/config/sway/autorotate &> /tmp/autorotate.log +bindswitch tablet:toggle output "eDP-1" transform 180 clockwise +# bindswitch lid:toggle exec echo "Lid moved" &>/tmp/lid.log + +bindgesture swipe:left workspace prev +bindgesture swipe:right workspace next +bindgesture swipe:up scratchpad show gaps inner 10 gaps outer 2 - -smart_borders on +default_border pixel 2 +default_floating_border pixel 2 xwayland enable diff --git a/config/sway/lock.sh b/config/sway/lock.sh new file mode 100755 index 0000000..d8133f5 --- /dev/null +++ b/config/sway/lock.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +swaylock \ + --screenshots \ + --clock \ + --indicator \ + --indicator-radius 100 \ + --indicator-thickness 7 \ + --effect-blur 7x5 \ + --effect-vignette 0.5:0.5 \ + --ring-color 3b4252 \ + --key-hl-color 880033 \ + --line-color 00000000 \ + --inside-color 00000088 \ + --separator-color 00000000 \ + --grace 2 \ + --fade-in 0.3 diff --git a/config/zsh/zprofile b/config/zsh/zprofile index 08eb996..180e794 100755 --- a/config/zsh/zprofile +++ b/config/zsh/zprofile @@ -9,6 +9,7 @@ export DOTS="$HOME/Repos/Private/dots" export EDITOR=nvim export VISUAL="$EDITOR" export QT_STYLE_OVERRIDE=kvantum +export MOZ_ENABLE_WAYLAND=1 # Dev Stuff export NPM_PACKAGES="$HOME/.npm-packages" diff --git a/nixos/configuration.nix b/nixos/configuration.nix index f10ce80..1a4023e 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { imports = @@ -45,6 +45,7 @@ # Enable the GNOME Desktop Environment. services.xserver.displayManager.sddm.enable = true; services.xserver.displayManager.sddm.theme = "catppuccin-macchiato"; + systemd.services.sddm.serviceConfig.TimeoutStartSec = lib.mkForce "5s"; # services.xserver.displayManager.gdm.wayland = true; # services.xserver.desktopManager.gnome.enable = true; # enable sway window manager @@ -145,7 +146,7 @@ slurp # screenshot starship swayidle - swaylock + swaylock-effects swaycons tealdeer tmux @@ -156,8 +157,15 @@ xdg-utils zellij zsh - pulseaudio brightnessctl + libnotify + autotiling + wdisplays + imv + mpv + celluloid + swappy + signal-desktop (callPackage ./theme.nix { }).sddm-catppucin-theme ];