From 2409d8a141c5ef106561e8736b9ad92e42f748dd Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Sun, 18 Feb 2024 17:06:18 +0100 Subject: [PATCH] fix: better electrum GUI resolution and tabs --- salt/electrum/configure-common.sls | 48 +++++++++++++++++++ salt/electrum/configure-common.top | 10 ++++ salt/electrum/configure-hot.sls | 9 +--- salt/electrum/configure.sls | 9 +--- .../files/client/xprofile.d/electrum.sh | 12 +++++ 5 files changed, 72 insertions(+), 16 deletions(-) create mode 100644 salt/electrum/configure-common.sls create mode 100644 salt/electrum/configure-common.top create mode 100755 salt/electrum/files/client/xprofile.d/electrum.sh diff --git a/salt/electrum/configure-common.sls b/salt/electrum/configure-common.sls new file mode 100644 index 0000000..042d07a --- /dev/null +++ b/salt/electrum/configure-common.sls @@ -0,0 +1,48 @@ +{# +SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +{% if grains['nodename'] != 'dom0' -%} + +include: + - dev.home-cleanup + - dotfiles.copy-x11 + - dotfiles.copy-sh + +"{{ slsdotpath }}-do-not-check-for-updates": + cmd.run: + - name: electrum --offline setconfig check_updates false + - runas: user + +"{{ slsdotpath }}-show-contacts-tab": + cmd.run: + - name: electrum --offline setconfig show_contacts_tab true + - runas: user + +"{{ slsdotpath }}-show-addresses-tab": + cmd.run: + - name: electrum --offline setconfig show_addresses_tab true + - runas: user + +"{{ slsdotpath }}-show-utxo-tab": + cmd.run: + - name: electrum --offline setconfig show_utxo_tab true + - runas: user + +"{{ slsdotpath }}-show-notes-tab": + cmd.run: + - name: electrum --offline setconfig show_notes_tab true + - runas: user + +"{{ slsdotpath }}-xprofile-to-increase-dpi": + file.managed: + - name: /home/user/.config/x11/xprofile.d/electrum.sh + - source: salt://{{ slsdotpath }}/files/client/xprofile.d/electrum.sh + - mode: '0755' + - user: user + - group: user + - makedirs: True + +{% endif -%} diff --git a/salt/electrum/configure-common.top b/salt/electrum/configure-common.top new file mode 100644 index 0000000..6090dbd --- /dev/null +++ b/salt/electrum/configure-common.top @@ -0,0 +1,10 @@ +{# +SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +base: + 'electrum,electrum-hot': + - match: list + - electrum.configure-common diff --git a/salt/electrum/configure-hot.sls b/salt/electrum/configure-hot.sls index 65882b2..c56b556 100644 --- a/salt/electrum/configure-hot.sls +++ b/salt/electrum/configure-hot.sls @@ -7,13 +7,6 @@ SPDX-License-Identifier: AGPL-3.0-or-later {% if grains['nodename'] != 'dom0' -%} include: - - dev.home-cleanup - - dotfiles.copy-x11 - - dotfiles.copy-sh - -"{{ slsdotpath }}-setconfig-check_updates": - cmd.run: - - name: electrum --offline setconfig check_updates false - - runas: user + - .configure-common {% endif -%} diff --git a/salt/electrum/configure.sls b/salt/electrum/configure.sls index 7983b14..7517ddb 100644 --- a/salt/electrum/configure.sls +++ b/salt/electrum/configure.sls @@ -7,14 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later {% if grains['nodename'] != 'dom0' -%} include: - - dev.home-cleanup - - dotfiles.copy-x11 - - dotfiles.copy-sh + - .configure-common - whonix-workstation.configure-offline -"{{ slsdotpath }}-setconfig-check_updates": - cmd.run: - - name: electrum --offline setconfig check_updates false - - runas: user - {% endif -%} diff --git a/salt/electrum/files/client/xprofile.d/electrum.sh b/salt/electrum/files/client/xprofile.d/electrum.sh new file mode 100755 index 0000000..e85f91b --- /dev/null +++ b/salt/electrum/files/client/xprofile.d/electrum.sh @@ -0,0 +1,12 @@ +#!/bin/sh +## SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. +## +## SPDX-License-Identifier: AGPL-3.0-or-later + +current_dpi="$(xrdb -get Xft.dpi)" +wanted_dpi="144" + +if test -z "${current_dpi}" || test "${current_dpi}" -lt "${wanted_dpi}" +then + echo "Xft.dpi: ${wanted_dpi}" | xrdb -override - +fi