Quellcode durchsuchen

Add functions to reconfigure applications

master
Immanuel Onyeka vor 2 Jahren
Ursprung
Commit
fb9a617233
4 geänderte Dateien mit 32 neuen und 34 gelöschten Zeilen
  1. +16
    -1
      configure
  2. +0
    -25
      dwm-start
  3. +15
    -7
      prompt
  4. +1
    -1
      setup-xbindkeys

+ 16
- 1
configure Datei anzeigen

@@ -39,11 +39,23 @@ vim() {
# Should copy plugins too # Should copy plugins too
} }


neomutt() {
sudo cp -r $CONFIGS/neomutt $XDG_CONFIG_HOME/
}

mbsync() {
cp $CONFIGS/mbsyncrc ~/.mbsyncrc
}

bash() { bash() {
cp $CONFIGS/.bashrc ~/.bashrc cp $CONFIGS/.bashrc ~/.bashrc
cp $CONFIGS/.profile ~/.profile cp $CONFIGS/.profile ~/.profile
} }


rtorrent() {
cp $CONFIGS/.rtorrentrc
}

# Used to configure a new system or reset things for an existing one. # Used to configure a new system or reset things for an existing one.
all() { all() {
ls ls
@@ -54,6 +66,9 @@ case $1 in
builds) builds;; builds) builds;;
vim) vim;; vim) vim;;
macros) macros;; macros) macros;;
rtorrent) rtorrent;;
neomutt) neomutt;;
bash) bash;; bash) bash;;
*) printf "Invalid argument";;
mbsync) mbsync;;
*) printf "Invalid argument\n";;
esac esac

+ 0
- 25
dwm-start Datei anzeigen

@@ -1,25 +0,0 @@
#!/bin/bash
setxkbmap -option ctrl:swapcaps -option tilde:swapescape
source ~/.profile
picom -b
~/.fehbg
xbindkeys -f $HOME/Source/configs/xbindkeysrc

( mru update; mru updatedirs ) &

# relaunch DWM if the binary changes, otherwise bail
csum=$(sha1sum $(which dwm))
new_csum=""
while true
do
if [ "$csum" != "$new_csum" ]
then
csum=$new_csum
dwm-statusbar &
dwm
else
exit 0
fi
new_csum=$(sha1sum $(which dwm))
sleep 0.5
done

+ 15
- 7
prompt Datei anzeigen

@@ -69,8 +69,8 @@ launch() {
Tasks) st -t "Tasks" -e sh -lc taskwarrior-tui;; Tasks) st -t "Tasks" -e sh -lc taskwarrior-tui;;
Page) pages pager "$(printf "1\n2\n3\n" | dmenu -p 'page')";; Page) pages pager "$(printf "1\n2\n3\n" | dmenu -p 'page')";;
Games) games;; Games) games;;
Movie) mpv $(find /mnt/media/movies -name '*.m*' -type f -not -path '*.x/*' |
dmenu -i -c -l 20 -p 'Play');;
Movie) mpv $(find /mnt/media/movies -regex '.*\.m\(kv\)\|\(p.\)$'\
-type f -not -path '*.x/*' | dmenu -i -c -l 20 -p 'Play');;
Multiplexer) st -t "Multiplexer" -e tmux attach-session -t 0 || Multiplexer) st -t "Multiplexer" -e tmux attach-session -t 0 ||
st -t "Multiplexer" -e tmux new-session -s 0;; st -t "Multiplexer" -e tmux new-session -s 0;;
'Go page') num=$(go_page); pages pager $num;; 'Go page') num=$(go_page); pages pager $num;;
@@ -191,7 +191,7 @@ download() {


download_music() { download_music() {
youtube-dl -x --add-metadata --no-progress --audio-format mp3 -o \ youtube-dl -x --add-metadata --no-progress --audio-format mp3 -o \
"$HOME/music/new/%(track)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)"
"/mnt/media/music/new/%(track)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)"


if [ ! $? ]; then if [ ! $? ]; then
youtube-dl -x --add-metadata --no-progress --audio-format mp3 -o \ youtube-dl -x --add-metadata --no-progress --audio-format mp3 -o \
@@ -478,16 +478,24 @@ choose() {
$c "$f" $c "$f"
} }


# It finds all the current files in a known directory without needing to update the mru list of files
# If the directory is chosen instead of the file within it, it opens the directory with nnn
# It finds all the current files in a known directory without needing to update
# the mru list of files If the directory is chosen instead of the file within
# it, it opens the directory with nnn
pick() { pick() {
d=$(mru listdirs | dmenu -i -c -l 20 -p 'from')
d=$(printf "$(find $HOME -maxdepth 3 -not -path '*/.*' -not -name \
'node_modules' -not -name 'vendor'; find /mnt/media -maxdepth 3 -type d \
-not -path '*/.*')" | dmenu -i -c -l 20 -p 'from')

if [ -z "$d" ]; then exit; fi if [ -z "$d" ]; then exit; fi

f=$( f=$(
(printf "$d\n"; find "$d" -type f -not \( -path '*/.*/*' -o -path '*node_modules/*' -o -ipath '*backups/my-plugins*' -o -ipath '*/.uuid' -ipath '*.swp*' \)) |
(printf "$d\n"; find "$d" -type f -not \( -path '*/.*/*' -o -path \
'*node_modules/*' -o -ipath '*/.uuid' -ipath '*.swp*' \)) | \
dmenu -i -c -l 20 -p 'pick file' dmenu -i -c -l 20 -p 'pick file'
) )

if [ -z "$f" ]; then exit; fi if [ -z "$f" ]; then exit; fi

if [ "$d" = "$f" ]; then st -t 'Files' -e sh -lc "nnn '$f'"; exit; fi if [ "$d" = "$f" ]; then st -t 'Files' -e sh -lc "nnn '$f'"; exit; fi
xdg-open "$f" xdg-open "$f"
} }


+ 1
- 1
setup-xbindkeys Datei anzeigen

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh


killall xbindkeys killall xbindkeys
xbindkeys -f $BACKUPS_PATH/configs/xbindkeysrc
xbindkeys -f $HOME/Source/configs/xbindkeysrc

Laden…
Abbrechen
Speichern