Compare commits
No commits in common. "e9a8d16ecef24d9031b95c34af352359b7a4d95b" and "d994dfb9fbf8234726b291ffa148a8ec9e0658c0" have entirely different histories.
e9a8d16ece
...
d994dfb9fb
|
@ -179,6 +179,7 @@
|
|||
compsize
|
||||
|
||||
# toolbox
|
||||
sox
|
||||
imagemagick
|
||||
numbat
|
||||
];
|
||||
|
|
|
@ -5,25 +5,9 @@ let
|
|||
in
|
||||
{
|
||||
config = lib.mkIf config.frogeye.desktop.xorg {
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
home.packages = with pkgs; [
|
||||
pavucontrol # Because can't use Win+F1X on Pinebook 🙃
|
||||
sox
|
||||
];
|
||||
sessionVariables = {
|
||||
ALSA_PLUGIN_DIR = "${pkgs.alsa-plugins}/lib/alsa-lib"; # Fixes an issue with sox (Cannot open shared library libasound_module_pcm_pulse.so)
|
||||
# UPST Patch this upstream like: https://github.com/NixOS/nixpkgs/blob/216b111fb87091632d077898df647d1438fc2edb/pkgs/applications/audio/espeak-ng/default.nix#L84
|
||||
};
|
||||
};
|
||||
programs.bash.shellAliases = {
|
||||
beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null'';
|
||||
noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise'';
|
||||
};
|
||||
xdg.configFile = {
|
||||
"pulse/client.conf" = {
|
||||
text = ''cookie-file = .config/pulse/pulse-cookie'';
|
||||
};
|
||||
};
|
||||
xsession.windowManager.i3.config.keybindings =
|
||||
{
|
||||
"XF86AudioRaiseVolume" = "${pactl} set-sink-mute @DEFAULT_SINK@ false; ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
|
|
|
@ -79,7 +79,11 @@ in
|
|||
};
|
||||
};
|
||||
bash.shellAliases = {
|
||||
noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise'';
|
||||
beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null'';
|
||||
|
||||
x = "startx ${config.home.homeDirectory}/${config.xsession.scriptPath}; logout";
|
||||
|
||||
lmms = "lmms --config ${config.xdg.configHome}/lmmsrc.xml";
|
||||
};
|
||||
# Backup terminal
|
||||
|
@ -149,12 +153,16 @@ in
|
|||
# French, because then it there's a different initial for each, making navigation easier
|
||||
desktop = null;
|
||||
download = "${config.home.homeDirectory}/Téléchargements";
|
||||
music = "${config.home.homeDirectory}/Musiques";
|
||||
pictures = "${config.home.homeDirectory}/Images";
|
||||
publicShare = null;
|
||||
templates = null;
|
||||
videos = "${config.home.homeDirectory}/Vidéos";
|
||||
};
|
||||
configFile = {
|
||||
"pulse/client.conf" = {
|
||||
text = ''cookie-file = .config/pulse/pulse-cookie'';
|
||||
};
|
||||
"rofimoji.rc" = {
|
||||
text = ''
|
||||
skin-tone = neutral
|
||||
|
@ -162,6 +170,18 @@ in
|
|||
action = clipboard
|
||||
'';
|
||||
};
|
||||
"vimpc/vimpcrc" = {
|
||||
text = ''
|
||||
map FF :browse<C-M>gg/
|
||||
map à :set add next<C-M>a:set add end<C-M>
|
||||
map @ :set add next<C-M>a:set add end<C-M>:next<C-M>
|
||||
map ° D:browse<C-M>A:shuffle<C-M>:play<C-M>:playlist<C-M>
|
||||
set songformat {%a - %b: %t}|{%f}$E$R $H[$H%l$H]$H
|
||||
set libraryformat %n \| {%t}|{%f}$E$R $H[$H%l$H]$H
|
||||
set ignorecase
|
||||
set sort library
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
services = {
|
||||
|
@ -214,6 +234,8 @@ in
|
|||
};
|
||||
};
|
||||
packages = with pkgs; [
|
||||
pavucontrol # Because can't use Win+F1X on Pinebook 🙃
|
||||
|
||||
# remote
|
||||
tigervnc
|
||||
|
||||
|
@ -247,10 +269,16 @@ in
|
|||
xorg.xinit
|
||||
# TODO Make this clean. Service?
|
||||
|
||||
|
||||
# organisation
|
||||
pass
|
||||
thunderbird
|
||||
];
|
||||
sessionVariables = {
|
||||
MPD_PORT = "${toString config.services.mpd.network.port}";
|
||||
ALSA_PLUGIN_DIR = "${pkgs.alsa-plugins}/lib/alsa-lib"; # Fixes an issue with sox (Cannot open shared library libasound_module_pcm_pulse.so)
|
||||
# UPST Patch this upstream like: https://github.com/NixOS/nixpkgs/blob/216b111fb87091632d077898df647d1438fc2edb/pkgs/applications/audio/espeak-ng/default.nix#L84
|
||||
|
||||
RXVT_SOCKET = "${config.xdg.stateHome}/urxvtd"; # Used to want -$HOME suffix, hopefullt this isn't needed
|
||||
# XAUTHORITY = "${config.xdg.configHome}/Xauthority"; # Disabled as this causes lock-ups with DMs
|
||||
};
|
||||
|
|
|
@ -10,11 +10,14 @@ let
|
|||
''
|
||||
}";
|
||||
|
||||
# MISC
|
||||
mod = config.xsession.windowManager.i3.config.modifier;
|
||||
# MODES
|
||||
mode_system = "[L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction";
|
||||
mode_resize = "Resize";
|
||||
mode_pres_main = "Presentation (main display)";
|
||||
mode_pres_sec = "Presentation (secondary display)";
|
||||
mode_screen = "Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default";
|
||||
mode_temp = "Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue";
|
||||
fonts = config.stylix.fonts;
|
||||
rofi = "exec --no-startup-id ${config.programs.rofi.package}/bin/rofi";
|
||||
modes = config.frogeye.desktop.i3.bindmodes;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf config.xsession.windowManager.i3.enable {
|
||||
|
@ -37,6 +40,10 @@ in
|
|||
};
|
||||
focus.followMouse = false;
|
||||
keybindings =
|
||||
let
|
||||
mod = config.xsession.windowManager.i3.config.modifier;
|
||||
rofi = "exec --no-startup-id ${config.programs.rofi.package}/bin/rofi";
|
||||
in
|
||||
{
|
||||
# Compatibility layer for people coming from other backgrounds
|
||||
"Mod1+Tab" = "${rofi} -modi window -show window";
|
||||
|
@ -150,13 +157,71 @@ in
|
|||
"${mod}+Shift+c" = "reload";
|
||||
"${mod}+Shift+r" = "restart";
|
||||
"${mod}+Shift+e" = "exit";
|
||||
} // lib.mapAttrs' (k: v: lib.nameValuePair v.enter "mode ${v.name}") modes;
|
||||
modes = lib.mapAttrs'
|
||||
(k: v: lib.nameValuePair v.name (v.bindings // lib.optionalAttrs v.return_bindings {
|
||||
# Modes
|
||||
"${mod}+Escape" = "mode ${mode_system}";
|
||||
"${mod}+r" = "mode ${mode_resize}";
|
||||
"${mod}+Shift+p" = "mode ${mode_pres_main}";
|
||||
"${mod}+t" = "mode ${mode_screen}";
|
||||
"${mod}+y" = "mode ${mode_temp}";
|
||||
};
|
||||
# TOOD Config option so we don't have to separate name and binding
|
||||
modes = let return_bindings = {
|
||||
"Return" = "mode default";
|
||||
"Escape" = "mode default";
|
||||
}))
|
||||
modes;
|
||||
}; in
|
||||
{
|
||||
"${mode_system}" = {
|
||||
"l" = "exec --no-startup-id exec xlock, mode default";
|
||||
"e" = "exit, mode default";
|
||||
"s" = "exec --no-startup-id exec xlock & ${pkgs.systemd}/bin/systemctl suspend --check-inhibitors=no, mode default";
|
||||
"h" = "exec --no-startup-id exec xlock & ${pkgs.systemd}/bin/systemctl hibernate, mode default";
|
||||
"r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default";
|
||||
"p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default";
|
||||
} // return_bindings;
|
||||
"${mode_resize}" = {
|
||||
"h" = "resize shrink width 10 px or 10 ppt; ${focus}";
|
||||
"j" = "resize grow height 10 px or 10 ppt; ${focus}";
|
||||
"k" = "resize shrink height 10 px or 10 ppt; ${focus}";
|
||||
"l" = "resize grow width 10 px or 10 ppt; ${focus}";
|
||||
} // return_bindings;
|
||||
"${mode_pres_main}" = {
|
||||
"b" = "workspace 3, workspace 4, mode ${mode_pres_sec}";
|
||||
"q" = "mode default";
|
||||
"Return" = "mode default";
|
||||
};
|
||||
"${mode_pres_sec}" = {
|
||||
"b" = "workspace 1, workspace 2, mode ${mode_pres_main}";
|
||||
"q" = "mode default";
|
||||
"Return" = "mode default";
|
||||
};
|
||||
"${mode_screen}" =
|
||||
let
|
||||
builtin_configs = [ "off" "common" "clone-largest" "horizontal" "vertical" "horizontal-reverse" "vertical-reverse" ];
|
||||
autorandrmenu = { title, option, builtin ? false }: pkgs.writeShellScript "autorandrmenu"
|
||||
''
|
||||
shopt -s nullglob globstar
|
||||
profiles="${if builtin then lib.strings.concatLines builtin_configs else ""}$(${pkgs.autorandr}/bin/autorandr | ${pkgs.gawk}/bin/awk '{ print $1 }')"
|
||||
profile="$(echo "$profiles" | ${config.programs.rofi.package}/bin/rofi -dmenu -p "${title}")"
|
||||
[[ -n "$profile" ]] || exit
|
||||
${pkgs.autorandr}/bin/autorandr ${option} "$profile"
|
||||
'';
|
||||
in
|
||||
{
|
||||
"a" = "exec ${pkgs.autorandr}/bin/autorandr --change --force, mode default";
|
||||
"l" = "exec ${autorandrmenu {title="Load profile"; option="--load"; builtin = true;}}, mode default";
|
||||
"s" = "exec ${autorandrmenu {title="Save profile"; option="--save";}}, mode default";
|
||||
"r" = "exec ${autorandrmenu {title="Remove profile"; option="--remove";}}, mode default";
|
||||
"d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default";
|
||||
} // return_bindings;
|
||||
"${mode_temp}" = {
|
||||
"r" = "exec ${pkgs.sct}/bin/sct 1000";
|
||||
"d" = "exec ${pkgs.sct}/bin/sct 2000";
|
||||
"c" = "exec ${pkgs.sct}/bin/sct 4500";
|
||||
"o" = "exec ${pkgs.sct}/bin/sct";
|
||||
"a" = "exec ${pkgs.sct}/bin/sct 8000";
|
||||
"b" = "exec ${pkgs.sct}/bin/sct 10000";
|
||||
} // return_bindings;
|
||||
};
|
||||
window = {
|
||||
hideEdgeBorders = "both";
|
||||
titlebar = false; # So that single-container screens are basically almost fullscreen
|
||||
|
@ -196,111 +261,5 @@ in
|
|||
in
|
||||
forEachWorkspace ({ w, workspace }: { output = builtins.elemAt x11_screens (lib.mod w (builtins.length x11_screens)); workspace = workspace.name; });
|
||||
};
|
||||
frogeye.desktop.i3.bindmodes =
|
||||
let
|
||||
mode_pres_main = "Presentation (main display)";
|
||||
mode_pres_sec = "Presentation (secondary display)";
|
||||
in
|
||||
{
|
||||
"Resize" = {
|
||||
bindings = {
|
||||
"h" = "resize shrink width 10 px or 10 ppt; ${focus}";
|
||||
"j" = "resize grow height 10 px or 10 ppt; ${focus}";
|
||||
"k" = "resize shrink height 10 px or 10 ppt; ${focus}";
|
||||
"l" = "resize grow width 10 px or 10 ppt; ${focus}";
|
||||
};
|
||||
mod_enter = "r";
|
||||
};
|
||||
"[L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction" = {
|
||||
bindings = {
|
||||
"l" = "exec --no-startup-id exec xlock, mode default";
|
||||
"e" = "exit, mode default";
|
||||
"s" = "exec --no-startup-id exec xlock & ${pkgs.systemd}/bin/systemctl suspend --check-inhibitors=no, mode default";
|
||||
"h" = "exec --no-startup-id exec xlock & ${pkgs.systemd}/bin/systemctl hibernate, mode default";
|
||||
"r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default";
|
||||
"p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default";
|
||||
};
|
||||
mod_enter = "Escape";
|
||||
};
|
||||
"${mode_pres_main}" = {
|
||||
mod_enter = "Shift+p";
|
||||
bindings = {
|
||||
"b" = "workspace 3, workspace 4, mode ${mode_pres_sec}";
|
||||
"q" = "mode default";
|
||||
"Return" = "mode default";
|
||||
};
|
||||
return_bindings = false;
|
||||
};
|
||||
"${mode_pres_sec}" = {
|
||||
mod_enter = "Shift+p+2";
|
||||
bindings = {
|
||||
"b" = "workspace 1, workspace 2, mode ${mode_pres_main}";
|
||||
"q" = "mode default";
|
||||
"Return" = "mode default";
|
||||
};
|
||||
return_bindings = false;
|
||||
};
|
||||
"Screen setup [A] Auto [L] Load [S] Save [R] Remove [D] Default" =
|
||||
let
|
||||
builtin_configs = [ "off" "common" "clone-largest" "horizontal" "vertical" "horizontal-reverse" "vertical-reverse" ];
|
||||
autorandrmenu = { title, option, builtin ? false }: pkgs.writeShellScript "autorandrmenu"
|
||||
''
|
||||
shopt -s nullglob globstar
|
||||
profiles="${if builtin then lib.strings.concatLines builtin_configs else ""}$(${pkgs.autorandr}/bin/autorandr | ${pkgs.gawk}/bin/awk '{ print $1 }')"
|
||||
profile="$(echo "$profiles" | ${config.programs.rofi.package}/bin/rofi -dmenu -p "${title}")"
|
||||
[[ -n "$profile" ]] || exit
|
||||
${pkgs.autorandr}/bin/autorandr ${option} "$profile"
|
||||
'';
|
||||
in
|
||||
{
|
||||
bindings = {
|
||||
"a" = "exec ${pkgs.autorandr}/bin/autorandr --change --force, mode default";
|
||||
"l" = "exec ${autorandrmenu {title="Load profile"; option="--load"; builtin = true;}}, mode default";
|
||||
"s" = "exec ${autorandrmenu {title="Save profile"; option="--save";}}, mode default";
|
||||
"r" = "exec ${autorandrmenu {title="Remove profile"; option="--remove";}}, mode default";
|
||||
"d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default";
|
||||
};
|
||||
mod_enter = "t";
|
||||
};
|
||||
"Temperature [R] Red [D] Dust storm [C] Campfire [O] Normal [A] All nighter [B] Blue" = {
|
||||
bindings = {
|
||||
"r" = "exec ${pkgs.sct}/bin/sct 1000";
|
||||
"d" = "exec ${pkgs.sct}/bin/sct 2000";
|
||||
"c" = "exec ${pkgs.sct}/bin/sct 4500";
|
||||
"o" = "exec ${pkgs.sct}/bin/sct";
|
||||
"a" = "exec ${pkgs.sct}/bin/sct 8000";
|
||||
"b" = "exec ${pkgs.sct}/bin/sct 10000";
|
||||
};
|
||||
mod_enter = "y";
|
||||
};
|
||||
};
|
||||
};
|
||||
options = {
|
||||
frogeye.desktop.i3.bindmodes = lib.mkOption {
|
||||
default = { };
|
||||
type = lib.types.attrsOf (lib.types.submodule ({ config, name, ... }: {
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = name;
|
||||
};
|
||||
bindings = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.str;
|
||||
default = { };
|
||||
};
|
||||
enter = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "${mod}+${config.mod_enter}";
|
||||
};
|
||||
mod_enter = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
return_bindings = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
}));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
config = lib.mkIf config.frogeye.desktop.xorg {
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
home.packages = with pkgs; [
|
||||
ashuffle
|
||||
mpc-cli
|
||||
vimpc
|
||||
];
|
||||
sessionVariables = {
|
||||
MPD_PORT = "${toString config.services.mpd.network.port}";
|
||||
};
|
||||
};
|
||||
services.mpd = {
|
||||
enable = true;
|
||||
network = {
|
||||
|
@ -22,23 +17,6 @@
|
|||
restore_paused "yes"
|
||||
'';
|
||||
};
|
||||
xdg = {
|
||||
configFile = {
|
||||
"vimpc/vimpcrc" = {
|
||||
text = ''
|
||||
map FF :browse<C-M>gg/
|
||||
map à :set add next<C-M>a:set add end<C-M>
|
||||
map @ :set add next<C-M>a:set add end<C-M>:next<C-M>
|
||||
map ° D:browse<C-M>A:shuffle<C-M>:play<C-M>:playlist<C-M>
|
||||
set songformat {%a - %b: %t}|{%f}$E$R $H[$H%l$H]$H
|
||||
set libraryformat %n \| {%t}|{%f}$E$R $H[$H%l$H]$H
|
||||
set ignorecase
|
||||
set sort library
|
||||
'';
|
||||
};
|
||||
};
|
||||
userDirs.music = "${config.home.homeDirectory}/Musiques";
|
||||
};
|
||||
xsession.windowManager.i3.config.keybindings =
|
||||
{
|
||||
"XF86AudioPrev" = "exec ${pkgs.mpc-cli}/bin/mpc prev";
|
||||
|
|
Loading…
Reference in a new issue