From ccd4c85027cd87ce35151038afcbe2749827f65b Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Sun, 29 Jan 2023 00:57:35 +0000 Subject: [PATCH] Cleanup some stuff --- .bin/autoinstall | 24 ++++---------- .config/bspwm/bspwmrc | 50 ++++++++++++++--------------- .config/nixpkgs/home.nix | 1 - .config/nixpkgs/portable-tobias.nix | 1 + .config/nixpkgs/portalo-tobias.nix | 11 +++++++ .config/polybar/launch.sh | 4 ++- .local/bin/.gitkeep | 0 7 files changed, 46 insertions(+), 45 deletions(-) delete mode 120000 .config/nixpkgs/home.nix create mode 120000 .config/nixpkgs/portable-tobias.nix create mode 100644 .config/nixpkgs/portalo-tobias.nix create mode 100644 .local/bin/.gitkeep diff --git a/.bin/autoinstall b/.bin/autoinstall index 64971e4..78a8ebf 100755 --- a/.bin/autoinstall +++ b/.bin/autoinstall @@ -1,25 +1,15 @@ #!/usr/bin/env sh _autoinstall_base () { - plug_path="$HOME/.config/vim/autoload/plug.vim" - if [ ! -f "$plug_path" ] - then - _autoinstall_file "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" "$plug_path" - [ -x "$(command -v vim)" ] && yes | vim +'PlugInstall --sync' +qa --not-a-term - fi + _autoinstall_file "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" \ + "$HOME/.config/vim/autoload/plug.vim" \ + && [ -x "$(command -v vim)" ] && yes | vim +'PlugInstall --sync' +qa --not-a-term - nvim_dir="$HOME/.config/nvim" - if [ ! -d "$nvim_dir" ] - then - _autoinstall_git "https://github.com/AstroNvim/AstroNvim" "$nvim_dir" - [ -x "$(command -v nvim)" ] && nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync' - fi + _autoinstall_git "https://github.com/AstroNvim/AstroNvim" "$HOME/.config/nvim" \ + && [ -x "$(command -v nvim)" ] && nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync' - if [ ! -x "$(command -v starship)" ] - then - mkdir -p "$HOME/.local/bin" - curl -sS "https://starship.rs/install.sh" | BIN_DIR="$HOME/.local/bin" FORCE=1 sh - fi + [ ! -x "$(command -v starship)" ] \ + && curl -sS "https://starship.rs/install.sh" | BIN_DIR="$HOME/.local/bin" FORCE=1 sh _autoinstall_env "$WAKATIME_HOME/.wakatime.cfg" diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 8062c34..375a2a7 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -13,44 +13,42 @@ bspc config presel_feedback_color "#6272a4" host_name=$(cat /proc/sys/kernel/hostname) mode=$(cat /tmp/bspwm_mode) +primary="${MONITOR_PRIMARY:-primary}" +secondary="${MONITOR_SECONDARY:-secondary}" + if [ "$host_name" = "portalo" ]; then if [ "$mode" = "presenter" ]; then - xrandr --output "$MONITOR_PRIMARY" --mode 2560x1440 --refresh 144 - xrandr --output "$MONITOR_SECONDARY" --auto --left-of "$MONITOR_PRIMARY" + xrandr --output "$primary" --mode 2560x1440 --refresh 144 + xrandr --output "$secondary" --auto --left-of "$primary" pkill xcompmgr; - bspc monitor "$MONITOR_PRIMARY" -d web terminal 3 4 5 6 focus voip messenger presenter1 - bspc monitor "$MONITOR_SECONDARY" -d presenter2 + bspc monitor "$primary" -d web terminal 3 4 5 6 focus voip messenger presenter1 + bspc monitor "$secondary" -d presenter2 elif [ "$mode" = "single" ]; then - xrandr --output "$MONITOR_SECONDARY" --off - bspc monitor "$MONITOR_PRIMARY" -d web terminal 3 4 5 6 focus side-view voip messenger + xrandr --output "$secondary" --off + bspc monitor "$primary" -d web terminal 3 4 5 6 focus side-view voip messenger else - xrandr --output "$MONITOR_PRIMARY" --mode 2560x1440 --refresh 144 - xrandr --output "$MONITOR_SECONDARY" --auto --left-of "$MONITOR_PRIMARY" + xrandr --output "$primary" --mode 2560x1440 --refresh 144 + xrandr --output "$secondary" --auto --left-of "$primary" - bspc monitor "$MONITOR_PRIMARY" -d web terminal 3 4 5 6 focus - bspc monitor "$MONITOR_SECONDARY" -d side-view voip messenger + bspc monitor "$primary" -d web terminal 3 4 5 6 focus + bspc monitor "$secondary" -d side-view voip messenger fi - bspc wm -O "$MONITOR_PRIMARY" "$MONITOR_SECONDARY" - sleep 1 - bspc wm -O "$MONITOR_PRIMARY" "$MONITOR_SECONDARY" - -elif echo "$host_name" | grep -Eq "laptop"; then - xrandr --output "$MONITOR_PRIMARY" --auto - xrandr --output "$MONITOR_SECONDARY" --left-of "$MONITOR_PRIMARY" --auto - - bspc monitor "$MONITOR_PRIMARY" -d web terminal 3 4 5 6 focus messenger - bspc monitor "$MONITOR_SECONDARY" -d side-view 10 - - bspc wm -O "$MONITOR_PRIMARY" "$MONITOR_SECONDARY" - sleep 1 - bspc wm -O "$MONITOR_PRIMARY" "$MONITOR_SECONDARY" - +#elif echo "$host_name" | grep -Eq "laptop"; then else - bspc monitor primary -d web terminal 3 4 5 6 7 8 9 focus + xrandr --output "$primary" --auto + xrandr --output "$secondary" --left-of "$primary" --auto + + bspc monitor "$primary" -d web terminal 3 4 5 6 focus messenger + bspc monitor "$secondary" -d side-view 10 + fi +bspc wm -O "$primary" "$secondary" +sleep 1 +bspc wm -O "$primary" "$secondary" + bspc wm --adopt-orphans bspc desktop web --layout monocle diff --git a/.config/nixpkgs/home.nix b/.config/nixpkgs/home.nix deleted file mode 120000 index 43c554f..0000000 --- a/.config/nixpkgs/home.nix +++ /dev/null @@ -1 +0,0 @@ -/home/tobias/.config/nixpkgs/portalo-tobias.nix \ No newline at end of file diff --git a/.config/nixpkgs/portable-tobias.nix b/.config/nixpkgs/portable-tobias.nix new file mode 120000 index 0000000..3ed5cd5 --- /dev/null +++ b/.config/nixpkgs/portable-tobias.nix @@ -0,0 +1 @@ +portalo-tobias.nix \ No newline at end of file diff --git a/.config/nixpkgs/portalo-tobias.nix b/.config/nixpkgs/portalo-tobias.nix new file mode 100644 index 0000000..e520f89 --- /dev/null +++ b/.config/nixpkgs/portalo-tobias.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ + home.username = "tobias"; + home.homeDirectory = "/home/tobias"; + + imports = [ + ./common.nix + ./graphical.nix + ]; +} diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh index cc86014..ee2480c 100755 --- a/.config/polybar/launch.sh +++ b/.config/polybar/launch.sh @@ -16,5 +16,7 @@ elif [[ $host_name == *"laptop"* ]]; then polybar laptop-primary & polybar laptop-secondary & else - polybar base & + #polybar base & + polybar laptop-primary & + polybar laptop-secondary & fi diff --git a/.local/bin/.gitkeep b/.local/bin/.gitkeep new file mode 100644 index 0000000..e69de29