Skip to content

Commit

Permalink
PR for 1.1.6 (#58)
Browse files Browse the repository at this point in the history
* Stick to AGSv1.

We have to do this as an interim until we port the current AGS config
to v2.

* Various improvements for PiP windows

- Improve the way PiP windows are detected
  - This one aims to make it work on Google Chrome and Chromium forks
- Make PiP windows opaque
- Remove WM borders from PiP windows

* New package: `batsignal`

Also preconfigured for a sane configuration on just about any laptop.

* Fix some keybind symbols in the keybind guide

* Fix the way local rebuilds are handled

* Update Hyprland configs to work with AGSv1

* Fix the way AGS version is treated during checks

* Change battery percentages for warnings and hibernation/shutdown

* Update greetd config to work with AGSv1

* fixup! Update Hyprland configs to work with AGSv1

* Fix the fullscreen keybind to include Shift

* Fix the way batsignal drop-in is generated

I'm seriously having some brain damage at this point.

* fixup! Fix the fullscreen keybind to include Shift

---------

Co-authored-by: Bahar Kurt <kurtbahartr@users.noreply.github.com>
  • Loading branch information
kurtbahartr and kurtbahartr authored Nov 15, 2024
1 parent 55d5ed3 commit 18a87d4
Show file tree
Hide file tree
Showing 15 changed files with 219 additions and 15 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
Version 1.1.6
https://github.com/dianaw353/dotfiles/releases/tag/V1.1.6
---------------------------------------------------------
**Changes**
- New package: `batsignal`
- Also preconfigured for a sane configuration on just about any laptop.

**Fixes**
- Fix how local rebuilds independent from AUR are handled.
- Fix the way AGS versions are treated during version check.
- Stick to AGSv1.
- We have to do this as an interim until we port the current AGS config to v2.
- Various improvements for PiP windows
- Improve the way PiP windows are detected
- This one aims to make it work on Google Chrome and Chromium forks
- Make PiP windows opaque
- Remove WM borders from PiP windows
- Fix some keybind symbols in the keybind guide.
- Fix the fullscreen keybind to involve Shift

Version 1.1.5
https://github.com/dianaw353/dotfiles/releases/tag/V1.1.5
---------------------------------------------------------
Expand Down
10 changes: 10 additions & 0 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ system:
list:
- https://github.com/virtcode/hypr-dynamic-cursors # dynamic-cursors

ags:
# Whether to use AGSv1.
#
# Don't set this to false if you can't deal with rewriting the entire stack for v2!
#
# See Aylur/ags#618 for more info.
#
# true or false
need_v1: true

i18n:
# Supplementary fonts
fonts:
Expand Down
1 change: 1 addition & 0 deletions pre_tasks/system/tasks/Archlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- qt5-wayland
- gtk4
- libadwaita
- batsignal

- name: Install dex For XDG Autostart Support | {{ ansible_distribution }}
community.general.pacman:
Expand Down
13 changes: 13 additions & 0 deletions pre_tasks/system/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
when: "system.enable_bluetooth and system.enable_bluetooth_autoconnect and system.audio_server == 'pulseaudio'"
scope: user
become: false
- name: batsignal
scope: user
become: false

- name: Start pipewire services
ansible.builtin.systemd:
Expand All @@ -44,6 +47,13 @@
- pipewire-pulse
- wireplumber

- name: Create a drop-in for batsignal
ansible.builtin.shell:
cmd: |
mkdir -p {{ ansible_user_dir }}/.config/systemd/user/batsignal.service.d
printf '[Service]\nExecStart=\nExecStart=batsignal -d 5 -c 10 -w 20 -D "systemctl hibernate"' > {{ ansible_user_dir }}/.config/systemd/user/batsignal.service.d/options.conf
become: false

- name: Restart Systemd Services
ansible.builtin.systemd:
state: restarted
Expand All @@ -60,6 +70,9 @@
when: "system.enable_bluetooth and system.enable_bluetooth_autoconnect and system.audio_server == 'pulseaudio'"
scope: user
become: false
- name: batsignal
scope: user
become: false

- name: Fixes
block:
Expand Down
7 changes: 6 additions & 1 deletion roles/ags/files/ags/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ try {
throw `"${bundler}" is not a valid bundler`
}

if (v.ags[1] < v.expect[1] || v.ags[2] < v.expect[2]) {
if (v.ags[0] < v.expect[0] && v.ags[1] < v.expect[1] && v.ags[2] < v.expect[2]) {
print(`my config needs at least v${v.expect.join(".")}, yours is v${v.ags.join(".")}`)
App.quit()
}

if (v.ags[0] > v.expect[0]) {
print(`my config doesn't work on ags versions higher than v${v.expect[0]}, yours is v${v.ags[0]}`)
App.quit()
}

await import(`file://${main}`)
} catch (error) {
console.error(error)
Expand Down
2 changes: 1 addition & 1 deletion roles/ags/files/ags/widget/keybinds/Header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default Widget.Box(
css: 'font-size: 3em; margin-right: 0.25em;',
}),
Widget.Label({
label: '⌘ + Slash',
label: '⌘ + /',
css: 'font-size: 2em;',
className: 'cheatsheet-key',
}),
Expand Down
4 changes: 2 additions & 2 deletions roles/ags/files/ags/widget/keybinds/data/shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const column1 = [
icon: '',
name: 'Windows: Type',
binds: [
{ keys: ['⌘', '󰘶', '+', 'F'], action: 'Fullscreen' },
{ keys: ['⌘', '+', '󰘶', '+', 'F'], action: 'Fullscreen' },
{ keys: ['⌘', '+', '<direction>'], action: 'Focus window' },
{ keys: ['⌘', '+', 'T'], action: 'Toggle Fake Floating' },
{ keys: ['⌘', '+', 'J'], action: 'Flip Window position' },
Expand Down Expand Up @@ -50,7 +50,7 @@ const column2 = [
name: 'Screen Utilities',
binds: [
{ keys: ['PrtScr'], action: 'Selective Screenshot' },
{ keys: ['󰘴', '+', 'PrtScr'], action: 'Screenshot Full screen' },
{ keys: ['󰘶', '+', 'PrtScr'], action: 'Screenshot Full screen' },
{ keys: ['⌘', '+', '󱊶'], action: 'Selective Record' },
],
appeartick: 2
Expand Down
48 changes: 46 additions & 2 deletions roles/ags/tasks/Archlinux.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
- name: Install Packages and Dependencies
block:
- name: Install AGS AUR Packages | {{ ansible_distribution }}
- name: Install Common AGS AUR Packages | {{ ansible_distribution }}
kewlfft.aur.aur:
name: "{{ item }}"
state: present
use: "{{ pacman.aur_helper }}"
become: false
loop:
- aylurs-gtk-shell-git
- bun-bin
- matugen-bin
- wayshot
Expand All @@ -34,3 +33,48 @@
- swappy
- greetd
- cage

- name: Install AGSv2 | {{ ansible_distribution }}
kewlfft.aur.aur:
name: "{{ item }}"
state: present
use: "{{ pacman.aur_helper }}"
become: false
loop:
- aylurs-gtk-shell-git
when: system.ags.need_v1 is not defined or not system.ags.need_v1

- name: Build and Install AGSv1
when: system.ags.need_v1 is defined and system.ags.need_v1
block:
- name: Build AGSv1
ansible.builtin.shell:
cmd: |
mkdir {{ ansible_user_dir }}/agsv1_rebuild
cd {{ ansible_user_dir }}/agsv1_rebuild
/usr/bin/curl -fsSL https://github.com/kotontrion/PKGBUILDS/raw/main/agsv1/PKGBUILD > PKGBUILD
makepkg -s
ignore_errors: yes
register: agsv1_build_outcome
changed_when: no
when: system.ags.need_v1 is defined and system.ags.need_v1

- name: Install Rebuilt AGSv1
ansible.builtin.shell:
cmd: "pacman -U --noconfirm {{ ansible_user_dir }}/agsv1_rebuild/agsv1-1.9.0-1-x86_64.pkg.tar.zst"
become: true
register: agsv1_install_outcome

rescue:
- name: Uninstall Existing AGS
community.general.pacman:
name: aylurs-gtk-shell-git
state: absent
become: true
register: agsv2_uninstall_outcome

- name: Install Rebuilt AGSv1
ansible.builtin.shell:
cmd: "pacman -U --noconfirm {{ ansible_user_dir }}/agsv1_rebuild/agsv1-1.9.0-1-x86_64.pkg.tar.zst"
become: true
register: agsv1_install_outcome
4 changes: 4 additions & 0 deletions roles/ags/templates/config.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ vt = 1
# `agreety` is the bundled agetty/login-lookalike. You can replace `/bin/sh`
# with whatever you want started, such as `sway`.
#command = "cage -s -d -- ags -b greeter -c /etc/greetd/ags/greeter.js"
{% if system.ags.need_v1 is defined and system.ags.need_v1 %}
command = "cage -ds -m last agsv1 -- -c /etc/greetd/ags/greeter.js"
{% else %}
command = "cage -ds -m last ags -- -c /etc/greetd/ags/greeter.js"
{% endif %}
#command = "agreety --cmd zsh"


Expand Down
2 changes: 1 addition & 1 deletion roles/hyprland/files/hypr/config/keybindings/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bind = $mainMod, RETURN, exec, $terminal
bind = $mainMod SHIFT, M, exit,
bind = $mainMod, B, exec, $browser
bind = $mainMod, Q, killactive
bind = $mainMod, F, fullscreen # Set active window to fullscreen
bind = $mainMod SHIFT, F, fullscreen # Set active window to fullscreen
bind = $mainMod, E, exec, $fileManager
bind = CTRL ALT, DELETE, exec, $system-monitor
bind = $mainMod, T, togglefloating
Expand Down
8 changes: 5 additions & 3 deletions roles/hyprland/files/hypr/config/windowrules/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
# -----------------------------------------------------

# Browser Picture in Picture
windowrulev2 = float, title:^(Picture-in-Picture)$
windowrulev2 = pin, title:^(Picture-in-Picture)$
windowrulev2 = move 69.5% 4%, title:^(Picture-in-Picture)$
windowrulev2 = float, title:^(Picture.*n.*icture)$
windowrulev2 = pin, title:^(Picture.*n.*icture)$
windowrulev2 = move 69.5% 4%, title:^(Picture.*n.*icture)$
windowrulev2 = opaque, title:^(Picture.*n.*icture)$
windowrulev2 = noborder, title:^(Picture.*n.*icture)$

# System Monitor
windowrulev2 = float, class:($system-monitor)
Expand Down
8 changes: 3 additions & 5 deletions roles/hyprland/tasks/Archlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,14 @@
cd {{ ansible_user_dir }}/hyprland_rebuild
/usr/bin/curl -fsSL {{ system.hyprland.plugins.rebuild_hypr_on_failure.pkgbuild_url }} > PKGBUILD
makepkg -s
ignore_errors: yes
register: hyprland_rebuild_outcome
changed_when: no

- name: Install rebuilt Hyprland
community.general.pacman:
name: "{{ item }}"
state: present
ansible.builtin.shell:
cmd: "pacman -U --noconfirm {{ ansible_user_dir }}/hyprland_rebuild/hyprland-0.*-x86_64.pkg.tar.zst"
become: true
loop:
- "{{ ansible_user_dir }}/hyprland_rebuild/hyprland-0.45.0-1-x86_64.pkg.tar.zst"
register: hyprland_reinstall_outcome

always:
Expand Down
1 change: 1 addition & 0 deletions roles/hyprland/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
- { src: 'env_default.conf.j2', dest: 'config/environments/default.conf' }
- { src: 'environment.conf.j2', dest: 'config/environment.conf' }
- { src: 'hyprlock.conf.j2', dest: 'hyprlock.conf' }
- { src: 'keybindings.conf.j2', dest: 'config/keybindings/default.conf' }

- name: Manage Hyprland dynamic cursors
block:
Expand Down
4 changes: 4 additions & 0 deletions roles/hyprland/templates/autostart.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ exec-once=/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = hyprpm reload

# Initilize ags
{% if system.ags.need_v1 is defined and system.ags.need_v1 %}
exec-once = agsv1
{% else %}
exec-once = ags
{% endif %}

# Set up cursor theme
exec-once = gsettings set org.gnome.desktop.interface cursor-theme {{ icons.cursor_icons_theme }}
Expand Down
102 changes: 102 additions & 0 deletions roles/hyprland/templates/keybindings.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# -----------------------------------------------------
# Key bindings
# name: "Default"
# -----------------------------------------------------

# Super key
$mainMod = SUPER # Sets "Windows" key as main modifier

bind = $mainMod, L, exec, $lock_cmd
bind = $mainMod, RETURN, exec, $terminal
bind = $mainMod SHIFT, M, exit,
bind = $mainMod, B, exec, $browser
bind = $mainMod, Q, killactive
bind = $mainMod SHIFT, F, fullscreen # Set active window to fullscreen
bind = $mainMod, E, exec, $fileManager
bind = CTRL ALT, DELETE, exec, $system-monitor
bind = $mainMod, T, togglefloating
bind = $mainMod, J, togglesplit # dwindle
bind = $mainMod, G, togglegroup
bind = $mainMod ALT, G, exec, $hyprland-scripts/gamemode.sh
bind = CTRL $mainMod, N, exec, $hyprland-scripts/hyprsunset.sh

# Ags keybingings
{% if system.ags.need_v1 is defined and system.ags.need_v1 %}
bind= $mainMod SHIFT, R, exec, agsv1 -q; agsv1
bind = $mainMod CTRL, RETURN, exec, agsv1 -t launcher
bind = $mainMod, SLASH, exec, agsv1 -t keybinds
bind = $mainMod, F4, exec, agsv1 -t powermenu
bind = $mainMod, Tab, exec, agsv1 -t overview
bind = $mainMod, F12, exec, agsv1 -r 'recorder.start()'
bind = , Print, exec, agsv1 -r 'recorder.screenshot()'
bind = SHIFT, Print, exec, agsv1 -r 'recorder.screenshot(true)'
{% else %}
bind= $mainMod SHIFT, R, exec, ags -q; ags
bind = $mainMod CTRL, RETURN, exec, ags -t launcher
bind = $mainMod, SLASH, exec, ags -t keybinds
bind = $mainMod, F4, exec, ags -t powermenu
bind = $mainMod, Tab, exec, ags -t overview
bind = $mainMod, F12, exec, ags -r 'recorder.start()'
bind = , Print, exec, ags -r 'recorder.screenshot()'
bind = SHIFT, Print, exec, ags -r 'recorder.screenshot(true)'
{% endif %}

# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d

# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10

# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10

# Example special workspace (scratchpad)
# bind = $mainMod, S, togglespecialworkspace, magic
# bind = $mainMod SHIFT, S, movetoworkspace, special:magic

# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1

# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

# Passthrough SUPER KEY to Virtual Machine
bind = $mainMod, P, submap, passthru # Passthrough SUPER key to virtual machine
submap = passthru
bind = $mainMod, Escape, submap, reset # Get SUPER key back from virtual machine
submap = reset

# Fn keys
bind = , XF86MonBrightnessUp, exec, brightnessctl -q s +10% # Increase brightness by 10%
bind = , XF86MonBrightnessDown, exec, brightnessctl -q s 10%- # Reduce brightness by 10%
bind = , XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5% # Increase volume by 5%
bind = , XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5% # Reduce volume by 5%
bind = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle # Toggle mute
bind = , XF86AudioPlay, exec, playerctl play-pause # Audio play pause
bind = , XF86AudioPause, exec, playerctl pause # Audio pause
bind = , XF86AudioNext, exec, playerctl next # Audio next
bind = , XF86AudioPrev, exec, playerctl previous # Audio previous
bind = , XF86AudioMicMute, exec, pactl set-source-mute @DEFAULT_SOURCE@ toggle # Toggle microphone

0 comments on commit 18a87d4

Please sign in to comment.