mirror of
https://github.com/librephoenix/nixos-config
synced 2025-07-05 22:44:34 +05:30
Created "hyprprofile" script to asort keybinds into profiles
This commit is contained in:
parent
e3010396f9
commit
511e3bf626
5 changed files with 72 additions and 3 deletions
36
user/wm/hyprland/hyprprofiles/hyprprofiles.nix
Normal file
36
user/wm/hyprland/hyprprofiles/hyprprofiles.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{ config, lib, pkgs, dmenuCmd ? "rofi -dmenu", ... }:
|
||||
let
|
||||
dmenuScript = ''
|
||||
#!/bin/sh
|
||||
choice="$(\ls ~/.config/hyprprofiles | ''+dmenuCmd+'')";
|
||||
hyprprofile $choice;
|
||||
'';
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
(pkgs.writeScriptBin "hyprprofile" ''
|
||||
#!/bin/sh
|
||||
prevprofile="$(cat ~/.hyprprofile)"
|
||||
newprofile=$1
|
||||
if [ $# -eq 1 ]; then
|
||||
if [ $newprofile = "Personal" ]; then
|
||||
echo "" > ~/.hyprprofile;
|
||||
else
|
||||
echo $newprofile > ~/.hyprprofile;
|
||||
fi
|
||||
if [ -f ~/.config/hyprprofiles/$prevprofile/exit-hook.sh ]; then
|
||||
exec ~/.config/hyprprofiles/$prevprofile/exit-hook.sh;
|
||||
fi
|
||||
if [ -f ~/.config/hyprprofiles/$newprofile/start-hook.sh ]; then
|
||||
exec ~/.config/hyprprofiles/$newprofile/start-hook.sh;
|
||||
fi
|
||||
fi
|
||||
'')
|
||||
(pkgs.writeScriptBin "hyprprofile-dmenu" dmenuScript)
|
||||
];
|
||||
home.file.".config/hyprprofiles/" = {
|
||||
source = ./profiles;
|
||||
recursive = true;
|
||||
executable = true;
|
||||
};
|
||||
}
|
4
user/wm/hyprland/hyprprofiles/profiles/Personal/start-hook.sh
Executable file
4
user/wm/hyprland/hyprprofiles/profiles/Personal/start-hook.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
hyprctl keyword unbind SUPER,S;
|
||||
hyprctl keyword bind SUPER,S,exec,qutebrowser;
|
5
user/wm/hyprland/hyprprofiles/profiles/Teaching/start-hook.sh
Executable file
5
user/wm/hyprland/hyprprofiles/profiles/Teaching/start-hook.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
hyprctl keyword unbind SUPER,S;
|
||||
hyprctl keyword bind SUPER,S,exec,container-open Teaching;
|
||||
emacsclient --eval '(org-roam-switch-db "Teaching.p")'
|
5
user/wm/hyprland/hyprprofiles/profiles/Youtube/start-hook.sh
Executable file
5
user/wm/hyprland/hyprprofiles/profiles/Youtube/start-hook.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
hyprctl keyword unbind SUPER,S;
|
||||
hyprctl keyword bind SUPER,S,exec,container-open Tech;
|
||||
emacsclient --eval '(org-roam-switch-db "Producer.p/LibrePhoenix.p")'
|
Loading…
Add table
Add a link
Reference in a new issue