about summary refs log tree commit diff
path: root/hosts
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-06-28 17:21:13 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2022-06-28 17:21:13 +0200
commit5182b4f2409009ac234dec148a971f502c596a3f (patch)
treef642fa780678cfea7023e5519eaefc7ddcd8ec37 /hosts
parentLuna: Add dmidecode system package (diff)
downloadnixos-config-5182b4f2409009ac234dec148a971f502c596a3f.tar.gz
nixos-config-5182b4f2409009ac234dec148a971f502c596a3f.tar.bz2
nixos-config-5182b4f2409009ac234dec148a971f502c596a3f.zip
Luna: Add xmodmap-based keymap config
Diffstat (limited to 'hosts')
-rw-r--r--hosts/luna/default.nix14
-rw-r--r--hosts/luna/home.nix40
2 files changed, 34 insertions, 20 deletions
diff --git a/hosts/luna/default.nix b/hosts/luna/default.nix
index bfaac26..0ebec80 100644
--- a/hosts/luna/default.nix
+++ b/hosts/luna/default.nix
@@ -17,20 +17,6 @@
       # don’t shutdown when power button is short-pressed
       HandlePowerKey=ignore
     '';
-    udev.extraHwdb = ''
-      evdev:name:AT Translated Set 2 keyboard:*
-       KEYBOARD_KEY_3b=back
-       KEYBOARD_KEY_3c=forward
-       KEYBOARD_KEY_3d=refresh
-       #KEYBOARD_KEY_3e=full_screen DOESNT CURRENTLY WORK WITH XORG (KEY_ZOOM), same with 3f
-       #KEYBOARD_KEY_3f=switchvideomode
-       KEYBOARD_KEY_40=brightnessdown
-       KEYBOARD_KEY_41=brightnessup
-       KEYBOARD_KEY_42=mute
-       KEYBOARD_KEY_43=volumedown
-       KEYBOARD_KEY_44=volumeup
-       KEYBOARD_KEY_db=search
-    '';
   };
 
   # Pick only one of the below networking options.
diff --git a/hosts/luna/home.nix b/hosts/luna/home.nix
index 89cec8e..45ee1c0 100644
--- a/hosts/luna/home.nix
+++ b/hosts/luna/home.nix
@@ -6,6 +6,7 @@ in
   home.packages = with pkgs; [
     #minecraft
     #jetbrains.idea-community
+    xorg.xmodmap
     calibre
     qtcreator
     kcc
@@ -60,20 +61,19 @@ in
         alt + grave
           bash ~/.scripts/screenshot
 
-        #TODO: Print
-        F5
+        Print
           bash ~/.scripts/screenshot
 
         XF86Search
         	dmenu_run -i
 
-        XF86PowerOff
-        	bash ~/.scripts/exit
-
-        #TODO: Change to XF86FullScreen or XF86XK_FullScreen when implemented
+        #TODO: should be XF86FullScreen (idk why it doesnt work with nixos xorg)
         F4
           dwmc togglefullscreen
 
+        XF86PowerOff
+        	bash ~/.scripts/exit
+
         ##################
         ##### VOLUME #####
         ##################
@@ -138,4 +138,32 @@ in
     '';
   };
 
+  home.file.".Xmodmap".text = ''
+    ! bind F1 and F2 to back and forward
+    ! Use Shift+F1 or Shift+F2 to use F1 and F2 actions, e.g. rename a file
+    keycode  67 = XF86Back F1 F1 F1 F1 F1 XF86Switch_VT_1
+    keycode  68 = XF86Forward F2 F2 F2 F2 F2 XF86Switch_VT_2
+
+    ! bind F3 to refresh
+    keycode  69 = XF86Refresh F3 F3 F3 F3 F3 XF86Switch_VT_3
+
+    ! TODO: bind F4 to fullscreen (when supported nixos xorg)
+    ! keycode  70 = XF86FullScreen F4 F4 F4 F4 F4 XF86Switch_VT_4
+
+    ! bind F5 to print
+    keycode  71 = Print F5 F5 F5 F5 F5 XF86Switch_VT_5
+
+    ! bind F6, F7 to brightness down and up
+    keycode  72 = XF86MonBrightnessDown F6 F6 F6 F6 F6 XF86Switch_VT_6
+    keycode  73 = XF86MonBrightnessUp F7 F7 F7 F7 F7 XF86Switch_VT_7
+
+    ! bind F8, F9, F10 to mute, voldown, volup
+    keycode  74 = XF86AudioMute F8 F8 F8 F8 F8 XF86Switch_VT_8
+    keycode  75 = XF86AudioLowerVolume F9 F9 F9 F9 F9 XF86Switch_VT_9
+    keycode  76 = XF86AudioRaiseVolume F10 F10 F10 F10 F10 XF86Switch_VT_10
+
+    ! bind Super+L to search
+    keycode  133 = XF86Search
+  '';
+
 }