summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorChristian Krinitsin <christian@krinitsin.xyz>2024-03-16 21:16:28 +0100
committerChristian Krinitsin <christian@krinitsin.xyz>2024-03-16 21:16:28 +0100
commite992c3c164e9bf8869fb8b20eaa17ca595d92aac (patch)
tree849e0f16837e5aa269fc136512e153ec3b889de6
parentb8a4392c8754a56265701f97f4833b447efff29a (diff)
downloaddotfiles-e992c3c164e9bf8869fb8b20eaa17ca595d92aac.tar.gz
dotfiles-e992c3c164e9bf8869fb8b20eaa17ca595d92aac.zip
custom bins
-rw-r--r--.bashrc2
-rwxr-xr-x.profile3
-rwxr-xr-xbin/bluetooth-devices25
-rwxr-xr-xbin/dmenu5
-rwxr-xr-xbin/qtb-load-session21
-rwxr-xr-xbin/random-wallpaper13
-rwxr-xr-xbin/run-spotify-player5
-rwxr-xr-xbin/screenshot21
-rwxr-xr-xbin/waterboy10
-rwxr-xr-xbin/zathura-fzf11
10 files changed, 113 insertions, 3 deletions
diff --git a/.bashrc b/.bashrc
index 547fb5e..ab1bf09 100644
--- a/.bashrc
+++ b/.bashrc
@@ -1,5 +1,5 @@
 # Export own script path
-export PATH=/usr/local/bin/:$HOME/.local/bin/:$PATH
+export PATH=/usr/local/bin/:$HOME/.dotfiles/bin/:$PATH
 
 # Aliases
 alias ls='ls --color=auto'
diff --git a/.profile b/.profile
index ff67372..30fcca4 100755
--- a/.profile
+++ b/.profile
@@ -1,4 +1,3 @@
 export GPG_TTY=$(tty)
-export PATH=/home/chris/.local/bin:$PATH
+export PATH=/home/chris/.dotfiles/bin:$PATH
 export ELECTRON_OZONE_PLATFORM_HINT=auto
-#export QT_QPA_PLATFORMTHEME=qt5ct
diff --git a/bin/bluetooth-devices b/bin/bluetooth-devices
new file mode 100755
index 0000000..5cc4876
--- /dev/null
+++ b/bin/bluetooth-devices
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+#
+# This program lists all paired devices which you can select from, the selected one
+# will be connected
+#   
+
+# Opens dmenu prompt, which lets you decide which device you want to connect to
+DEVICE=$(bluetoothctl devices | sed 's/[^ ]* //' | sed 's/[^ ]* //' | dmenu)
+
+# If dmenu was cancelled, exit program
+if [ $? -ne 0 ]; then
+    exit 1
+fi
+
+# Get MAC adress of the device you selected
+MAC=$(bluetoothctl devices | grep "$DEVICE" | sed 's/[^ ]* //' | cut -d ' ' -f1)
+
+# Send a notify whether the connection was successful 
+if bluetoothctl connect $MAC | grep -q 'successful' 
+then
+    notify-send -t 5000 -r 2954 -u normal "  Connected successfully to" "     $DEVICE"
+else 
+    notify-send -t 5000 -r 2954 -u normal "  Couldn't connect to" "     $DEVICE"
+fi
diff --git a/bin/dmenu b/bin/dmenu
new file mode 100755
index 0000000..6ca1a50
--- /dev/null
+++ b/bin/dmenu
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+/usr/local/bin/dmenu-wl $* -nb '#2b3339' -nf '#d3c6aa' -sb '#d3c6aa' -sf '#212736' -i -fn 'DroidSansM Nerd Font'
+
+exit $?
diff --git a/bin/qtb-load-session b/bin/qtb-load-session
new file mode 100755
index 0000000..bf2ead3
--- /dev/null
+++ b/bin/qtb-load-session
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+#
+# This script opens a session in qutebrowser. There is a problem, that if one session is already open,
+#   the new selected session is 'empty'. To avoid this problem, all qutebrowser windows are killed before
+#       opening the new session.
+#
+
+sessions_path=$(realpath ~/.local/share/qutebrowser/sessions)
+
+rm ~/.local/share/qutebrowser/sessions/_autosave.yml
+
+sel=$(find $sessions_path -iname "*.yml" -exec basename {} .yml ";" | sort -u | dmenu)
+
+if [ $? -ne 0 ]; then
+    exit 1
+fi
+
+ps -A | grep 'qutebrowser' && qutebrowser :wq
+
+qutebrowser -r $sel
diff --git a/bin/random-wallpaper b/bin/random-wallpaper
new file mode 100755
index 0000000..796d44c
--- /dev/null
+++ b/bin/random-wallpaper
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#
+# This script takes a random wallpaper out of the folder it cd's into
+#   In the repo there are duplicates of the backgrounds with different colorgrading,
+#   I'm "limiting" myself to one colorgrading
+
+
+cd ~/.everforest-walls/nature/
+
+IMAGE=$(find *'1.png' | sort -R | tail -n 1) 
+
+swaymsg output "*" bg ~/.everforest-walls/nature/$IMAGE fill
diff --git a/bin/run-spotify-player b/bin/run-spotify-player
new file mode 100755
index 0000000..865aecd
--- /dev/null
+++ b/bin/run-spotify-player
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+ps -A | grep -q 'spotify_player' || spotify_player -d
+
+kitty -e spotify_player
diff --git a/bin/screenshot b/bin/screenshot
new file mode 100755
index 0000000..e5391c8
--- /dev/null
+++ b/bin/screenshot
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# 
+# Takes a screenshot with grimshot, in clipboard or in home directory
+#
+
+MODE=$(printf "copy\nsave" | dmenu)
+
+# If dmenu was cancelled, exit program
+if [ $? -ne 0 ]; then
+    exit 1
+fi
+
+case "$MODE" in 
+  *save*)
+      grimshot save area ~/"screenshot-$(date +%F)-$(date +%T).png" && notify-send "screenshot-$(date +%F)-$(date +%T).png" "saved" 
+    ;;
+  *copy*)
+      grimshot copy area && notify-send "Screenshot copied" 
+    ;;
+esac
diff --git a/bin/waterboy b/bin/waterboy
new file mode 100755
index 0000000..9a1e425
--- /dev/null
+++ b/bin/waterboy
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if [ $# = 0 ]; then
+    echo "Give me some names, Waterboy!" | cowsay
+    exit 1
+fi
+
+chosen_one=$(shuf -e $@ | head -n 1)
+
+echo "Go $chosen_one, Waterboy!" | cowsay
diff --git a/bin/zathura-fzf b/bin/zathura-fzf
new file mode 100755
index 0000000..2b5ddbd
--- /dev/null
+++ b/bin/zathura-fzf
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+find "$@" -type f -iname '*pdf' > ~/.pdffiles.txt
+
+alacritty -e sh -c 'cat ~/.pdffiles.txt | fzf > ~/.zathurafile.txt'
+
+selected_file=$(cat ~/.zathurafile.txt)
+
+cat ~/.zathurafile.txt | grep '' && zathura "$selected_file"
+
+rm $HOME/.zathurafile.txt $HOME/.pdffiles.txt