Compare commits
1 Commits
2215ee589a
...
benie/gnom
| Author | SHA1 | Date | |
|---|---|---|---|
| f5fc30a924 |
@@ -1,7 +1,3 @@
|
||||
---
|
||||
- import_playbook: LinuxCLI.yaml
|
||||
- import_playbook: UnixGUI.yaml
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: kitty
|
||||
- role: xremap
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
---
|
||||
- import_playbook: UnixCLI.yaml
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: gdb
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
---
|
||||
- hosts: windows
|
||||
|
||||
vars:
|
||||
install_cad_apps: false
|
||||
|
||||
roles:
|
||||
- role: python
|
||||
- role: git
|
||||
@@ -13,7 +16,6 @@
|
||||
- role: curl
|
||||
- role: fzf
|
||||
- role: gh
|
||||
- role: glab
|
||||
- role: jq
|
||||
- role: tree
|
||||
- role: yq
|
||||
@@ -27,3 +29,8 @@
|
||||
- role: obsidian
|
||||
- role: powertoys
|
||||
- role: windows-terminal
|
||||
|
||||
- role: autodesk-fusion360
|
||||
when: install_cad_apps
|
||||
- role: prusaslicer
|
||||
when: install_cad_apps
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
---
|
||||
- include_tasks: '{{ansible_os_family}}.yaml'
|
||||
# TODO: If gnome-shell on wayland set global key binding in custom keyboard settings
|
||||
|
||||
8
roles/autodesk-fusion360/tasks/main.yaml
Normal file
8
roles/autodesk-fusion360/tasks/main.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- assert:
|
||||
that: ansible_os_family == "Windows"
|
||||
|
||||
- name: install chocolatey package
|
||||
win_chocolatey:
|
||||
name: autodesk-fusion360
|
||||
state: latest
|
||||
@@ -31,17 +31,17 @@
|
||||
- include_tasks: Windows-installer.yaml
|
||||
when: git_run_installer
|
||||
|
||||
# - name: clone config repos
|
||||
# win_git:
|
||||
# repo: '{{item.repo}}'
|
||||
# dest: '{{ansible_env.USERPROFILE}}\.config\{{item.name}}'
|
||||
# version: master
|
||||
# with_items: '{{git_config_repos}}'
|
||||
# - win_owner:
|
||||
# path: '{{ansible_env.USERPROFILE}}\.config\{{item.name}}'
|
||||
# user: Benie
|
||||
# recurse: true
|
||||
# with_items: '{{git_config_repos}}'
|
||||
- name: clone config repos
|
||||
win_git:
|
||||
repo: '{{item.repo}}'
|
||||
dest: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
|
||||
version: master
|
||||
with_items: '{{git_config_repos}}'
|
||||
- win_owner:
|
||||
path: '{{ansible_env.USERPROFILE}}/.config/{{item.name}}'
|
||||
user: Benie
|
||||
recurse: true
|
||||
with_items: '{{git_config_repos}}'
|
||||
|
||||
# - TODO: install pip packages
|
||||
# win_pip:
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
- name: install apt package
|
||||
become: true
|
||||
apt:
|
||||
name: kitty
|
||||
state: latest
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
- name: install dnf package
|
||||
become: true
|
||||
dnf:
|
||||
name: kitty
|
||||
state: latest
|
||||
@@ -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
|
||||
@@ -8,17 +8,20 @@
|
||||
- set_fact:
|
||||
vim_config_dir: '{{ansible_env.LOCALAPPDATA}}\nvim'
|
||||
|
||||
# - name: clone config repo
|
||||
# win_git:
|
||||
# repo: git@code.infektor.net:config/vim.git
|
||||
# dest: '{{vim_config_dir}}'
|
||||
# branch: master
|
||||
# # clone: false
|
||||
# update: true
|
||||
# - win_owner:
|
||||
# path: '{{vim_config_dir}}'
|
||||
# user: Benie
|
||||
# recurse: true
|
||||
- name: clone config repo
|
||||
win_git:
|
||||
repo: git@code.infektor.net:config/vim.git
|
||||
dest: '{{vim_config_dir}}'
|
||||
branch: master
|
||||
# clone: false
|
||||
update: true
|
||||
- win_owner:
|
||||
path: '{{vim_config_dir}}'
|
||||
user: Benie
|
||||
recurse: true
|
||||
|
||||
- assert:
|
||||
that: False
|
||||
|
||||
# - TODO: neovim set repo email
|
||||
# win_git_config:
|
||||
|
||||
14
roles/prusaslicer/tasks/main.yaml
Normal file
14
roles/prusaslicer/tasks/main.yaml
Normal 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'
|
||||
4
roles/ulauncher/tasks/main.yaml
Normal file
4
roles/ulauncher/tasks/main.yaml
Normal 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
|
||||
@@ -40,18 +40,15 @@
|
||||
dest: external/ansible-win_git
|
||||
version: master
|
||||
|
||||
- set_fact:
|
||||
modules_dir: ~/.config/local/modules
|
||||
|
||||
- name: create ansible modules directory
|
||||
file:
|
||||
dest: '{{modules_dir}}'
|
||||
dest: ~/.ansible/plugins/modules
|
||||
state: directory
|
||||
|
||||
- name: copy win_git files to ansible modules directory
|
||||
copy:
|
||||
src: '~/.config/local/external/ansible-win_git/{{item}}'
|
||||
dest: '{{modules_dir}}/{{item}}'
|
||||
dest: '~/.config/local/modules/{{item}}'
|
||||
with_items:
|
||||
- win_git.ps1
|
||||
- win_git.py
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
- name: restart xremap
|
||||
systemd:
|
||||
name: xremap
|
||||
scope: user
|
||||
daemon_reload: true
|
||||
state: restarted
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user