From 4a6725d5c01c804c96205d99663606dec4d0327e Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 22 Jan 2023 10:44:53 +0530 Subject: add rotate scripts --- flake.lock | 44 +++++++++++++++++++++++++++++++++++++++++- flake.nix | 14 ++++++++++++++ home.nix | 3 +++ hosts/myrtle/configuration.nix | 2 ++ programs/neovim.nix | 3 +++ scripts/default.nix | 17 ++++++++++++++++ services/dunst.nix | 2 +- 7 files changed, 83 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index 0f94912..b38c7fc 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,25 @@ { "nodes": { + "better-text-objs": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1674354525, + "narHash": "sha256-C0Fc7I2S1MGNGKgvGkMzzEyVF3WkRHlj8i+PF0o9tYI=", + "ref": "refs/heads/master", + "rev": "697b2c8f2415832bae7520a1d802e080363aa84b", + "revCount": 5, + "type": "git", + "url": "https://git.peppe.rs/vim/better-text-objs" + }, + "original": { + "type": "git", + "url": "https://git.peppe.rs/vim/better-text-objs" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -98,10 +118,12 @@ }, "root": { "inputs": { + "better-text-objs": "better-text-objs", "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", - "prompt": "prompt" + "prompt": "prompt", + "vim-colors-plain": "vim-colors-plain" } }, "rust-analyzer-src": { @@ -135,6 +157,26 @@ "repo": "flake-utils", "type": "github" } + }, + "vim-colors-plain": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1662030705, + "narHash": "sha256-eMPhWbybSTbf109A53Gmim6dGt7NwRwCfVbRXMIIEEo=", + "ref": "refs/heads/master", + "rev": "b381e6949ccd13b44fcab7b67e91dec2bb37deb2", + "revCount": 57, + "type": "git", + "url": "https://git.peppe.rs/vim/vim-colors-plain" + }, + "original": { + "type": "git", + "url": "https://git.peppe.rs/vim/vim-colors-plain" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 0d9692c..6a8b5d8 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,16 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + better-text-objs = { + url = "git+https://git.peppe.rs/vim/better-text-objs"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + vim-colors-plain = { + url = "git+https://git.peppe.rs/vim/vim-colors-plain"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; outputs = @@ -30,12 +40,16 @@ , home-manager # , statix , prompt + , better-text-objs + , vim-colors-plain , ... } @ inputs: { overlays = { # statix = statix.overlay; prompt = prompt.overlay; + better-text-objs = better-text-objs.overlay; + vim-colors-plain = vim-colors-plain.overlay; }; nixosConfigurations = { diff --git a/home.nix b/home.nix index 2cd58a5..6c5fa20 100644 --- a/home.nix +++ b/home.nix @@ -68,6 +68,9 @@ nixpkgs-fmt nix-prefetch-scripts + # work + slack + zoom-us ] ++ (import ./scripts { inherit pkgs; }); xdg = { diff --git a/hosts/myrtle/configuration.nix b/hosts/myrtle/configuration.nix index 2f47776..3bd8c56 100644 --- a/hosts/myrtle/configuration.nix +++ b/hosts/myrtle/configuration.nix @@ -42,6 +42,8 @@ nixpkgs.overlays = with self.overlays; [ # statix prompt + better-text-objs + vim-colors-plain ]; environment.systemPackages = with pkgs; [ diff --git a/programs/neovim.nix b/programs/neovim.nix index e593e44..9585e37 100644 --- a/programs/neovim.nix +++ b/programs/neovim.nix @@ -51,6 +51,9 @@ emmet-vim vimwiki fzf-vim + ] ++ [ + pkgs.better-text-objs + pkgs.vim-colors-plain ]; }; } diff --git a/scripts/default.nix b/scripts/default.nix index 20808e7..72d0235 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -60,6 +60,21 @@ let fi ''; + touchscreen = "ELAN9008:00 04F3:2ED6"; + stylus = "ELAN9008:00 04F3:2ED6 Stylus Pen (0)"; + portait-transform = builtins.toString [ 0 (-1) 1 1 0 0 0 0 1 ]; + landscape-transform = builtins.toString [ 0 0 0 0 0 0 0 0 0 ]; + portrait = pkgs.writeScriptBin "portrait" '' + ${pkgs.xorg.xrandr}/bin/xrandr -o left + ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${portait-transform} + ${pkgs.xorg.xinput}/bin/xinput set-prop "${stylus}" --type=float "Coordinate Transformation Matrix" ${portait-transform} + ''; + landscape = pkgs.writeScriptBin "landscape" '' + ${pkgs.xorg.xrandr}/bin/xrandr -o normal + ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${landscape-transform} + ${pkgs.xorg.xinput}/bin/xinput set-prop "${stylus}" --type=float "Coordinate Transformation Matrix" ${landscape-transform} + ''; + in [ webcam @@ -69,4 +84,6 @@ in uploader battery tmux-fzf + portrait + landscape ] diff --git a/services/dunst.nix b/services/dunst.nix index b8bda7f..c340c3e 100644 --- a/services/dunst.nix +++ b/services/dunst.nix @@ -10,7 +10,7 @@ with theme; enable = true; settings = { global = { - font = "Nerd Input 12"; + font = "Nerd Input 10"; allow_markup = "no"; format = ''%s\n%b''; sort = "yes"; -- cgit v1.2.3