diff options
| author | Peter Son Struschka <me@peter-struschka.com> | 2020-07-29 16:40:02 +0800 |
|---|---|---|
| committer | Peter Son Struschka <me@peter-struschka.com> | 2020-07-29 16:48:22 +0800 |
| commit | a1d6fc2f3e6ab041cc51cb085ac59a646a126d25 (patch) | |
| tree | b1ca8b11365cd255dd2f93a47dd0e918e1dae16a /basics/.local/bin/locate-config | |
| parent | 556bbd7fd182937e32eb5320a27ba337ac454be0 (diff) | |
| download | dotfiles-a1d6fc2f3e6ab041cc51cb085ac59a646a126d25.tar.gz dotfiles-a1d6fc2f3e6ab041cc51cb085ac59a646a126d25.tar.bz2 dotfiles-a1d6fc2f3e6ab041cc51cb085ac59a646a126d25.tar.lz dotfiles-a1d6fc2f3e6ab041cc51cb085ac59a646a126d25.tar.xz dotfiles-a1d6fc2f3e6ab041cc51cb085ac59a646a126d25.tar.zst dotfiles-a1d6fc2f3e6ab041cc51cb085ac59a646a126d25.zip | |
basics+bspwm+herbstluftwm+i3wm+meta+polybar+xmonad: wm configs overhaul
Created polybar as its own config instead of duplicated in bspwm and
i3's directories allowing them both to be installed.
Created herbstluftwm, xmonad window manager configs.
Added scripts for a status bar, and fixed scripts.
Diffstat (limited to 'basics/.local/bin/locate-config')
| -rwxr-xr-x | basics/.local/bin/locate-config | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/basics/.local/bin/locate-config b/basics/.local/bin/locate-config index d798a39..26fd2cb 100755 --- a/basics/.local/bin/locate-config +++ b/basics/.local/bin/locate-config @@ -1,24 +1,16 @@ -#! /usr/bin/env bash +#!/bin/sh set -e -CONFIG_FILES=`ls -1 ~/.local/share/config-files | cut -d "" -f 1 | sort -d` -CONFIG_ARRAY=(`find ~/.local/share/config-files/ -maxdepth 1 -mindepth 1 -print0 | sort -z | xargs -r0 echo`) +config_dir="$HOME/.local/share/config-files" -INDEX=`echo "$CONFIG_FILES" | rofi -dmenu -format "i" -no-custom -mesg "Find config file for..."` -[ -z "$INDEX" ] && exit 1 -SOURCE=${CONFIG_ARRAY[$INDEX]} -#echo "$CONFIG_FILES" -#for item in ${CONFIG_ARRAY[*]} -#do -# printf " %s\n" $item -#done -# (https://stackoverflow.com/questions/59895/get-the-source-directory-of-a-bash-script-from-within-the-script-itself) -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" +p="Config:" + +sel=$(find "$config_dir" -writable -type l | cut -d "/" -f 7- | sort -d | dmenu -p "$p" -l 20) +ec=$? +[ "$ec" -ne 0 ] && exit $ec + +target=$(readlink -f "${config_dir}/${sel}") + +echo "$target" -echo $SOURCE |
