From 2be10e1420afea58f859ea4ec5b7565ac1849de2 Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Wed, 6 Nov 2024 15:56:54 -0600 Subject: manage configs for machines with different screen sizes --- .gitignore | 5 ++ Makefile | 16 +++- environment.mk.example | 1 + stow/foot/.config/foot/foot.1k.ini | 3 + stow/foot/.config/foot/foot.4k.ini | 2 + stow/foot/.config/foot/foot.ini | 139 +------------------------------ stow/swaylock/.config/swaylock/config | 2 - stow/swaylock/.config/swaylock/config.1k | 2 + stow/swaylock/.config/swaylock/config.4k | 5 ++ stow/waybar/.config/waybar/config | 87 ------------------- stow/waybar/.config/waybar/config-base | 85 +++++++++++++++++++ stow/waybar/.config/waybar/config.1k | 4 + stow/waybar/.config/waybar/config.4k | 12 +++ 13 files changed, 137 insertions(+), 226 deletions(-) create mode 100644 environment.mk.example create mode 100644 stow/foot/.config/foot/foot.1k.ini create mode 100644 stow/foot/.config/foot/foot.4k.ini delete mode 100644 stow/swaylock/.config/swaylock/config create mode 100644 stow/swaylock/.config/swaylock/config.1k create mode 100644 stow/swaylock/.config/swaylock/config.4k delete mode 100644 stow/waybar/.config/waybar/config create mode 100644 stow/waybar/.config/waybar/config-base create mode 100644 stow/waybar/.config/waybar/config.1k create mode 100644 stow/waybar/.config/waybar/config.4k diff --git a/.gitignore b/.gitignore index ac902ad..68d4ddb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,8 @@ stow/vim/.vimrc-local stow/zsh/.config/zsh/00-local.zsh stow/zsh/.config/zsh/99-local.zsh stow/vim/.vim/.netrwhist + +environment.mk +stow/foot/.config/foot/foot-environment.ini +stow/swaylock/.config/swaylock/config +stow/waybar/.config/waybar/config diff --git a/Makefile b/Makefile index 3b0f54d..56ffccb 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ REPO_CHANGES := $(shell git status --porcelain | wc -l) IS_FEDORA := $(shell command -v dnf > /dev/null && test -f /etc/fedora-release; echo $$?) +include environment.mk + .PHONY: console console: ifneq ($(REPO_CHANGES),0) @@ -38,6 +40,15 @@ fedora: console ifneq ($(IS_FEDORA),0) $(warning not fedora workstation, skipping.) else +ifeq ($(COMPUTER_IDENTITY),desktop) + ln -sfr stow/swaylock/.config/swaylock/config.4k stow/swaylock/.config/swaylock/config + ln -sfr stow/foot/.config/foot/foot.4k.ini stow/foot/.config/foot/foot-environment.ini + ln -sfr stow/waybar/.config/waybar/config.4k stow/waybar/.config/waybar/config +else + ln -sfr stow/swaylock/.config/swaylock/config.1k stow/swaylock/.config/swaylock/config + ln -sfr stow/foot/.config/foot/foot.1k.ini stow/foot/.config/foot/foot-environment.ini + ln -sfr stow/waybar/.config/waybar/config.1k stow/waybar/.config/waybar/config +endif stow --adopt --dir=stow --target=$(HOME) foot stow --adopt --dir=stow --target=$(HOME) mako stow --adopt --dir=stow --target=$(HOME) rofi @@ -53,7 +64,10 @@ else systemctl --user enable udiskie.service systemctl --user enable xdg-names.service endif - sudo systemctl enable --now dnf-automatic-install.timer + sudo systemctl enable --now dnf-automatic.timer + mkdir -p ${HOME}/.local/share/backgrounds + ln -sf /usr/share/backgrounds/default.png ${HOME}/.local/share/backgrounds/default + ln -sf /usr/share/backgrounds/default.png ${HOME}/.local/share/backgrounds/locked endif .PHONY: restore diff --git a/environment.mk.example b/environment.mk.example new file mode 100644 index 0000000..d1f9391 --- /dev/null +++ b/environment.mk.example @@ -0,0 +1 @@ +COMPUTER_IDENTITY := desktop diff --git a/stow/foot/.config/foot/foot.1k.ini b/stow/foot/.config/foot/foot.1k.ini new file mode 100644 index 0000000..565da43 --- /dev/null +++ b/stow/foot/.config/foot/foot.1k.ini @@ -0,0 +1,3 @@ +font=Intel One Mono:size=9 +font-bold=Intel One Mono Medium:size=9 +letter-spacing=-1px diff --git a/stow/foot/.config/foot/foot.4k.ini b/stow/foot/.config/foot/foot.4k.ini new file mode 100644 index 0000000..08d91b9 --- /dev/null +++ b/stow/foot/.config/foot/foot.4k.ini @@ -0,0 +1,2 @@ +font=Intel One Mono:size=11 +font-bold=Intel One Mono Medium:size=11 diff --git a/stow/foot/.config/foot/foot.ini b/stow/foot/.config/foot/foot.ini index 98964ba..dd58f6a 100644 --- a/stow/foot/.config/foot/foot.ini +++ b/stow/foot/.config/foot/foot.ini @@ -1,74 +1,9 @@ -# -*- conf -*- - -# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) -# term=foot (or xterm-256color if built with -Dterminfo=disabled) -# login-shell=no - -font=Intel One Mono:size=9 -font-bold=Intel One Mono Medium:size=9 -# font-bold= -# font-italic= -# font-bold-italic= -# line-height= -letter-spacing=-1px -# horizontal-letter-offset=0 -# vertical-letter-offset=0 -# box-drawings-uses-font-glyphs=no dpi-aware=yes -# initial-window-size-pixels=700x500 # Or, -# initial-window-size-chars= -# initial-window-mode=windowed -# pad=2x2 # optionally append 'center' -# resize-delay-ms=100 - -# notify=notify-send -a foot -i foot ${title} ${body} -# url-launch=xdg-open ${url} - -# bold-text-in-bright=no -# bell=none -# word-delimiters=,│`|:"'()[]{}<> -# jump-label-letters=sadfjklewcmpgh -# selection-target=primary -# workers= -# osc8-underline=url-mode - -[scrollback] -# lines=1000 -# multiplier=3.0 -# indicator-position=relative -# indicator-format= - -[cursor] -# style=block -# color=111111 dcdccc -# blink=no - [mouse] hide-when-typing=yes -# alternate-scroll-mode=yes [colors] -# alpha=1.0 -background=eff0f2 -foreground=4a4b4e -regular0=4a4b4e -regular1=a32a3a -regular2=206620 -regular3=745300 -regular4=4b529a -regular5=8d377e -regular6=086784 -regular7=dee2e0 -bright0=676364 -bright1=a64822 -bright2=187408 -bright3=8b590a -bright4=5c59b2 -bright5=8e45a8 -bright6=3f649c -bright7=eff0f2 - background=ffffff foreground=4a484d regular0=4a484d @@ -88,75 +23,7 @@ bright5=700dc9 bright6=005289 bright7=ffffff +[main] +include=~/.config/foot/foot-environment.ini -# selection-foreground= -# selection-background= -# jump-labels= -# urls= - -[csd] -# preferred=server -# size=26 -# color= -# button-width=26 -# button-minimize-color= -# button-maximize-color= -# button-close-color= - -[key-bindings] -# scrollback-up-page=Shift+Page_Up -# scrollback-up-half-page=none -# scrollback-up-line=none -# scrollback-down-page=Shift+Page_Down -# scrollback-down-half-page=none -# scrollback-down-line=none -# clipboard-copy=Control+Shift+c -# clipboard-paste=Control+Shift+v -# primary-paste=Shift+Insert -# search-start=Control+Shift+r -# font-increase=Control+plus Control+equal Control+KP_Add -# font-decrease=Control+minus Control+KP_Subtract -# font-reset=Control+0 Control+KP_0 -# spawn-terminal=Control+Shift+n -# minimize=none -# maximize=none -# fullscreen=none -# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none -# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none -# pipe-selected=[xargs -r firefox] none -# show-urls-launch=Control+Shift+u -# show-urls-copy=none - -[search-bindings] -# cancel=Control+g Escape -# commit=Return -# find-prev=Control+r -# find-next=Control+s -# cursor-left=Left Control+b -# cursor-left-word=Control+Left Mod1+b -# cursor-right=Right Control+f -# cursor-right-word=Control+Right Mod1+f -# cursor-home=Home Control+a -# cursor-end=End Control+e -# delete-prev=BackSpace -# delete-prev-word=Mod1+BackSpace Control+BackSpace -# delete-next=Delete -# delete-next-word=Mod1+d Control+Delete -# extend-to-word-boundary=Control+w -# extend-to-next-whitespace=Control+Shift+w -# clipboard-paste=Control+v Control+y -# primary-paste=Shift+Insert - -#[url-bindings] -# cancel=Control+g Control+d Escape -# toggle-url-visible=t - -[mouse-bindings] -# primary-paste=BTN_MIDDLE -# select-begin=BTN_LEFT -# select-begin-block=Control+BTN_LEFT -# select-extend=BTN_RIGHT -# select-extend-character-wise=Control+BTN_RIGHT -# select-word=BTN_LEFT-2 -# select-word-whitespace=Control+BTN_LEFT-2 -# select-row=BTN_LEFT-3 +# vim: ft=dosini diff --git a/stow/swaylock/.config/swaylock/config b/stow/swaylock/.config/swaylock/config deleted file mode 100644 index f4ee89e..0000000 --- a/stow/swaylock/.config/swaylock/config +++ /dev/null @@ -1,2 +0,0 @@ -image=~/.local/share/backgrounds/locked -ignore-empty-password diff --git a/stow/swaylock/.config/swaylock/config.1k b/stow/swaylock/.config/swaylock/config.1k new file mode 100644 index 0000000..f4ee89e --- /dev/null +++ b/stow/swaylock/.config/swaylock/config.1k @@ -0,0 +1,2 @@ +image=~/.local/share/backgrounds/locked +ignore-empty-password diff --git a/stow/swaylock/.config/swaylock/config.4k b/stow/swaylock/.config/swaylock/config.4k new file mode 100644 index 0000000..50e6af7 --- /dev/null +++ b/stow/swaylock/.config/swaylock/config.4k @@ -0,0 +1,5 @@ +image=~/.local/share/backgrounds/locked +ignore-empty-password +indicator-y-position=1750 +indicator-radius=75 +indicator-thickness=15 diff --git a/stow/waybar/.config/waybar/config b/stow/waybar/.config/waybar/config deleted file mode 100644 index f3dd9b1..0000000 --- a/stow/waybar/.config/waybar/config +++ /dev/null @@ -1,87 +0,0 @@ -[ - { - "name": "topbar", - "layer": "bottom", - "position": "top", - "height": 0, - "modules-left": ["sway/workspaces", "sway/mode"], - "modules-center": ["sway/window"], - "modules-right": ["tray", "custom/reboot", "custom/backup", "pulseaudio", "battery", "temperature", "idle_inhibitor", "clock"], - "sway/workspaces": { - "format": "{name} {index}", - "format-icons": { - "1": "", - "2": "", - "3": "" - } - }, - "sway/window": { - "max-length": 100, - "rewrite": { - "(.*) — Mozilla Firefox": "$1" - }, - "icon": true, - "icon-size": 20 - }, - "tray": { - "spacing": 20 - }, - "clock": { - "interval": 1, - "format": "{:%a %d %b %I:%M %p}", - "format-alt": "{:%Y-%m-%d %H:%M:%S}", - "tooltip-format": "{:%Y %B}\n{calendar}", - "today-format": "{}" - }, - "temperature": { - "critical-threshold": 80, - "format": "{icon}", - "format-alt": "{temperatureC}°C {icon}", - "format-icons": ["", "", ""], - "tooltip-format": "Temperature: {temperatureC}°C" - }, - "battery": { - "interval": 60, - "states": { - "warning": 30, - "critical": 15 - }, - "format": "{icon}", - "format-alt": "{capacity}% {icon}", - "format-charging": "\uf0e7", - "format-icons": ["", "", "", "", ""], - "tooltip-format": "Battery: {capacity}%\n{timeTo}" - }, - "pulseaudio": { - "scroll-step": 5, - "format": "{icon}", - "format-muted": "", - "format-icons": { - "headphone": "", - "default": ["", ""] - }, - "tooltip-format": "Volume: {volume}%\n{desc}", - "on-click": "pavucontrol-qt" - }, - "idle_inhibitor": { - "format": "{icon}", - "format-icons": { - "activated": "", - "deactivated": "" - }, - "tooltip": false - }, - "custom/reboot": { - "format": "{}", - "exec": "~/.local/bin/dnf-needs-restarting", - "return-type": "json", - "interval": 60 - }, - "custom/backup": { - "format": "{}", - "exec": "~/.local/bin/checkbackup", - "return-type": "json", - "interval": 60 - } - } -] diff --git a/stow/waybar/.config/waybar/config-base b/stow/waybar/.config/waybar/config-base new file mode 100644 index 0000000..4a3ba4b --- /dev/null +++ b/stow/waybar/.config/waybar/config-base @@ -0,0 +1,85 @@ +{ + "name": "topbar", + "layer": "bottom", + "position": "top", + "height": 0, + "modules-left": ["sway/workspaces", "sway/mode"], + "modules-center": ["sway/window"], + "sway/workspaces": { + "format": "{name} {index}", + "format-icons": { + "1": "", + "2": "", + "3": "" + } + }, + "sway/window": { + "max-length": 100, + "rewrite": { + "(.*) — Mozilla Firefox": "$1" + }, + "icon": true, + "icon-size": 20 + }, + "tray": { + "spacing": 20 + }, + "clock": { + "interval": 1, + "format": "{:%a %d %b %I:%M %p}", + "format-alt": "{:%Y-%m-%d %H:%M:%S}", + "tooltip-format": "{:%Y %B}\n{calendar}", + "today-format": "{}" + }, + "temperature#cpu": { + "hwmon-path": "/sys/class/hwmon/hwmon3/temp1_input", + "critical-threshold": 75, + "format": "{icon}", + "format-alt": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""], + "tooltip-format": "Temperature: {temperatureC}°C" + }, + "battery": { + "interval": 60, + "states": { + "warning": 30, + "critical": 15 + }, + "format": "{icon}", + "format-alt": "{capacity}% {icon}", + "format-charging": "\uf0e7", + "format-icons": ["", "", "", "", ""], + "tooltip-format": "Battery: {capacity}%\n{timeTo}" + }, + "pulseaudio": { + "scroll-step": 5, + "format": "{icon}", + "format-muted": "", + "format-icons": { + "headphone": "", + "default": ["", ""] + }, + "tooltip-format": "Volume: {volume}%\n{desc}", + "on-click": "pavucontrol-qt" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + }, + "tooltip": false + }, + "custom/reboot": { + "format": "{}", + "exec": "~/.local/bin/dnf-needs-restarting", + "return-type": "json", + "interval": 60 + }, + "custom/backup": { + "format": "{}", + "exec": "~/.local/bin/checkbackup", + "return-type": "json", + "interval": 60 + } +} diff --git a/stow/waybar/.config/waybar/config.1k b/stow/waybar/.config/waybar/config.1k new file mode 100644 index 0000000..24bff8a --- /dev/null +++ b/stow/waybar/.config/waybar/config.1k @@ -0,0 +1,4 @@ +{ + "modules-right": ["tray", "custom/reboot", "custom/backup", "pulseaudio", battery, "temperature#cpu", "idle_inhibitor", "clock"], + "include": "~/.config/waybar/config-base", +} diff --git a/stow/waybar/.config/waybar/config.4k b/stow/waybar/.config/waybar/config.4k new file mode 100644 index 0000000..f29d156 --- /dev/null +++ b/stow/waybar/.config/waybar/config.4k @@ -0,0 +1,12 @@ +{ + "temperature#gpu": { + "hwmon-path": "/sys/class/hwmon/hwmon2/temp2_input", + "critical-threshold": 70, + "format": "{icon}", + "format-alt": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""], + "tooltip-format": "Temperature: {temperatureC}°C" + }, + "modules-right": ["tray", "custom/reboot", "custom/backup", "pulseaudio", "temperature#cpu", "temperature#gpu", "idle_inhibitor", "clock"], + "include": "~/.config/waybar/config-base", +} -- cgit v1.2.3