1 Commits

Author SHA1 Message Date
f5fc30a924 temp! 2023-06-06 19:29:35 +01:00
17 changed files with 62 additions and 1386 deletions

1194
git.py

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,3 @@
--- ---
- import_playbook: LinuxCLI.yaml - import_playbook: LinuxCLI.yaml
- import_playbook: UnixGUI.yaml - import_playbook: UnixGUI.yaml
- hosts: localhost
roles:
- role: kitty
- role: xremap

View File

@@ -1,5 +1,4 @@
--- ---
- import_playbook: UnixCLI.yaml
- hosts: localhost - hosts: localhost
roles: roles:
- role: gdb - role: gdb

View File

@@ -1,6 +1,9 @@
--- ---
- hosts: windows - hosts: windows
vars:
install_cad_apps: false
roles: roles:
- role: python - role: python
- role: git - role: git
@@ -13,7 +16,6 @@
- role: curl - role: curl
- role: fzf - role: fzf
- role: gh - role: gh
- role: glab
- role: jq - role: jq
- role: tree - role: tree
- role: yq - role: yq
@@ -27,3 +29,8 @@
- role: obsidian - role: obsidian
- role: powertoys - role: powertoys
- role: windows-terminal - role: windows-terminal
- role: autodesk-fusion360
when: install_cad_apps
- role: prusaslicer
when: install_cad_apps

View File

@@ -1,2 +1,3 @@
--- ---
- include_tasks: '{{ansible_os_family}}.yaml' - include_tasks: '{{ansible_os_family}}.yaml'
# TODO: If gnome-shell on wayland set global key binding in custom keyboard settings

View File

@@ -0,0 +1,8 @@
---
- assert:
that: ansible_os_family == "Windows"
- name: install chocolatey package
win_chocolatey:
name: autodesk-fusion360
state: latest

View File

@@ -31,17 +31,17 @@
- include_tasks: Windows-installer.yaml - include_tasks: Windows-installer.yaml
when: git_run_installer when: git_run_installer
# - name: clone config repos - name: clone config repos
# win_git: win_git:
# repo: '{{item.repo}}' repo: '{{item.repo}}'
# dest: '{{ansible_env.USERPROFILE}}\.config\{{item.name}}' dest: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
# version: master version: master
# with_items: '{{git_config_repos}}' with_items: '{{git_config_repos}}'
# - win_owner: - win_owner:
# path: '{{ansible_env.USERPROFILE}}\.config\{{item.name}}' path: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
# user: Benie user: Benie
# recurse: true recurse: true
# with_items: '{{git_config_repos}}' with_items: '{{git_config_repos}}'
# - TODO: install pip packages # - TODO: install pip packages
# win_pip: # win_pip:

View File

@@ -1,6 +0,0 @@
---
- name: install apt package
become: true
apt:
name: kitty
state: latest

View File

@@ -1,6 +0,0 @@
---
- name: install dnf package
become: true
dnf:
name: kitty
state: latest

View File

@@ -1,7 +0,0 @@
---
- include_tasks: '{{ansible_os_family}}.yaml'
- name: clone config repo
git:
repo: git@code.infektor.net:config/kitty.git
dest: ~/.config/kitty

View File

@@ -8,17 +8,20 @@
- set_fact: - set_fact:
vim_config_dir: '{{ansible_env.LOCALAPPDATA}}\nvim' vim_config_dir: '{{ansible_env.LOCALAPPDATA}}\nvim'
# - name: clone config repo - name: clone config repo
# win_git: win_git:
# repo: git@code.infektor.net:config/vim.git repo: git@code.infektor.net:config/vim.git
# dest: '{{vim_config_dir}}' dest: '{{vim_config_dir}}'
# branch: master branch: master
# # clone: false # clone: false
# update: true update: true
# - win_owner: - win_owner:
# path: '{{vim_config_dir}}' path: '{{vim_config_dir}}'
# user: Benie user: Benie
# recurse: true recurse: true
- assert:
that: False
# - TODO: neovim set repo email # - TODO: neovim set repo email
# win_git_config: # win_git_config:

View File

@@ -0,0 +1,14 @@
---
- assert:
that: ansible_os_family == "Windows"
- name: install chocolatey package
win_chocolatey:
name: prusaslicer
state: latest
- name: create start menu shortcut
win_shortcut:
src: '{{ansible_env.ProgramData}}/chocolatey/bin/prusa-slicer.exe'
dest: '{{ansible_env.ProgramData}}/Microsoft/Windows/Start Menu/Programs/PrusaSlicer.lnk'
icon: '{{ansible_env.ProgramData}}/chocolatey/bin/prusa-slicer.exe,0'

