restructure terminal stuff
This commit is contained in:
parent
366c10a2fd
commit
a11957d85a
4 changed files with 138 additions and 162 deletions
|
@ -13,6 +13,9 @@
|
|||
'';
|
||||
};
|
||||
|
||||
# to prevent strange errors
|
||||
programs.kitty.enable = true;
|
||||
|
||||
programs.thefuck.enable = true;
|
||||
|
||||
# a better cat
|
||||
|
|
18
homes/palo/gui/alacritty.nix
Normal file
18
homes/palo/gui/alacritty.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
with lib;
|
||||
{
|
||||
|
||||
options.gui.alacritty.enable = mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.gui.enable;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.gui.alacritty.enable {
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
font.size = mkForce 6.5;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,3 +1,6 @@
|
|||
{
|
||||
imports = [ ./kitty.nix ];
|
||||
imports = [
|
||||
./alacritty.nix
|
||||
./kitty.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{ config, lib, pkgs, osConfig, ... }:
|
||||
let
|
||||
|
||||
cfg = config.xsession.windowManager.i3;
|
||||
|
||||
rofi = pkgs.rofi.override { plugins = [ pkgs.rofi-emoji pkgs.rofi-calc pkgs.xdotool ]; };
|
||||
|
||||
backgroundCommand = pkgs.writers.writeDash "background" ''
|
||||
|
@ -26,8 +24,12 @@ let
|
|||
in
|
||||
|
||||
{
|
||||
options.gui.i3.enable = mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.gui.enable;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.gui.enable {
|
||||
config = lib.mkIf config.gui.i3.enable {
|
||||
|
||||
home.packages =
|
||||
let
|
||||
|
@ -42,8 +44,6 @@ in
|
|||
pkgs.xdotool # needed for rofi-emoji
|
||||
];
|
||||
|
||||
|
||||
|
||||
programs.i3status-rust = {
|
||||
enable = true;
|
||||
bars = {
|
||||
|
@ -118,12 +118,6 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
font.size = lib.mkForce 6.5;
|
||||
};
|
||||
};
|
||||
|
||||
services.copyq = {
|
||||
enable = true;
|
||||
|
@ -188,127 +182,131 @@ in
|
|||
];
|
||||
|
||||
|
||||
keybindings = {
|
||||
"Print" = "exec ${pkgs.flameshot}/bin/flameshot gui -c -p /share/";
|
||||
"${cfg.config.modifier}+Return" = "exec ${cfg.config.terminal}";
|
||||
"${cfg.config.modifier}+Shift+q" = "exit";
|
||||
"${cfg.config.modifier}+q" = "kill";
|
||||
keybindings =
|
||||
let
|
||||
cfg = config.xsession.windowManager.i3;
|
||||
modifier = config.xsession.windowManager.i3.config.modifier;
|
||||
in
|
||||
{
|
||||
"Print" = "exec ${pkgs.flameshot}/bin/flameshot gui -c -p /share/";
|
||||
"${modifier}+Return" = "exec ${cfg.config.terminal}";
|
||||
"${modifier}+Shift+q" = "exit";
|
||||
"${modifier}+q" = "kill";
|
||||
|
||||
"${cfg.config.modifier}+Left" = "focus left";
|
||||
"${cfg.config.modifier}+Down" = "focus down";
|
||||
"${cfg.config.modifier}+Up" = "focus up";
|
||||
"${cfg.config.modifier}+Right" = "focus right";
|
||||
"${cfg.config.modifier}+j" = "focus next";
|
||||
"${cfg.config.modifier}+k" = "focus prev";
|
||||
"${modifier}+Left" = "focus left";
|
||||
"${modifier}+Down" = "focus down";
|
||||
"${modifier}+Up" = "focus up";
|
||||
"${modifier}+Right" = "focus right";
|
||||
"${modifier}+j" = "focus next";
|
||||
"${modifier}+k" = "focus prev";
|
||||
|
||||
"${cfg.config.modifier}+Shift+Left" = "move left";
|
||||
"${cfg.config.modifier}+Shift+Down" = "move down";
|
||||
"${cfg.config.modifier}+Shift+Up" = "move up";
|
||||
"${cfg.config.modifier}+Shift+Right" = "move right";
|
||||
"${modifier}+Shift+Left" = "move left";
|
||||
"${modifier}+Shift+Down" = "move down";
|
||||
"${modifier}+Shift+Up" = "move up";
|
||||
"${modifier}+Shift+Right" = "move right";
|
||||
|
||||
"${cfg.config.modifier}+h" = "split h";
|
||||
"${cfg.config.modifier}+v" = "split v";
|
||||
"${cfg.config.modifier}+f" = "fullscreen toggle";
|
||||
"${modifier}+h" = "split h";
|
||||
"${modifier}+v" = "split v";
|
||||
"${modifier}+f" = "fullscreen toggle";
|
||||
|
||||
"${cfg.config.modifier}+s" = "layout stacking";
|
||||
"${cfg.config.modifier}+w" = "layout tabbed";
|
||||
"${cfg.config.modifier}+e" = "layout toggle split";
|
||||
"${modifier}+s" = "layout stacking";
|
||||
"${modifier}+w" = "layout tabbed";
|
||||
"${modifier}+e" = "layout toggle split";
|
||||
|
||||
"${cfg.config.modifier}+t" = "floating toggle";
|
||||
#"${cfg.config.modifier}+space" = "focus mode_toggle";
|
||||
"${modifier}+t" = "floating toggle";
|
||||
|
||||
"${cfg.config.modifier}+b" = "exec ${backgroundCommand}";
|
||||
"${modifier}+b" = "exec ${backgroundCommand}";
|
||||
|
||||
"${cfg.config.modifier}+p" = "focus parent";
|
||||
"${modifier}+p" = "focus parent";
|
||||
|
||||
"${cfg.config.modifier}+Shift+minus" = "move scratchpad";
|
||||
"${cfg.config.modifier}+minus" = "scratchpad show";
|
||||
"${modifier}+Shift+minus" = "move scratchpad";
|
||||
"${modifier}+minus" = "scratchpad show";
|
||||
|
||||
"${cfg.config.modifier}+1" = "workspace 1";
|
||||
"${cfg.config.modifier}+2" = "workspace 2";
|
||||
"${cfg.config.modifier}+3" = "workspace 3";
|
||||
"${cfg.config.modifier}+4" = "workspace 4";
|
||||
"${cfg.config.modifier}+5" = "workspace 5";
|
||||
"${cfg.config.modifier}+6" = "workspace 6";
|
||||
"${cfg.config.modifier}+7" = "workspace 7";
|
||||
"${cfg.config.modifier}+8" = "workspace 8";
|
||||
"${cfg.config.modifier}+9" = "workspace 9";
|
||||
"${cfg.config.modifier}+0" = "workspace 10";
|
||||
"${modifier}+1" = "workspace 1";
|
||||
"${modifier}+2" = "workspace 2";
|
||||
"${modifier}+3" = "workspace 3";
|
||||
"${modifier}+4" = "workspace 4";
|
||||
"${modifier}+5" = "workspace 5";
|
||||
"${modifier}+6" = "workspace 6";
|
||||
"${modifier}+7" = "workspace 7";
|
||||
"${modifier}+8" = "workspace 8";
|
||||
"${modifier}+9" = "workspace 9";
|
||||
"${modifier}+0" = "workspace 10";
|
||||
|
||||
"${cfg.config.modifier}+Shift+1" = "move container to workspace number 1";
|
||||
"${cfg.config.modifier}+Shift+2" = "move container to workspace number 2";
|
||||
"${cfg.config.modifier}+Shift+3" = "move container to workspace number 3";
|
||||
"${cfg.config.modifier}+Shift+4" = "move container to workspace number 4";
|
||||
"${cfg.config.modifier}+Shift+5" = "move container to workspace number 5";
|
||||
"${cfg.config.modifier}+Shift+6" = "move container to workspace number 6";
|
||||
"${cfg.config.modifier}+Shift+7" = "move container to workspace number 7";
|
||||
"${cfg.config.modifier}+Shift+8" = "move container to workspace number 8";
|
||||
"${cfg.config.modifier}+Shift+9" = "move container to workspace number 9";
|
||||
"${cfg.config.modifier}+Shift+0" = "move container to workspace number 10";
|
||||
"${modifier}+Shift+1" = "move container to workspace number 1";
|
||||
"${modifier}+Shift+2" = "move container to workspace number 2";
|
||||
"${modifier}+Shift+3" = "move container to workspace number 3";
|
||||
"${modifier}+Shift+4" = "move container to workspace number 4";
|
||||
"${modifier}+Shift+5" = "move container to workspace number 5";
|
||||
"${modifier}+Shift+6" = "move container to workspace number 6";
|
||||
"${modifier}+Shift+7" = "move container to workspace number 7";
|
||||
"${modifier}+Shift+8" = "move container to workspace number 8";
|
||||
"${modifier}+Shift+9" = "move container to workspace number 9";
|
||||
"${modifier}+Shift+0" = "move container to workspace number 10";
|
||||
|
||||
"${cfg.config.modifier}+Escape" = "workspace back_and_forth";
|
||||
"${modifier}+Escape" = "workspace back_and_forth";
|
||||
|
||||
# rename workspace
|
||||
"${cfg.config.modifier}+n" = ''
|
||||
exec i3-input -F 'rename workspace to "%s"' -P 'New name for this workspace: '
|
||||
'';
|
||||
# rename workspace
|
||||
"${modifier}+n" = ''
|
||||
exec i3-input -F 'rename workspace to "%s"' -P 'New name for this workspace: '
|
||||
'';
|
||||
|
||||
# change to named workspace
|
||||
"${cfg.config.modifier}+grave" =
|
||||
let
|
||||
script = pkgs.writers.writeBash "select-workspace" ''
|
||||
set -e
|
||||
set -o pipefail
|
||||
${pkgs.i3}/bin/i3-msg -t get_workspaces | \
|
||||
${pkgs.jq}/bin/jq --raw-output '.[] | .name' | \
|
||||
${rofi}/bin/rofi -dmenu -p 'Select Workspace ' | \
|
||||
while read line
|
||||
do
|
||||
${pkgs.i3}/bin/i3-msg workspace "$line"
|
||||
done
|
||||
'';
|
||||
in
|
||||
"exec ${script}";
|
||||
# change to named workspace
|
||||
"${modifier}+grave" =
|
||||
let
|
||||
script = pkgs.writers.writeBash "select-workspace" ''
|
||||
set -e
|
||||
set -o pipefail
|
||||
${pkgs.i3}/bin/i3-msg -t get_workspaces | \
|
||||
${pkgs.jq}/bin/jq --raw-output '.[] | .name' | \
|
||||
${rofi}/bin/rofi -dmenu -p 'Select Workspace ' | \
|
||||
while read line
|
||||
do
|
||||
${pkgs.i3}/bin/i3-msg workspace "$line"
|
||||
done
|
||||
'';
|
||||
in
|
||||
"exec ${script}";
|
||||
|
||||
"${cfg.config.modifier}+Shift+grave" =
|
||||
let
|
||||
script = pkgs.writers.writeBash "move-workspace" ''
|
||||
set -e
|
||||
set -o pipefail
|
||||
${pkgs.i3}/bin/i3-msg -t get_workspaces | \
|
||||
${pkgs.jq}/bin/jq --raw-output '.[] | .name' | \
|
||||
${rofi}/bin/rofi -dmenu -p 'Move to Workspace ' | \
|
||||
while read line
|
||||
do
|
||||
${pkgs.i3}/bin/i3-msg move container to workspace "$line"
|
||||
done
|
||||
'';
|
||||
in
|
||||
"exec ${script}";
|
||||
"${modifier}+Shift+grave" =
|
||||
let
|
||||
script = pkgs.writers.writeBash "move-workspace" ''
|
||||
set -e
|
||||
set -o pipefail
|
||||
${pkgs.i3}/bin/i3-msg -t get_workspaces | \
|
||||
${pkgs.jq}/bin/jq --raw-output '.[] | .name' | \
|
||||
${rofi}/bin/rofi -dmenu -p 'Move to Workspace ' | \
|
||||
while read line
|
||||
do
|
||||
${pkgs.i3}/bin/i3-msg move container to workspace "$line"
|
||||
done
|
||||
'';
|
||||
in
|
||||
"exec ${script}";
|
||||
|
||||
"${cfg.config.modifier}+space" = "exec ${rofi}/bin/rofi -show drun -display-drun ''";
|
||||
"${cfg.config.modifier}+Shift+c" = "reload";
|
||||
"${cfg.config.modifier}+Shift+r" = "restart";
|
||||
"${cfg.config.modifier}+Shift+e" = "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
|
||||
"${modifier}+space" = "exec ${rofi}/bin/rofi -show drun -display-drun ''";
|
||||
"${modifier}+Shift+c" = "reload";
|
||||
"${modifier}+Shift+r" = "restart";
|
||||
"${modifier}+Shift+e" = "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
|
||||
|
||||
"${cfg.config.modifier}+r" = "mode resize";
|
||||
"${modifier}+r" = "mode resize";
|
||||
|
||||
# multiple monitors
|
||||
# autorandr --save docked # to save setup
|
||||
# autorandr --save undocked # to save setup
|
||||
# autorandr --change # automatically detects the setup
|
||||
"${cfg.config.modifier}+BackSpace" =
|
||||
let
|
||||
script = pkgs.writers.writeBash "autorandr" ''
|
||||
${pkgs.autorandr}/bin/autorandr --change
|
||||
${backgroundCommand}
|
||||
'';
|
||||
in
|
||||
"exec ${toString script}";
|
||||
# multiple monitors
|
||||
# autorandr --save docked # to save setup
|
||||
# autorandr --save undocked # to save setup
|
||||
# autorandr --change # automatically detects the setup
|
||||
"${modifier}+BackSpace" =
|
||||
let
|
||||
script = pkgs.writers.writeBash "autorandr" ''
|
||||
${pkgs.autorandr}/bin/autorandr --change
|
||||
${backgroundCommand}
|
||||
'';
|
||||
in
|
||||
"exec ${toString script}";
|
||||
|
||||
# like vimperator
|
||||
"${cfg.config.modifier}+a" = "exec ${pkgs.i3-easyfocus}/bin/i3-easyfocus";
|
||||
};
|
||||
# like vimperator
|
||||
"${modifier}+a" = "exec ${pkgs.i3-easyfocus}/bin/i3-easyfocus";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -494,52 +492,6 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
xdg.configFile."albert/albert.conf".text = ''
|
||||
[General]
|
||||
hotkey=Meta+Space
|
||||
showTray=false
|
||||
telemetry=false
|
||||
terminal=urxvt -e
|
||||
|
||||
[org.albert.extension.applications]
|
||||
enabled=true
|
||||
fuzzy=true
|
||||
use_generic_name=true
|
||||
use_keywords=true
|
||||
|
||||
[org.albert.extension.calculator]
|
||||
enabled=true
|
||||
|
||||
[org.albert.extension.hashgenerator]
|
||||
enabled=true
|
||||
|
||||
[org.albert.frontend.widgetboxmodel]
|
||||
alwaysOnTop=true
|
||||
clearOnHide=false
|
||||
displayIcons=true
|
||||
displayScrollbar=false
|
||||
displayShadow=false
|
||||
hideOnClose=false
|
||||
hideOnFocusLoss=true
|
||||
itemCount=5
|
||||
showCentered=true
|
||||
theme=SolarizedBrightViolet
|
||||
'';
|
||||
|
||||
xdg.configFile."Code/User/settings.json".text = builtins.toJSON {
|
||||
"keyboard.dispatch" = "keyCode";
|
||||
"explorer.confirmDragAndDrop" = false;
|
||||
"editor.tabSize" = 2;
|
||||
"window.zoomLevel" = -1;
|
||||
"git.enableSmartCommit" = true;
|
||||
"files.autoSave" = "onFocusChange";
|
||||
"terminal.integrated.setLocaleVariables" = true;
|
||||
"terminal.external.linuxExec" = "xterm";
|
||||
"explorer.confirmDelete" = false;
|
||||
"todo-tree.tags" = [ "todo" "TODO" "fixme" "FIXME" ];
|
||||
"workbench.colorTheme" = "Solarized Light";
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue