Remove nix-shell shebang from autostart-manage

This commit is contained in:
Tobias Reisinger 2023-02-03 00:13:20 +01:00
parent 1458d5b334
commit cee6671913
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
3 changed files with 8 additions and 7 deletions

View file

@ -1,6 +1,4 @@
#!/usr/bin/env nix-shell #!/usr/bin/env bash
#!nix-shell -i bash -p dasel hostname
# shellcheck shell=bash
_systemctl () { _systemctl () {
systemctl --user "${@:2}" "autostart@$1.service" systemctl --user "${@:2}" "autostart@$1.service"
@ -61,8 +59,10 @@ _autostart_manage_enable_all () {
} }
_get_autostart_cmd () { _get_autostart_cmd () {
hostname=$(cat /proc/sys/kernel/hostname)
selector_base="all()" 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))" selector_entry="filter(not(equal(type(),object))).filter(equal(key(),$1))"
cmd=$(_dasel "$selector_base.$selector_entry") cmd=$(_dasel "$selector_base.$selector_entry")
cmd_local=$(_dasel "$selector_host.$selector_entry") cmd_local=$(_dasel "$selector_host.$selector_entry")

View file

@ -10,13 +10,13 @@ bspc config active_border_color "#bd93f9"
bspc config focused_border_color "#ff79c6" bspc config focused_border_color "#ff79c6"
bspc config presel_feedback_color "#6272a4" bspc config presel_feedback_color "#6272a4"
host_name=$(cat /proc/sys/kernel/hostname) hostname=$(cat /proc/sys/kernel/hostname)
mode=$(cat /tmp/bspwm_mode) mode=$(cat /tmp/bspwm_mode)
primary="${MONITOR_PRIMARY:-primary}" primary="${MONITOR_PRIMARY:-primary}"
secondary="${MONITOR_SECONDARY:-secondary}" secondary="${MONITOR_SECONDARY:-secondary}"
if [ "$host_name" = "portalo" ]; then if [ "$hostname" = "portalo" ]; then
if [ "$mode" = "presenter" ]; then if [ "$mode" = "presenter" ]; then
xrandr --output "$primary" --mode 2560x1440 --refresh 144 xrandr --output "$primary" --mode 2560x1440 --refresh 144
xrandr --output "$secondary" --auto --left-of "$primary" xrandr --output "$secondary" --auto --left-of "$primary"
@ -35,7 +35,7 @@ if [ "$host_name" = "portalo" ]; then
bspc monitor "$secondary" -d side-view voip messenger bspc monitor "$secondary" -d side-view voip messenger
fi fi
#elif echo "$host_name" | grep -Eq "laptop"; then #elif echo "$hostname" | grep -Eq "laptop"; then
else else
xrandr --output "$primary" --auto xrandr --output "$primary" --auto
xrandr --output "$secondary" --left-of "$primary" --auto xrandr --output "$secondary" --left-of "$primary" --auto

View file

@ -4,6 +4,7 @@
# Packages that should be installed to the user profile. # Packages that should be installed to the user profile.
home.packages = with pkgs; [ home.packages = with pkgs; [
bat # cat-alternative bat # cat-alternative
dasel # tool to manage yq, jq, toml and more
direnv # tool to load custom environments direnv # tool to load custom environments
docker-credential-helpers docker-credential-helpers
exa # ls-alternative exa # ls-alternative