activated shutdown menu by putting it in logind config (globally) and sway config

refactored dmenu to put the command into its own script and call it as a variable
added opam to ocaml config
refactored home-manager package list layout
added nordic theme for nvim
refactored weird touchpad config
added fcitx5 for input method switching and added a keybind to sway
This commit is contained in:
vorboyvo 2024-01-29 13:48:01 -05:00
parent d674cbc2ec
commit bcee64e3bf
6 changed files with 30 additions and 12 deletions

View file

@ -67,6 +67,8 @@
# Set login and power management options # Set login and power management options
services.logind.lidSwitch = "suspend"; services.logind.lidSwitch = "suspend";
services.logind.lidSwitchDocked = "ignore"; # when an external monitor is plugged in services.logind.lidSwitchDocked = "ignore"; # when an external monitor is plugged in
services.logind.powerKey = "ignore"; # handle this WM side
services.logind.powerKeyLongPress = "poweroff";
# Enable graphics. # Enable graphics.
hardware.opengl.enable = true; hardware.opengl.enable = true;

View file

@ -19,14 +19,14 @@ in
# Install packages # Install packages
home.packages = with pkgs; home.packages = with pkgs;
[ texliveFull ] ++ # TeX distribution [ texliveFull ] ++ # TeX distribution
(with ocamlPackages; [ ocaml dune_3 dune-release merlin ocaml-lsp odoc ocamlformat utop ]) ++ # OCaml (with ocamlPackages; [ ocaml opam dune_3 dune-release merlin ocaml-lsp odoc ocamlformat utop ]) ++ # OCaml
[ grim slurp wl-clipboard jq ] ++ # Basic utilities [ grim slurp wl-clipboard jq ] ++ # Basic utilities
[ bitwarden-cli ] ++ # Personalized selection of command-line (CLI/TUI) apps [ bitwarden-cli ] ++ # Personalized selection of command-line (CLI/TUI) apps
[ wezterm ] ++ # Terminal emulator [ wezterm ] ++ # Terminal emulator
[ firefox cinnamon.nemo gnome.file-roller cinnamon.nemo-fileroller imv vlc pavucontrol grim slurp wl-clipboard ] ++ # Basic graphical apps [ firefox cinnamon.nemo gnome.file-roller cinnamon.nemo-fileroller imv vlc pavucontrol ] ++ # Basic graphical apps
[ libreoffice signal-desktop element-desktop prismlauncher mumble gimp inkscape ] ++ # Personalized selection of graphical apps [ libreoffice signal-desktop element-desktop prismlauncher mumble gimp inkscape ] ++ # Personalized selection of graphical apps
# [ factorio ] ++ # Games # [ factorio ] ++ # Games
[ bemenu j4-dmenu-desktop ] ++ # Sway-related packages [ bemenu j4-dmenu-desktop fcitx5-with-addons grim slurp wl-clipboard ] ++ # Sway- and Wayland-related packages
[ noto-fonts redhat-official-fonts overpass ibm-plex ] ++ # Fonts [ noto-fonts redhat-official-fonts overpass ibm-plex ] ++ # Fonts
# [ vanilla-dmz ] ++ # Cursor # [ vanilla-dmz ] ++ # Cursor
[ ]; [ ];

View file

@ -35,6 +35,14 @@ plugins = {
}, },
["name"] = "nvim-lspconfig" ["name"] = "nvim-lspconfig"
}, },
{
'AlexvZyl/nordic.nvim',
lazy = false,
priority = 1000,
config = function()
require 'nordic' .load()
end
},
} }
require("lazy").setup(plugins) require("lazy").setup(plugins)

View file

@ -5,6 +5,8 @@ let
dynscreenshot = pkgs.writeShellScript "dynscreenshot" (builtins.readFile "${scripts}/dynscreenshot.sh"); dynscreenshot = pkgs.writeShellScript "dynscreenshot" (builtins.readFile "${scripts}/dynscreenshot.sh");
changebrightness = pkgs.writeShellScript "changebrightness" (builtins.readFile "${scripts}/changebrightness.sh"); changebrightness = pkgs.writeShellScript "changebrightness" (builtins.readFile "${scripts}/changebrightness.sh");
mod = config.wayland.windowManager.sway.config.modifier; mod = config.wayland.windowManager.sway.config.modifier;
dmenuCommand = builtins.readFile "${scripts}/dmenu.sh";
shutdownMenu = pkgs.writeShellScript "shutdownmenu" (builtins.readFile "${scripts}/shutdownmenu.sh");
in { in {
enable = true; enable = true;
config = rec { config = rec {
@ -15,7 +17,11 @@ in {
style = "Regular"; style = "Regular";
size = 12.0; size = 12.0;
}; };
input = { "type:touchpad" = { natural_scroll = "disabled"; }; }; input."type:touchpad" = {
natural_scroll = "disabled";
dwt = "disabled";
click_method = "clickfinger";
};
bars = let config = config; in [{ bars = let config = config; in [{
position = "top"; position = "top";
inherit fonts; inherit fonts;
@ -36,8 +42,11 @@ in {
XF86AudioLowerVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"; XF86AudioLowerVolume = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-";
"${mod}+XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05+"; "${mod}+XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05+";
"${mod}+XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05-"; "${mod}+XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.05-";
XF86PowerOff = "exec DMENU_COMMAND='${dmenuCommand}' bash ${shutdownMenu}";
} // {
"${mod}+space" = "exec fcitx5-remote -t";
}); });
menu = "j4-dmenu-desktop --no-generic --term=wezterm --dmenu='bemenu -i --fn Red Hat Display 12 -H 24 -p \"\" -B 2 --hp 5'"; # I don't like hardcoding kitty here, TODO think of better way to do it menu = "j4-dmenu-desktop --no-generic --term=wezterm --dmenu='${dmenuCommand}'"; # I don't like hardcoding kitty here, TODO think of better way to do it
focus.followMouse = false; focus.followMouse = false;
}; };
extraConfig = extraConfig =
@ -45,9 +54,7 @@ in {
output 'eDP-1' scale 1.50 output 'eDP-1' scale 1.50
'' + # Fractional scaling to 1.50 '' + # Fractional scaling to 1.50
'' ''
input type:touchpad { exec fcitx5
dwt disabled '' + # Fcitx5 enables input method switching
click_method clickfinger "";
}
''; # Disable fake scroll direction and disabling touchpad while typing, enable multi finger clicking
} }

View file

@ -1 +1 @@
bemenu -i --fn Red Hat Display 12 -H 24 -p \"\" -B 2 --hp 5' bemenu -i --fn Red Hat Display 12 -H 24 -p "" -B 2 --hp 5

View file

@ -1,4 +1,4 @@
case `printf "Cancel\nSuspend\nPower Off\nReboot\nLog Out" | sh dmenu.sh` in case `printf "Cancel\nSuspend\nPower Off\nReboot\nLog Out" | $DMENU_COMMAND` in
"Cancel") "Cancel")
: :
;; ;;
@ -14,3 +14,4 @@ case `printf "Cancel\nSuspend\nPower Off\nReboot\nLog Out" | sh dmenu.sh` in
"Log Out") "Log Out")
loginctl kill-session loginctl kill-session
;; ;;
esac