fix moving windows, add wofi

This commit is contained in:
Noa Aarts 2024-02-29 15:14:08 +01:00
parent fa9a38e0a3
commit afd8319ac7
3 changed files with 134 additions and 15 deletions

6
flake.lock generated
View file

@ -181,11 +181,11 @@
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1709109026, "lastModified": 1709118025,
"narHash": "sha256-gW1UIlzNnk9F6M04GAqF9sctGAz0CZrGlIPy7IDqAQI=", "narHash": "sha256-IwzgIAKHJI+qcno0pExTOfhqKgHzA5vc++gfgJ0ZCok=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "bb9d56087dda932274e25702ce32b725295d926d", "rev": "8bb460e261dd0fd8ac3f544f8a2a28ad64616cbe",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -26,7 +26,11 @@
# Enable networking # Enable networking
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings = {
# auto optimise every so often
auto-optimise-store = true;
experimental-features = ["nix-command" "flakes"];
};
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Amsterdam"; time.timeZone = "Europe/Amsterdam";

View file

@ -42,12 +42,47 @@
wl-clipboard wl-clipboard
(writeShellScriptBin "discord" '' (writeShellScriptBin "discord" ''
exec ${pkgs.discord}/bin/discord --enable-features=UseOzonePlatform --ozone-platform=wayland exec ${discord}/bin/discord --enable-features=UseOzonePlatform --ozone-platform=wayland
'') '')
kitty kitty
wofi
pipewire pipewire
lsd lsd
(writeShellScriptBin "wofi-launch" ''
${wofi}/bin/wofi --show drun
'')
(writeShellScriptBin "wofi-power" ''
lock="Lock"
logout="Logout"
poweroff="Poweroff"
reboot="Reboot"
sleep="Suspend"
selected_option=$(echo -e "$lock\n$logout\n$sleep\n$reboot\n$poweroff" | wofi --dmenu -i -p "Powermenu")
if [ "$selected_option" == "$lock" ]
then
echo "lock"
swaylock
elif [ "$selected_option" == "$logout" ]
then
echo "logout"
loginctl terminate-user `whoami`
elif [ "$selected_option" == "$poweroff" ]
then
echo "poweroff"
poweroff
elif [ "$selected_option" == "$reboot" ]
then
echo "reboot"
reboot
elif [ "$selected_option" == "$sleep" ]
then
echo "sleep"
suspend
else
echo "No match"
fi
'')
]; ];
@ -92,6 +127,87 @@
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
# TODO move to seperate file
programs.wofi = {
enable = true;
settings = {
};
style = ''
* {
outline: none;
outline-style: none;
}
#window {
margin: 10px;
border: none;
background-color: transparent;
border-radius: 10px;
font-family:
JetBrains Mono NF,
monospace;
font-weight: bold;
font-size: 14px;
}
#outer-box {
margin: 10px;
border: 2px @lavender;
border-radius: 10px;
background-color: transparent;
}
#input {
border: none;
border-radius: 10px;
margin-left: 2px;
color: @text;
outline-style: none;
background-color: @base;
}
#scroll {
border: 10px solid @mantle;
border-radius: 10px;
/*padding-right: 10px;*/
outline: none;
background-color: @base;
}
#inner-box {
border: none;
border-radius: 10px;
background-color: transparent;
}
#entry {
border: none;
/*border-radius: 10px;
margin-right: 15px;
margin-left: 15px;*/
padding-right: 10px;
padding-left: 10px;
color: @subtext0;
background-color: @base;
}
#entry:selected {
border: none;
background-color: @green;
}
#text:selected {
border: none;
color: @crust;
}
#img {
background-color: transparent;
margin-right: 6px;
}
'';
};
# TODO move to seperate file # TODO move to seperate file
programs.zsh = { programs.zsh = {
enable=true; enable=true;
@ -168,9 +284,8 @@
"custom/poweroff" = { "custom/poweroff" = {
# TODO fix format # TODO fix format
format = "P"; format = "P";
# TODO make this file exist on-click = "wofi-power";
on-click = "bash ${config.xdg.configHome}/wofi/powermenu.sh"; on-click-right = "swaylock";
on-click-right = "bash ${config.xdg.configHome}/wofi/powermenu.sh";
}; };
"custom/pronouns" = { "custom/pronouns" = {
format = "{}"; format = "{}";
@ -491,17 +606,17 @@
"$mod,Return,exec,kitty" "$mod,Return,exec,kitty"
"$mod,tab,cyclenext" "$mod,tab,cyclenext"
"SUPERSHIFT,Q,killactive" "SUPERSHIFT,Q,killactive"
"$mod,SPACE,exec,bash ${config.xdg.configHome}/wofi/launcher.sh" "$mod,SPACE,exec,wofi-launch"
"$mod,P,exec,bash ${config.xdg.configHome}/wofi/powermenu.sh" "$mod,P,exec,wofi-power"
"SUPERSHIFT,m,exit" "SUPERSHIFT,m,exit"
"$mod,H,movefocus,l" "$mod,H,movefocus,l"
"$mod,J,movefocus,u" "$mod,J,movefocus,u"
"$mod,K,movefocus,d" "$mod,K,movefocus,d"
"$mod,L,movefocus,r" "$mod,L,movefocus,r"
"SUPERSHIFT,H,movefocus,l" "SUPERSHIFT,H,movewindow,l"
"SUPERSHIFT,J,movefocus,u" "SUPERSHIFT,J,movewindow,u"
"SUPERSHIFT,K,movefocus,d" "SUPERSHIFT,K,movewindow,d"
"SUPERSHIFT,L,movefocus,r" "SUPERSHIFT,L,movewindow,r"
"$mod,F,togglefloating" "$mod,F,togglefloating"
"$mod,X,togglespecialworkspace" "$mod,X,togglespecialworkspace"
"SUPERSHIFT,X,movetoworkspace,special" "SUPERSHIFT,X,movetoworkspace,special"