From 2e288fbf8ceed32e753923f1afc621e3f052acf5 Mon Sep 17 00:00:00 2001 From: "J. Elfring (g)" Date: Fri, 8 Nov 2024 14:50:56 +0100 Subject: [PATCH] Install keyd for gpd pocket and create umlaut shortcuts --- dotfiles/i3-session/dot-xprofile | 12 +--- system/arch/baseconfig.yaml | 11 --- system/arch/workstation.yaml | 67 ----------------- system/arch/x_gpdpocket2.yaml | 119 +++++++++++++++++++++++++++++++ 4 files changed, 120 insertions(+), 89 deletions(-) create mode 100644 system/arch/x_gpdpocket2.yaml diff --git a/dotfiles/i3-session/dot-xprofile b/dotfiles/i3-session/dot-xprofile index ce5c497..b5912a5 100644 --- a/dotfiles/i3-session/dot-xprofile +++ b/dotfiles/i3-session/dot-xprofile @@ -13,15 +13,5 @@ test -x ~/.screenlayout/.default && ~/.screenlayout/.default test -x ~/.fehbg && ~/.fehbg ## Setup Keyboard -case $HOSTNAME in - *"gpd"*) - xmodmap -e 'keycode 49 = Multi_key' # Kanji-key - xmodmap -e 'keycode 132 = grave asciitilde' # grave-key - xmodmap -e 'keycode 29 = z Z z Z' # y-z - xmodmap -e 'keycode 52 = y Y y Y' # z-y - ;; - *) - xmodmap -e 'keycode 135 = Multi_key' # remaps context-menu-key to Compose - ;; -esac +xmodmap -e 'keycode 135 = Multi_key' # remaps context-menu-key to Compose diff --git a/system/arch/baseconfig.yaml b/system/arch/baseconfig.yaml index e233480..6254976 100644 --- a/system/arch/baseconfig.yaml +++ b/system/arch/baseconfig.yaml @@ -41,17 +41,6 @@ content: | KEYMAP=de-latin1-nodeadkeys - - name: "Console settings (GPD Pocket 2)" - when: "'gpd' in ansible_hostname" - ansible.builtin.copy: - dest: /etc/vconsole.conf - owner: root - group: root - mode: 0644 - content: | - KEYMAP=de-latin1-nodeadkeys - FONT=latarcyrheb-sun32 - - name: "Localization: Set papersize" ansible.builtin.copy: dest: /etc/papersize diff --git a/system/arch/workstation.yaml b/system/arch/workstation.yaml index a752008..2bca5ed 100644 --- a/system/arch/workstation.yaml +++ b/system/arch/workstation.yaml @@ -249,52 +249,6 @@ group: root mode: 0644 - - name: "X11: Keyboard (GPD Pocket 2)" - when: "'gpd' in ansible_hostname" - ansible.builtin.copy: - dest: /etc/X11/xorg.conf.d/00-keyboard.conf - src: ./lib/etc/X11/xorg.conf.d/00-keyboard.conf.gpdp2 - owner: root - group: root - mode: 0644 - - - name: "X11: Intel Graphics (GPD Pocket 2)" - when: "'gpd' in ansible_hostname" - ansible.builtin.copy: - dest: /etc/X11/xorg.conf.d/20-intel.conf - src: ./lib/etc/X11/xorg.conf.d/20-intel.conf.gpdp2 - owner: root - group: root - mode: 0644 - - - name: "X11: Monitor (GPD Pocket 2)" - when: "'gpd' in ansible_hostname" - ansible.builtin.copy: - dest: /etc/X11/xorg.conf.d/30-display.conf - src: ./lib/etc/X11/xorg.conf.d/30-display.conf.gpdp2 - owner: root - group: root - mode: 0644 - - - name: "X11: Touchscreen (GPD Pocket 2)" - when: "'gpd' in ansible_hostname" - ansible.builtin.copy: - dest: /etc/X11/xorg.conf.d/99-touchscreen.conf - src: ./lib/etc/X11/xorg.conf.d/99-touchscreen.conf.gpdp2 - owner: root - group: root - mode: 0644 - - - name: "X11: Xresources (GPD Pocket 2)" - when: "'gpd' in ansible_hostname" - ansible.builtin.copy: - dest: /etc/X11/Xresources - src: ./lib/etc/X11/Xresources.gpdp2 - owner: root - group: root - mode: 0644 - - ## Notbook Specials - name: "Install Notebook packages" when: ansible_facts['form_factor'] == "Notebook" @@ -321,27 +275,6 @@ state: started enabled: yes -## GPD Pocket Specials - - name: "GPD fan module" - when: "'gpd' in ansible_hostname" - ansible.builtin.copy: - dest: /etc/modules-load.d/gpd-pocket-fan.conf - owner: root - group: root - mode: 0644 - content: | - gpd-pocket-fan - - - name: "GPD fan module config" - when: "'gpd' in ansible_hostname" - ansible.builtin.copy: - dest: /etc/modprobe.d/gpd-pocket-fan.conf - owner: root - group: root - mode: 0644 - content: | - options gpd-pocket-fan temp_limits=40000,40001,40002 - - name: "Set Xbacklight permissions by udev" ansible.builtin.copy: dest: /etc/udev/rules.d/90-backlight.rules diff --git a/system/arch/x_gpdpocket2.yaml b/system/arch/x_gpdpocket2.yaml new file mode 100644 index 0000000..e9e5d82 --- /dev/null +++ b/system/arch/x_gpdpocket2.yaml @@ -0,0 +1,119 @@ +- name: "Specials only for GPD Pocket 2" + hosts: localhost + connection: local + + tasks: + + - name: "Console settings (GPD Pocket 2)" + ansible.builtin.copy: + dest: /etc/vconsole.conf + owner: root + group: root + mode: 0644 + content: | + KEYMAP=us + FONT=latarcyrheb-sun32 + + - name: "Update pacman cache" + community.general.pacman: + update_cache: True + + - name: "Install packages" + ansible.builtin.package: + name: '{{ item }}' + state: present + update_cache: False + with_items: + - keyd + + - name: "Keyd config for gpdp2" + ansible.builtin.copy: + dest: /etc/keyd/defaul.conf + owner: root + group: root + mode: 0644 + content: | + [ids] + * + [main] + y = z + z = y + ` = compose + yen = ` + [alt] + a = macro(compose " a) + u = macro(compose " u) + o = macro(compose " o) + s = macro(compose s s) + [alt+shift] + a = macro(compose " A) + u = macro(compose " U) + o = macro(compose " O) + # ẞ works w/o extra definition + + + - name: "Service: Keyd" + ansible.builtin.service: + name: keyd.service + state: started + enabled: yes + + + - name: "X11: Keyboard (GPD Pocket 2)" + ansible.builtin.copy: + dest: /etc/X11/xorg.conf.d/00-keyboard.conf + src: ./lib/etc/X11/xorg.conf.d/00-keyboard.conf.gpdp2 + owner: root + group: root + mode: 0644 + + - name: "X11: Intel Graphics (GPD Pocket 2)" + ansible.builtin.copy: + dest: /etc/X11/xorg.conf.d/20-intel.conf + src: ./lib/etc/X11/xorg.conf.d/20-intel.conf.gpdp2 + owner: root + group: root + mode: 0644 + + - name: "X11: Monitor (GPD Pocket 2)" + ansible.builtin.copy: + dest: /etc/X11/xorg.conf.d/30-display.conf + src: ./lib/etc/X11/xorg.conf.d/30-display.conf.gpdp2 + owner: root + group: root + mode: 0644 + + - name: "X11: Touchscreen (GPD Pocket 2)" + ansible.builtin.copy: + dest: /etc/X11/xorg.conf.d/99-touchscreen.conf + src: ./lib/etc/X11/xorg.conf.d/99-touchscreen.conf.gpdp2 + owner: root + group: root + mode: 0644 + + - name: "X11: Xresources (GPD Pocket 2)" + ansible.builtin.copy: + dest: /etc/X11/Xresources + src: ./lib/etc/X11/Xresources.gpdp2 + owner: root + group: root + mode: 0644 + + + - name: "GPD fan module" + ansible.builtin.copy: + dest: /etc/modules-load.d/gpd-pocket-fan.conf + owner: root + group: root + mode: 0644 + content: | + gpd-pocket-fan + + - name: "GPD fan module config" + ansible.builtin.copy: + dest: /etc/modprobe.d/gpd-pocket-fan.conf + owner: root + group: root + mode: 0644 + content: | + options gpd-pocket-fan temp_limits=40000,40001,40002