diff --git a/.bin/autostart-manage b/.bin/autostart-manage index f06e979..7513c33 100755 --- a/.bin/autostart-manage +++ b/.bin/autostart-manage @@ -1,6 +1,4 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p dasel hostname -# shellcheck shell=bash +#!/usr/bin/env bash _systemctl () { systemctl --user "${@:2}" "autostart@$1.service" @@ -61,8 +59,10 @@ _autostart_manage_enable_all () { } _get_autostart_cmd () { + hostname=$(cat /proc/sys/kernel/hostname) + selector_base="all()" - selector_host="all().filter(equal(type(),object)).filter(equal(key(),$(hostname))).all()" + selector_host="all().filter(equal(type(),object)).filter(equal(key(),$hostname)).all()" selector_entry="filter(not(equal(type(),object))).filter(equal(key(),$1))" cmd=$(_dasel "$selector_base.$selector_entry") cmd_local=$(_dasel "$selector_host.$selector_entry") diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 375a2a7..fa1af02 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -10,13 +10,13 @@ bspc config active_border_color "#bd93f9" bspc config focused_border_color "#ff79c6" bspc config presel_feedback_color "#6272a4" -host_name=$(cat /proc/sys/kernel/hostname) +hostname=$(cat /proc/sys/kernel/hostname) mode=$(cat /tmp/bspwm_mode) primary="${MONITOR_PRIMARY:-primary}" secondary="${MONITOR_SECONDARY:-secondary}" -if [ "$host_name" = "portalo" ]; then +if [ "$hostname" = "portalo" ]; then if [ "$mode" = "presenter" ]; then xrandr --output "$primary" --mode 2560x1440 --refresh 144 xrandr --output "$secondary" --auto --left-of "$primary" @@ -35,7 +35,7 @@ if [ "$host_name" = "portalo" ]; then bspc monitor "$secondary" -d side-view voip messenger fi -#elif echo "$host_name" | grep -Eq "laptop"; then +#elif echo "$hostname" | grep -Eq "laptop"; then else xrandr --output "$primary" --auto xrandr --output "$secondary" --left-of "$primary" --auto diff --git a/.config/nixpkgs/common.nix b/.config/nixpkgs/common.nix index eee51f0..406caf8 100644 --- a/.config/nixpkgs/common.nix +++ b/.config/nixpkgs/common.nix @@ -4,6 +4,7 @@ # Packages that should be installed to the user profile. home.packages = with pkgs; [ bat # cat-alternative + dasel # tool to manage yq, jq, toml and more direnv # tool to load custom environments docker-credential-helpers exa # ls-alternative