Просмотр исходного кода

Add functions to reconfigure applications

master
Immanuel Onyeka 2 лет назад
Родитель
Сommit
fb9a617233
4 измененных файлов: 32 добавлений и 34 удалений
  1. +16
    -1
      configure
  2. +0
    -25
      dwm-start
  3. +15
    -7
      prompt
  4. +1
    -1
      setup-xbindkeys

+ 16
- 1
configure Просмотреть файл

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

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

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

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

rtorrent() {
cp $CONFIGS/.rtorrentrc
}

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

+ 0
- 25
dwm-start Просмотреть файл

@@ -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 Просмотреть файл

@@ -69,8 +69,8 @@ launch() {
Tasks) st -t "Tasks" -e sh -lc taskwarrior-tui;;
Page) pages pager "$(printf "1\n2\n3\n" | dmenu -p 'page')";;
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 ||
st -t "Multiplexer" -e tmux new-session -s 0;;
'Go page') num=$(go_page); pages pager $num;;
@@ -191,7 +191,7 @@ download() {

download_music() {
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
youtube-dl -x --add-metadata --no-progress --audio-format mp3 -o \
@@ -478,16 +478,24 @@ choose() {
$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() {
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

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'
)

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

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


+ 1
- 1
setup-xbindkeys Просмотреть файл

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

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

Загрузка…
Отмена
Сохранить