Compare commits
4 Commits
ab96a7d8c6
...
3fee590a8f
Author | SHA1 | Date | |
---|---|---|---|
3fee590a8f | |||
0b71c22019 | |||
db0b181473 | |||
65d96b2faa |
@ -3,3 +3,6 @@
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: 1password
|
||||
- role: fonts
|
||||
- role: obsidian
|
||||
- role: webcatalog
|
||||
|
@ -2,12 +2,9 @@
|
||||
- import_playbook: UnixGUI.yaml
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: fonts
|
||||
- role: mas
|
||||
|
||||
- role: iterm
|
||||
- role: magnet
|
||||
- role: microsoft-remote-desktop
|
||||
- role: obsidian
|
||||
- role: viscosity
|
||||
- role: webcatalog
|
||||
|
@ -1,7 +1,11 @@
|
||||
---
|
||||
- name: install homebrew packages
|
||||
homebrew:
|
||||
name: neovim
|
||||
name:
|
||||
- neovim
|
||||
state: latest
|
||||
|
||||
- set_fact:
|
||||
neovim_pip_packages: '{{neovim_pip_packages + ["pynvim"]}}'
|
||||
|
||||
- include_tasks: Unix.yaml
|
||||
|
@ -10,7 +10,9 @@
|
||||
- name: install apt package
|
||||
become: true
|
||||
apt:
|
||||
name: neovim
|
||||
name:
|
||||
- neovim
|
||||
- python3-neovim
|
||||
state: latest
|
||||
|
||||
- include_tasks: Unix.yaml
|
||||
|
@ -1,8 +1,10 @@
|
||||
---
|
||||
- name: install yum package
|
||||
- name: install dnf package
|
||||
become: true
|
||||
yum:
|
||||
name: neovim
|
||||
dnf:
|
||||
name:
|
||||
- neovim
|
||||
- python3-neovim
|
||||
state: latest
|
||||
|
||||
- include_tasks: Unix.yaml
|
||||
|
@ -8,8 +8,6 @@
|
||||
dest: '{{vim_config_dir}}'
|
||||
version: master
|
||||
|
||||
# TODO: - name: set repo email
|
||||
|
||||
- name: install pip packages
|
||||
pip:
|
||||
name: '{{neovim_pip_packages}}'
|
||||
|
@ -3,6 +3,5 @@ neovim_pip_packages:
|
||||
- cmake-language-server
|
||||
- cmakelint
|
||||
- compdb
|
||||
- pynvim
|
||||
- vim-vint
|
||||
- yamllint
|
||||
|
5
roles/obsidian/handlers/main.yaml
Normal file
5
roles/obsidian/handlers/main.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install desktop menu
|
||||
command: >
|
||||
xdg-desktop-menu install --mode user
|
||||
{{ansible_env.HOME}}/.local/share/applications/obsidian-obsidian.desktop
|
@ -4,8 +4,4 @@
|
||||
name: obsidian
|
||||
state: latest
|
||||
|
||||
- name: clone notes repository
|
||||
git:
|
||||
repo: git@github.com:kbenzie/notes.git
|
||||
dest: '{{ansible_env.HOME}}/Documents/Notes'
|
||||
version: main
|
||||
- include_tasks: Unix.yaml
|
||||
|
48
roles/obsidian/tasks/RedHat.yaml
Normal file
48
roles/obsidian/tasks/RedHat.yaml
Normal file
@ -0,0 +1,48 @@
|
||||
---
|
||||
- name: stat symlink
|
||||
stat:
|
||||
path: '{{ansible_env.HOME}}/.local/bin/Obsidian'
|
||||
register: symlink_file
|
||||
|
||||
- name: get latest release
|
||||
uri:
|
||||
url: https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest
|
||||
register: latest
|
||||
|
||||
- set_fact:
|
||||
appimage: 'Obsidian-{{latest.json.name}}.AppImage'
|
||||
- set_fact:
|
||||
filepath: '{{ansible_env.HOME}}/.local/bin/{{appimage}}'
|
||||
asset_query: '[?contains(name, `{{appimage}}`)] | [0]'
|
||||
- set_fact:
|
||||
needs_installed:
|
||||
'{{not symlink_file.stat.exists or symlink_file.stat.lnk_source != filepath}}'
|
||||
asset: '{{latest.json.assets | to_json | from_json | json_query(asset_query)}}'
|
||||
|
||||
- name: download latest version
|
||||
get_url:
|
||||
url: '{{asset.browser_download_url}}'
|
||||
dest: '{{filepath}}'
|
||||
mode: '0755'
|
||||
|
||||
- name: create symlink
|
||||
file:
|
||||
src: '{{filepath}}'
|
||||
dest: '{{ansible_env.HOME}}/.local/bin/Obsidian'
|
||||
state: link
|
||||
|
||||
# TODO: icon for desktop file
|
||||
|
||||
- name: create desktop file
|
||||
template:
|
||||
src: obsidian.desktop.j2
|
||||
dest: '{{ansible_env.HOME}}/.local/share/applications/obsidian-obsidian.desktop'
|
||||
notify: install desktop menu
|
||||
|
||||
- name: remove old appimage
|
||||
when: needs_installed and symlink_file.stat.exists
|
||||
file:
|
||||
path: '{{symlink_file.stat.lnk_source}}'
|
||||
state: absent
|
||||
|
||||
- include_tasks: Unix.yaml
|
6
roles/obsidian/tasks/Unix.yaml
Normal file
6
roles/obsidian/tasks/Unix.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: clone notes repository
|
||||
git:
|
||||
repo: git@github.com:kbenzie/notes.git
|
||||
dest: '{{ansible_env.HOME}}/Documents/Notes'
|
||||
version: main
|
11
roles/obsidian/templates/obsidian.desktop.j2
Normal file
11
roles/obsidian/templates/obsidian.desktop.j2
Normal file
@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Name=Obsidian
|
||||
Exec={{ansible_env.HOME}}/.local/bin/Obsidian
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=obsidian
|
||||
StartupWMClass=Obsidian
|
||||
X-AppImage-Version={{latest.json.name}}
|
||||
Comment=Private and flexible note‑taking app that adapts to the way you think.
|
||||
MimeType=x-scheme-handler/obsidian;
|
||||
Categories=Utility;
|
5
roles/webcatalog/handlers/main.yaml
Normal file
5
roles/webcatalog/handlers/main.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install desktop menu
|
||||
command: >
|
||||
xdg-desktop-menu install --mode user
|
||||
{{ansible_env.HOME}}/.local/share/applications/webcatalog-webcatalog.desktop
|
5
roles/webcatalog/tasks/Darwin.yaml
Normal file
5
roles/webcatalog/tasks/Darwin.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: install homebrew package
|
||||
homebrew_cask:
|
||||
name: webcatalog
|
||||
state: latest
|
49
roles/webcatalog/tasks/Linux.yaml
Normal file
49
roles/webcatalog/tasks/Linux.yaml
Normal file
@ -0,0 +1,49 @@
|
||||
---
|
||||
- name: stat symlink
|
||||
stat:
|
||||
path: '{{ansible_env.HOME}}/.local/bin/WebCatalog'
|
||||
register: symlink_file
|
||||
|
||||
- name: get releases
|
||||
uri:
|
||||
url: https://raw.githubusercontent.com/kbenzie/webcatalog-release-scraper/main/webcatalog-releases.json
|
||||
return_content: true
|
||||
register: releases_raw
|
||||
|
||||
- set_fact:
|
||||
releases: '{{releases_raw.content | from_json}}'
|
||||
- set_fact:
|
||||
appimage: 'WebCatalog-{{releases[0].version}}.AppImage'
|
||||
- set_fact:
|
||||
filepath: '{{ansible_env.HOME}}/.local/bin/{{appimage}}'
|
||||
|
||||
- set_fact:
|
||||
needs_installed:
|
||||
'{{not symlink_file.stat.exists or symlink_file.stat.lnk_source != filepath}}'
|
||||
|
||||
- name: download latest version
|
||||
when: needs_installed
|
||||
get_url:
|
||||
url: 'https://cdn-2.webcatalog.io/webcatalog/{{appimage}}'
|
||||
dest: '{{ansible_env.HOME}}/.local/bin/{{appimage}}'
|
||||
mode: '0755'
|
||||
|
||||
- name: create symlink
|
||||
file:
|
||||
src: '{{filepath}}'
|
||||
dest: '{{ansible_env.HOME}}/.local/bin/WebCatalog'
|
||||
state: link
|
||||
|
||||
# TODO: icon for desktop file
|
||||
|
||||
- name: create desktop file
|
||||
template:
|
||||
src: webcatalog.desktop.j2
|
||||
dest: '{{ansible_env.HOME}}/.local/share/applications/webcatalog-webcatalog.desktop'
|
||||
notify: install desktop menu
|
||||
|
||||
- name: remove old appimage
|
||||
when: needs_installed and symlink_file.stat.exists
|
||||
file:
|
||||
path: '{{symlink_file.stat.lnk_source}}'
|
||||
state: absent
|
@ -1,8 +1,7 @@
|
||||
---
|
||||
- assert:
|
||||
that: ansible_os_family == "Darwin"
|
||||
|
||||
- name: install homebrew package
|
||||
homebrew_cask:
|
||||
name: webcatalog
|
||||
state: latest
|
||||
- when: ansible_os_family == 'Darwin'
|
||||
include_tasks: 'Darwin.yaml'
|
||||
- when: ansible_os_family == 'Windows'
|
||||
include_tasks: 'Windows.yaml'
|
||||
- when: ansible_os_family != 'Darwin' and ansible_os_family != 'Windows'
|
||||
include_tasks: 'Linux.yaml'
|
||||
|
11
roles/webcatalog/templates/webcatalog.desktop.j2
Normal file
11
roles/webcatalog/templates/webcatalog.desktop.j2
Normal file
@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Name=WebCatalog
|
||||
Exec={{ansible_env.HOME}}/.local/bin/WebCatalog
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=webcatalog
|
||||
StartupWMClass=WebCatalog
|
||||
X-AppImage-Version={{releases[0].version}}
|
||||
Comment=Turn Any Websites Into Real Desktop Apps
|
||||
MimeType=x-scheme-handler/webcatalog;
|
||||
Categories=Utility;
|
Loading…
x
Reference in New Issue
Block a user