View File

@@ -0,0 +1,4 @@
---
# TODO: Install ulauncher - or find a better alternative
# TODO: If gnome-shell on wayland set global key binding in custom keyboard settings
# TODO: Clone https://github.com/shepda/ulauncher-adwaita-darkish into ~/.config/ulauncher/user-themes

View File

@@ -40,18 +40,15 @@
dest: external/ansible-win_git dest: external/ansible-win_git
version: master version: master
- set_fact:
modules_dir: ~/.config/local/modules
- name: create ansible modules directory - name: create ansible modules directory
file: file:
dest: '{{modules_dir}}' dest: ~/.ansible/plugins/modules
state: directory state: directory
- name: copy win_git files to ansible modules directory - name: copy win_git files to ansible modules directory
copy: copy:
src: '~/.config/local/external/ansible-win_git/{{item}}' src: '~/.config/local/external/ansible-win_git/{{item}}'
dest: '{{modules_dir}}/{{item}}' dest: '~/.config/local/modules/{{item}}'
with_items: with_items:
- win_git.ps1 - win_git.ps1
- win_git.py - win_git.py

View File

@@ -1,7 +0,0 @@
---
- name: restart xremap
systemd:
name: xremap
scope: user
daemon_reload: true
state: restarted

View File

@@ -1,123 +0,0 @@
---
- assert:
that: ansible_env.XDG_CURRENT_DESKTOP == "GNOME" and
ansible_env.XDG_SESSION_TYPE == "wayland"
- set_fact:
install_dir: '{{ansible_env.HOME}}/.local/bin'
config_dir: '{{ansible_env.HOME}}/.config/xremap'
- set_fact:
executable_path: '{{install_dir}}/xremap'
- name: stat executable
stat:
path: '{{executable_path}}'
register: executable
- name: get installed version
when: executable.stat.exists
command: '{{executable_path}} --version'
register: version_command
changed_when: false
- name: extract version from command output
when: executable.stat.exists
set_fact:
installed_version:
'v{{version_command.stdout.strip() | regex_replace("^.*(\d+\.\d+\.\d+).*$", "\1")}}'
- name: get latest release
uri:
url: https://api.github.com/repos/k0kubun/xremap/releases/latest
register: latest
- name: determine if install needed
set_fact:
needs_installed:
'{{not executable.stat.exists or installed_version != latest.json.name}}'
- name: construct asset query
set_fact:
asset_query: >
[?contains(name, `xremap-linux-{{ansible_architecture}}-{{
ansible_env.XDG_CURRENT_DESKTOP | lower}}.zip`)] | [0]
- name: get release asset
set_fact:
asset: '{{latest.json.assets | to_json | from_json | json_query(asset_query)}}'
- name: create directories
file:
path: '{{item}}'
state: directory
with_items:
- '{{install_dir}}'
- '{{config_dir}}'
- name: download release archive
when: needs_installed
become: true
get_url:
url: '{{asset.browser_download_url}}'
dest: '{{install_dir}}/xremap.zip'
- name: extract release archive
when: needs_installed
become: true
unarchive:
src: '{{install_dir}}/xremap.zip'
dest: '{{install_dir}}'
- name: remove release archive
when: needs_installed
become: true
file:
path: '{{install_dir}}/xremap.zip'
state: absent
- name: add user to input group
become: true
user:
name: '{{ansible_user_id}}'
append: true
groups: input
# TODO: This works for on Fedora, author uses it on Ubuntu so I assume Debian
# will work too. Arch and other distros are potentially different see the docs
# https://github.com/k0kubun/xremap
- name: add udev rule for input access
become: true
copy:
content: |
KERNEL=="uinput", GROUP="input", TAG+="uaccess"
dest: /etc/udev/rules.d/input.rules
- name: clone config repo
git:
repo: git@code.infektor.net:config/xremap.git
dest: '{{config_dir}}'
notify: restart xremap
- name: install xremap systemd unit
template:
src: xremap.service.j2
dest: ~/.config/systemd/user/xremap.service
notify: restart xremap
- name: enable xremap service
systemd:
name: xremap
scope: user
enabled: true
state: started
- name: check if extension is installed
command: gnome-extensions show xremap@k0kubun.com
changed_when: false
failed_when: false
register: extension
- when: extension.rc != 0
debug:
msg: 'install gnome extension then reboot:
https://extensions.gnome.org/extension/5060/xremap'
changed_when: true

View File

@@ -1,10 +0,0 @@
[Unit]
Description=macOS Key Remapping
[Service]
Type=simple
ExecStart={{executable_path}} {{config_dir}}/macOS.yaml
Restart=on-failure
[Install]
WantedBy=default.target