21 Commits

Author SHA1 Message Date
c4ac91f163 Set EDITOR in .bashrc 2023-10-28 23:16:18 +01:00
9017be5cf7 Add cider role for Linux and Windows
Cider is a cross-platform Apple Music client. Don't bother installing
Cider on macOS since there is the first party Music app.
2023-10-24 00:07:19 +01:00
b4685b9d1e Create shortcut for Ferdium on Windows 2023-10-21 17:44:40 +01:00
e5cc78f6f4 Add url command to zsh symlinks 2023-10-19 18:06:04 +01:00
9df05dc567 Add macos role for macOS tweaks 2023-10-10 21:36:18 +01:00
37d89c475e Add hiddenbar role for macOS 2023-10-10 21:12:05 +01:00
fa0cf04d8f Fix kitty role on macOS 2023-10-10 21:11:50 +01:00
0d1993ef53 Fix win_git module for hidden folders 2023-10-06 10:51:28 +01:00
9fef9403b3 Fix pynvim on macOS by installing dependency 2023-10-01 23:42:44 +01:00
253cf462b3 Add macOS support to kitty role 2023-10-01 23:42:34 +01:00
54b3c4edfe Flatpak system installs require root 2023-09-25 11:20:52 +01:00
4489c05014 Replace yum with dnf where possible 2023-08-28 22:19:44 +01:00
520462a3f4 Add unsafe tags to zsh and tmux
When used in combination with the `--skip-tags unsafe` flag the
`playbooks/UnixCLI.yaml` can be run while inside a `zsh`/`tmux` session
without it locking up due to system files going missing due to the
upgrade.
2023-08-25 12:29:18 +01:00
aeba9ba7f2 Fix obsidian role when already using flatpak 2023-08-20 21:08:36 +01:00
669dffc2c5 Add ~/.local/bin to PATH in .bashrc 2023-08-18 10:54:30 +01:00
399300c162 Switch to obsidian from flathub 2023-08-17 23:45:34 +01:00
3a4224d200 Fix Fedora/RedHat config 2023-08-17 23:31:59 +01:00
afa680c4d1 Enable xremap on Debian/Ubuntu 2023-08-17 23:24:03 +01:00
cba3f6ce2a Name the chocolatey ferdium task 2023-08-01 21:06:51 +01:00
d37b675187 Override Ubuntu codename for neovim ppa 2023-08-01 20:57:10 +01:00
3364d770e1 Add flatpak role for Debian 2023-08-01 20:56:50 +01:00
30 changed files with 148 additions and 88 deletions

View File

