aboutsummaryrefslogtreecommitdiffstats
path: root/basics
diff options
context:
space:
mode:
authorPeter Son Struschka <me@peter-struschka.com>2020-02-02 12:50:32 +0800
committerPeter Son Struschka <me@peter-struschka.com>2020-02-02 12:50:32 +0800
commitf2b18aab5a84d04a36f4194473680ad70bdb5578 (patch)
treee9db24237556f25832811d224bcb7898f22d5d1a /basics
parent2bb9010d2e613206ce3d476dbea81eb9a56f3c66 (diff)
downloaddotfiles-f2b18aab5a84d04a36f4194473680ad70bdb5578.tar.gz
dotfiles-f2b18aab5a84d04a36f4194473680ad70bdb5578.tar.bz2
dotfiles-f2b18aab5a84d04a36f4194473680ad70bdb5578.tar.lz
dotfiles-f2b18aab5a84d04a36f4194473680ad70bdb5578.tar.xz
dotfiles-f2b18aab5a84d04a36f4194473680ad70bdb5578.tar.zst
dotfiles-f2b18aab5a84d04a36f4194473680ad70bdb5578.zip
script to find and edit config files
Diffstat (limited to 'basics')
-rw-r--r--basics/.config/alacritty/alacritty.yml9
-rwxr-xr-xbasics/.local/bin/battery-monitor (renamed from basics/.bin/battery-monitor)0
-rwxr-xr-xbasics/.local/bin/edit-config6
-rwxr-xr-xbasics/.local/bin/locate-config24
l---------basics/.local/share/config-files/alacritty1
l---------basics/.local/share/config-files/dotfiles1
l---------basics/.local/share/config-files/dunst1
l---------basics/.local/share/config-files/kitty1
l---------basics/.local/share/config-files/ranger1
l---------basics/.local/share/config-files/rofi1
10 files changed, 36 insertions, 9 deletions
diff --git a/basics/.config/alacritty/alacritty.yml b/basics/.config/alacritty/alacritty.yml
index 8c2ad85..aba774a 100644
--- a/basics/.config/alacritty/alacritty.yml
+++ b/basics/.config/alacritty/alacritty.yml
@@ -59,15 +59,6 @@ scrolling:
# scrollback is enabled (history > 0).
multiplier: 3
- # Faux Scrolling
- #
- # The `faux_multiplier` setting controls the number of lines the terminal
- # should scroll when the alternate screen buffer is active. This is used
- # to allow mouse scrolling for applications like `man`.
- #
- # Specifying `0` will disable faux scrolling.
- faux_multiplier: 3
-
# Scroll to the bottom when new text is written to the terminal.
auto_scroll: false
diff --git a/basics/.bin/battery-monitor b/basics/.local/bin/battery-monitor
index ff1ef8b..ff1ef8b 100755
--- a/basics/.bin/battery-monitor
+++ b/basics/.local/bin/battery-monitor
diff --git a/basics/.local/bin/edit-config b/basics/.local/bin/edit-config
new file mode 100755
index 0000000..7d1baae
--- /dev/null
+++ b/basics/.local/bin/edit-config
@@ -0,0 +1,6 @@
+#/bin/sh
+
+FILE=$(locate-config)
+[ -z "$FILE" ] && exit 1
+
+$EDITOR $FILE
diff --git a/basics/.local/bin/locate-config b/basics/.local/bin/locate-config
new file mode 100755
index 0000000..d798a39
--- /dev/null
+++ b/basics/.local/bin/locate-config
@@ -0,0 +1,24 @@
+#! /usr/bin/env bash
+
+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`)
+
+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 )"
+
+echo $SOURCE
diff --git a/basics/.local/share/config-files/alacritty b/basics/.local/share/config-files/alacritty
new file mode 120000
index 0000000..2f6fb52
--- /dev/null
+++ b/basics/.local/share/config-files/alacritty
@@ -0,0 +1 @@
+../../../.config/alacritty/alacritty.yml \ No newline at end of file
diff --git a/basics/.local/share/config-files/dotfiles b/basics/.local/share/config-files/dotfiles
new file mode 120000
index 0000000..11a54ed
--- /dev/null
+++ b/basics/.local/share/config-files/dotfiles
@@ -0,0 +1 @@
+../../../../ \ No newline at end of file
diff --git a/basics/.local/share/config-files/dunst b/basics/.local/share/config-files/dunst
new file mode 120000
index 0000000..0faa1f8
--- /dev/null
+++ b/basics/.local/share/config-files/dunst
@@ -0,0 +1 @@
+../../../.config/dunst/dunstrc \ No newline at end of file
diff --git a/basics/.local/share/config-files/kitty b/basics/.local/share/config-files/kitty
new file mode 120000
index 0000000..71c3f1a
--- /dev/null
+++ b/basics/.local/share/config-files/kitty
@@ -0,0 +1 @@
+../../../.config/kitty/kitty.conf \ No newline at end of file
diff --git a/basics/.local/share/config-files/ranger b/basics/.local/share/config-files/ranger
new file mode 120000
index 0000000..5ecd95a
--- /dev/null
+++ b/basics/.local/share/config-files/ranger
@@ -0,0 +1 @@
+../../../.config/ranger/rc.conf \ No newline at end of file
diff --git a/basics/.local/share/config-files/rofi b/basics/.local/share/config-files/rofi
new file mode 120000
index 0000000..2695e7e
--- /dev/null
+++ b/basics/.local/share/config-files/rofi
@@ -0,0 +1 @@
+../../../.config/rofi/config \ No newline at end of file