Stop hardcoding main terminal emulator

- Group 'foot' and 'alacrity' into 1 task, with precedence configurable
- scripts/urlify: back to tinyurl since 0x0.st blocks url shortening
  service now
This commit is contained in:
Hoang Nguyen 2022-01-26 21:42:10 +07:00
parent f0deb712be
commit 8553b1ea91
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
12 changed files with 34 additions and 17 deletions

View File

@ -28,6 +28,7 @@ $ ansible-playbook -v -i hosts dotfiles.yml --tags 'never,all'
## 🖊️ TODO
- [ ] ~~[wayout](https://git.sr.ht/~proycon/wayout)~~
- [ ] [fuzzel](https://codeberg.org/dnkl/fuzzel)
- [ ] Theme bootstraping
- [ ] Use Wireplumber lua API for 'volumncontrol' script instead of [pulsemixer](https://github.com/GeorgeFilipkin/pulsemixer)
- [ ] Neovim: vim.api.nvim{_buf}_set_keymap -> vim.keymap.set (wait for 0.7.0 release)

View File

@ -23,6 +23,11 @@
msg: Variable 'notification' needs to be 'dunst' or 'mako'
when: notification != 'dunst' and notification != 'mako'
- name: Check the number of terminal emulators
fail:
msg: Need at least 2 terminal emulators
when: ( terminal | length() ) < 2
- name: Check current user
fail:
msg: This playbook should not be run as 'root'
@ -40,11 +45,21 @@
hosts: all
vars_files:
- 'palette/{{ theme }}.yml'
tasks:
# 'always' tag is needed to run the playbook with custom tags passed to
# the included roles
- name: Terminal emulators
include_role:
name: '{{ item }}'
apply:
tags:
- '{{ item }}'
- terminal
tags: always
loop: '{{ terminal }}'
roles:
- role: scripts
tags: scripts
- role: alacritty
tags: alacritty
- role: amfora
tags: amfora
- role: anime-downloader
@ -67,8 +82,6 @@
tags: fish
- role: fontconfig
tags: [ never, fontconfig ]
- role: foot
tags: foot
- role: gallery-dl
tags: gallery-dl
- role: git

View File

@ -11,6 +11,10 @@ clipboard: clipman
notification: dunst
# Use 'dropbear-dbclient' if True, otherwise use 'openssh-client'
dropbear_ssh_client: False
# List of terminal emulators, in precedence order
terminal:
- foot
- alacritty
# Font ────────────────────────────────────────────────────────────────────────
cjk_font: Sarasa Mono J
@ -23,3 +27,6 @@ gtk_theme: Nordic
icon_theme: Papirus-Dark
cursor_theme: Bibata-Modern-Ice
cursor_size: 24
# Additional colors that look nice ────────────────────────────────────────────
violet: '#8c9cff'

View File

@ -1,6 +1,4 @@
---
violet: '#8c9cff'
# Colors for theming
foreground: '#d8dee9'
background: '#2e3440'

View File

@ -1,6 +1,4 @@
---
violet: '#8c9cff'
# Colors for theming
foreground: '#abb2bf'
background: '#282c34'

View File

@ -38,7 +38,8 @@
vulkan-loader, waybar, wireplumber, wf-recorder, wlr-randr,
xdg-desktop-portal-wlr, xdg-desktop-portal-gtk, xdg-user-dirs,
xwayland, zathura, zathura-cb, zathura-ps, zoxide, openssh-doc,
zathura-pdf-mupdf, openssh-client-default, river, btop
zathura-pdf-mupdf, openssh-client-default, river, btop,
alacritty
state: present
- name: Allow pipewire realtime scheduling for @wheel group

View File

@ -169,6 +169,6 @@ c.url.searchengines = {'DEFAULT': 'https://search.disroot.org/?category_general=
# Bindings ─────────────────────────────────────────────────────────────
config.bind(',m', 'hint links spawn mpv {hint-url}')
config.bind(',y', 'hint links spawn alacritty -e yt-dlp {hint-url}')
config.bind(',y', 'hint links spawn {{ terminal[0] }} -e yt-dlp {hint-url}')
config.bind(',t', 'config-cycle tabs.show multiple never')
config.bind(',T', 'set-cmd-text -s :open -t')

View File

@ -47,8 +47,8 @@ riverctl background-color 0x{{ background | regex_replace('^#', '') }}
mod="Mod4"
# Terminals
riverctl map normal $mod Return spawn alacritty
riverctl map normal $mod+Shift Return spawn foot
riverctl map normal $mod Return spawn {{ terminal[0] }}
riverctl map normal $mod+Shift Return spawn {{ terminal[1] }}
# Launcher
riverctl map normal $mod D spawn 'wofi --show=drun'

View File

@ -3,7 +3,7 @@
if [ "$1" = "-e" ]; then
curl https://unshorten.me/s/"${2:--}"
elif [ "$1" = "-s" ]; then
curl -F"shorten=${2:--}" https://0x0.st
curl https://tinyurl.com/api-create.php?url="${2:--}"
else
echo "Wrong arguments"
return 1

View File

@ -9,8 +9,8 @@ set $up k
set $right l
# Your preferred terminal emulator
set $term alacritty
set $term_fallback foot
set $term {{ terminal[0] }}
set $term_fallback {{ terminal[1] }}
# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened

View File

@ -224,7 +224,6 @@ filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
\ qimgv %f 2>/dev/null &,
\ pqiv %f &,
\ imv %f &,
\ feh %f &
filextype *.svg
\ inkscape %f &,

View File

@ -1,7 +1,7 @@
show=drun
width=500
lines=14
term=alacritty
term={{ terminal[0] }}
allow_images=true
allow_markup=true
image_size={{ (font_size * 2) | float }}