@@ -223,7 +223,7 @@ if ($recursive) {
# Ensure the repository has the correct owner # Ensure the repository has the correct owner
$userName = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name $userName = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
$idRef = [System.Security.Principal.NTAccount]::new($userName) $idRef = [System.Security.Principal.NTAccount]::new($userName)
Get-Item $dest | foreach { ` Get-Item -Force $dest | foreach { `
$_ ; $_ | Get-ChildItem -Force -Recurse ` $_ ; $_ | Get-ChildItem -Force -Recurse `
} | foreach { ` } | foreach { `
$acl = $_ | Get-Acl; $acl.SetOwner($idRef); $_ | Set-Acl -AclObject $acl ` $acl = $_ | Get-Acl; $acl.SetOwner($idRef); $_ | Set-Acl -AclObject $acl `

View File

@@ -3,6 +3,12 @@
- import_playbook: UnixGUI.yaml - import_playbook: UnixGUI.yaml
- hosts: localhost - hosts: localhost
roles: roles:
- role: cider
- role: kitty - role: kitty
- role: xremap - role: xremap
when: ansible_os_family == "RedHat" when: >
'GNOME' in ansible_env.XDG_CURRENT_DESKTOP and
ansible_env.XDG_SESSION_TYPE == 'wayland' and (
ansible_os_family == "RedHat" or
ansible_os_family == "Debian"
)

View File

@@ -6,8 +6,10 @@
- role: python - role: python
- role: zsh - role: zsh
tags: unsafe
- role: neovim - role: neovim
- role: tmux - role: tmux
tags: unsafe
- role: ag - role: ag
- role: bash - role: bash

View File

@@ -1,6 +1,9 @@
--- ---
- hosts: localhost - hosts: localhost
roles: roles:
- role: flatpak
when: ansible_os_family != "Darwin"
- role: 1password - role: 1password
- role: ferdium - role: ferdium
- role: fonts - role: fonts

View File

@@ -23,6 +23,7 @@
- role: 1password - role: 1password
- role: autohotkey - role: autohotkey
- role: cider
- role: ferdium - role: ferdium
- role: firefox - role: firefox
- role: fonts - role: fonts

View File

@@ -8,7 +8,11 @@
roles: roles:
- role: mas - role: mas
- role: hiddenbar
- role: iterm - role: iterm
- role: kitty
- role: magnet - role: magnet
- role: microsoft-remote-desktop - role: microsoft-remote-desktop
- role: viscosity - role: viscosity
- role: macos

View File

@@ -1,10 +1,10 @@
--- ---
- name: add yum repository key - name: add dnf repository key
become: true become: true
rpm_key: rpm_key:
key: https://downloads.1password.com/linux/keys/1password.asc key: https://downloads.1password.com/linux/keys/1password.asc
- name: add yum repository - name: add dnf repository
become: true become: true
yum_repository: yum_repository:
name: 1password name: 1password
@@ -15,8 +15,8 @@
repo_gpgcheck: true repo_gpgcheck: true
gpgkey: ['https://downloads.1password.com/linux/keys/1password.asc'] gpgkey: ['https://downloads.1password.com/linux/keys/1password.asc']
- name: install yum package - name: install dnf package
become: true become: true
yum: dnf:
name: 1password name: 1password
state: latest state: latest

View File

@@ -1,6 +1,6 @@
--- ---
- name: install yum package - name: install dnf package
become: true become: true
yum: dnf:
name: the_silver_searcher name: the_silver_searcher
state: latest state: latest

View File

@@ -110,3 +110,13 @@ grey="\001\e[38;5;244m\002"
reset="\001\e[0m\002" reset="\001\e[0m\002"
PS1="$yellow\u$reset@$grey\h$reset " PS1="$yellow\u$reset@$grey\h$reset "
# Setup environment variables
export PATH=$HOME/.local/bin:$PATH
if command -v nvim > /dev/null; then
export EDITOR=nvim
elif command -v vim > /dev/null; then
export EDITOR=vim
elif command -v vi > /dev/null; then
export EDITOR=vi
fi

View File

@@ -1,6 +1,6 @@
--- ---
- name: install yum package - name: install dnf package
become: true become: true
yum: dnf:
name: bat name: bat
state: latest state: latest

View File

@@ -0,0 +1,13 @@
---
- name: install chocolatey package
when: ansible_os_family == 'Windows'
win_chocolatey:
state: latest
name: Cider
- name: install flatpak package
when: ansible_os_family != 'Windows' and
ansible_os_family != 'Darwin'
become: true
flatpak:
name: sh.cider.Cider

View File

@@ -1,6 +1,6 @@
--- ---
- name: install yum package - name: install dnf package
become: true become: true
yum: dnf:
name: curl name: curl
state: latest state: latest

View File

@@ -0,0 +1,14 @@
---
- name: install chocolatey package
win_chocolatey:
name: ferdium
state: latest
- set_fact:
ferdium_exe: 'C:/Program Files/Ferdium/Ferdium.exe'
- name: create start menu shortcut
win_shortcut:
src: '{{ferdium_exe}}'
dest: '{{ansible_env.ProgramData}}/Microsoft/Windows/Start Menu/Programs/Ferdium.lnk'
icon: '{{ferdium_exe}},0'

View File

@@ -6,12 +6,11 @@
state: latest state: latest
- when: ansible_os_family == 'Windows' - when: ansible_os_family == 'Windows'
win_chocolatey: include_tasks: Windows.yaml
name: ferdium
state: latest
- name: install flatpak package - name: install flatpak package
when: ansible_os_family != 'Windows' and when: ansible_os_family != 'Windows' and
ansible_os_family != 'Darwin' ansible_os_family != 'Darwin'
become: true
flatpak: flatpak:
name: org.ferdium.Ferdium name: org.ferdium.Ferdium

View File

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

View File

@@ -1,6 +1,6 @@
--- ---
- name: install yum package - name: install dnf package
become: true become: true
yum: dnf:
name: fzf name: fzf
state: latest state: latest

View File

@@ -1,5 +1,5 @@
--- ---
- name: add yum repository - name: add dnf repository
become: true become: true
get_url: get_url:
url: https://cli.github.com/packages/rpm/gh-cli.repo url: https://cli.github.com/packages/rpm/gh-cli.repo

View File

@@ -0,0 +1,8 @@
---
- assert:
that: ansible_os_family == 'Darwin'
- name: install homebrew package
homebrew_cask:
name: hiddenbar
state: latest

View File

@@ -0,0 +1,5 @@
---
- name: install homebrew package
homebrew_cask:
name: kitty
state: latest

View File

@@ -0,0 +1,9 @@
---
- assert:
that: ansible_os_family == 'Darwin'
- name: disable creation of .DS_Store in directories
osx_defaults:
domain: com.apple.desktopservices
key: DSDontWriteNetworkStores
value: 'true'

View File

@@ -6,6 +6,12 @@
state: latest state: latest
- set_fact: - set_fact:
neovim_pip_packages: '{{neovim_pip_packages + ["pynvim"]}}' neovim_pip_packages: >
{{
neovim_pip_packages + [
"pynvim",
"greenlet"
]
}}
- include_tasks: Unix.yaml - include_tasks: Unix.yaml

View File

@@ -12,6 +12,7 @@
become: true become: true
apt_repository: apt_repository:
repo: ppa:neovim-ppa/stable repo: ppa:neovim-ppa/stable
codename: '{{os_release.UBUNTU_CODENAME}}'
update_cache: true update_cache: true
- name: install apt package - name: install apt package

View File

@@ -1,6 +1,6 @@
--- ---
- name: install yum package - name: install dnf package
become: true become: true
yum: dnf:
name: nodejs name: nodejs
state: latest state: latest

View File

@@ -1,75 +1,32 @@
--- ---
# TODO: Prefer Flatpak over AppImage if available - name: install flatpak package
become: true
flatpak:
name: md.obsidian.Obsidian
- name: stat symlink # Remove old appimage if it exists
- name: stat appimage symlink
stat: stat:
path: '{{ansible_env.HOME}}/.local/bin/Obsidian' path: '{{ansible_env.HOME}}/.local/bin/Obsidian'
register: symlink_file register: symlink_file
- name: get latest release
uri:
url: https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest
register: latest
- set_fact: - set_fact:
appimage: 'Obsidian-{{latest.json.name}}.AppImage'
- set_fact:
filepath: '{{ansible_env.HOME}}/.local/bin/{{appimage}}'
iconpath: 'share/icons/hicolor/512x512/apps/obsidian.png' iconpath: 'share/icons/hicolor/512x512/apps/obsidian.png'
asset_query: '[?contains(name, `{{appimage}}`)] | [0]' - name: remove appimage icon file
- 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 directories
file: file:
path: '{{item}}'
state: directory
with_items:
- '{{ansible_env.HOME}}/.local/bin'
- '{{ansible_env.HOME}}/.local/share/icons/hicolor/512x512/apps'
- name: create symlink
file:
src: '{{filepath}}'
dest: '{{ansible_env.HOME}}/.local/bin/Obsidian'
state: link
- name: extract squashfs-root for app icon
when: needs_installed
command:
cmd: '{{ansible_env.HOME}}/.local/bin/Obsidian --appimage-extract'
chdir: '/tmp'
- name: copy icon file
when: needs_installed
copy:
src: '/tmp/squashfs-root/usr/{{iconpath}}'
dest: '{{ansible_env.HOME}}/.local/{{iconpath}}' dest: '{{ansible_env.HOME}}/.local/{{iconpath}}'
- name: remove squashfs-root directory
when: needs_installed
file:
path: '/tmp/squashfs-root'
state: absent state: absent
- name: remove appimage desktop file
- name: create desktop file file:
template:
src: obsidian.desktop.j2
dest: '{{ansible_env.HOME}}/.local/share/applications/obsidian-obsidian.desktop' dest: '{{ansible_env.HOME}}/.local/share/applications/obsidian-obsidian.desktop'
notify: install desktop menu state: absent
- name: remove old appimage - name: remove old appimage
when: needs_installed and symlink_file.stat.exists when: "'lnk_source' in symlink_file.stat"
file: file:
path: '{{symlink_file.stat.lnk_source}}' path: '{{symlink_file.stat.lnk_source}}'
state: absent state: absent
- name: remove appimage symlink
file:
path: '{{ansible_env.HOME}}/.local/bin/Obsidian'
state: absent
- include_tasks: Unix.yaml - include_tasks: Unix.yaml

View File

@@ -1,7 +1,7 @@
--- ---
- name: install yum packages - name: install dnf packages
become: true become: true
yum: dnf:
name: name:
- python3 - python3
- python3-pip - python3-pip

View File

@@ -1,7 +1,7 @@
--- ---
- name: install yum packages - name: install dnf packages
become: true become: true
yum: dnf:
name: name:
- tmux - tmux
- sysstat - sysstat

View File

@@ -1,7 +1,8 @@
--- ---
- assert: - assert:
that: ansible_env.XDG_CURRENT_DESKTOP == "GNOME" and that: >
ansible_env.XDG_SESSION_TYPE == "wayland" 'GNOME' in ansible_env.XDG_CURRENT_DESKTOP and
ansible_env.XDG_SESSION_TYPE == 'wayland'
- set_fact: - set_fact:
install_dir: '{{ansible_env.HOME}}/.local/bin' install_dir: '{{ansible_env.HOME}}/.local/bin'
@@ -35,12 +36,14 @@
set_fact: set_fact:
needs_installed: needs_installed:
'{{not executable.stat.exists or installed_version != latest.json.name}}' '{{not executable.stat.exists or installed_version != latest.json.name}}'
xdg_current_desktop:
"{{ansible_env.XDG_CURRENT_DESKTOP | regex_replace('(.*:)?(.*)', '\\2')}}"
- name: construct asset query - name: construct asset query
set_fact: set_fact:
asset_query: > asset_query: >
[?contains(name, `xremap-linux-{{ansible_architecture}}-{{ [?contains(name, `xremap-linux-{{ansible_architecture}}-{{
ansible_env.XDG_CURRENT_DESKTOP | lower}}.zip`)] | [0] xdg_current_desktop | lower}}.zip`)] | [0]
- name: get release asset - name: get release asset
set_fact: set_fact:
asset: '{{latest.json.assets | to_json | from_json | json_query(asset_query)}}' asset: '{{latest.json.assets | to_json | from_json | json_query(asset_query)}}'
@@ -81,6 +84,14 @@
append: true append: true
groups: input groups: input
- name: load the uinput kernel module
when: ansible_os_family == 'Debian'
become: true
copy:
content: |
uinput
dest: /etc/modules-load.d/uinput.conf
# TODO: This works for on Fedora, author uses it on Ubuntu so I assume Debian # 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 # will work too. Arch and other distros are potentially different see the docs
# https://github.com/k0kubun/xremap # https://github.com/k0kubun/xremap

View File

@@ -1,7 +1,7 @@
--- ---
- name: install yum packages - name: install dnf packages
become: true become: true
yum: dnf:
name: name:
- zsh - zsh
- pinentry-tty - pinentry-tty

View File

@@ -61,6 +61,11 @@
dest: ~/.local/bin/cmake-uninstall dest: ~/.local/bin/cmake-uninstall
- src: ~/.config/zsh/$ - src: ~/.config/zsh/$
dest: ~/.local/bin/$ dest: ~/.local/bin/$
- src: ~/.config/zsh/url/url
dest: ~/.local/bin/url
- src: ~/.config/zsh/url/_url
dest: ~/.local/share/zsh/site-functions/_url
loop_control: loop_control:
label: '{{item.dest}}' label: '{{item.dest}}'