aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2020-06-17 14:55:02 +0200
committerMarvin Borner2020-06-17 14:55:02 +0200
commit1c3f5aa52d9a2be14831ea11495803df96b90075 (patch)
tree5a20fc78ecc7b9b90c3223de404ba0e42a1c63d9
parentd82ab26a946f004526b368516355b2d28439e1d0 (diff)
Added some .desktop files and functions
-rw-r--r--.bashrc7
-rw-r--r--.local/share/applications/file.desktop4
-rw-r--r--.local/share/applications/img.desktop4
-rw-r--r--.local/share/applications/mail.desktop8
-rw-r--r--.local/share/applications/mimeinfo.cache1
-rw-r--r--.local/share/applications/pdf.desktop4
-rw-r--r--.local/share/applications/text.desktop4
-rw-r--r--.local/share/applications/video.desktop4
-rwxr-xr-x.scripts/preview5
-rw-r--r--README.pdfbin0 -> 17418 bytes
-rwxr-xr-xbackup5
-rw-r--r--packages.txt1
-rwxr-xr-xsync2
13 files changed, 44 insertions, 5 deletions
diff --git a/.bashrc b/.bashrc
index 6286473..69279ef 100644
--- a/.bashrc
+++ b/.bashrc
@@ -42,10 +42,14 @@ alias gi='git init'
alias gs='git status'
alias gc='git commit'
alias ga='git add'
-alias gp='nohup git push --quiet &> /dev/null &'
+alias gp='setsid -f git push --quiet'
alias gd='git diff'
alias gr='git reset'
+# Functions
+disasm() { objdump -drwC -Mintel "$1" | less; }
+disasmc() { objdump -drwC -Mintel --visualize-jumps=color "$1" | less -r; }
+
# Settings
export PS1='[\W] '
export HISTCONTROL=ignoredups
@@ -64,6 +68,7 @@ export UNCRUSTIFY_CONFIG="$HOME/.config/uncrustify.cfg"
export FZF_DEFAULT_COMMAND='rg --files'
export FZF_DEFAULT_OPTS='--bind ctrl-d:half-page-down,ctrl-u:half-page-up'
alias ff='fzf --preview '\''bat --style=numbers --color=always --line-range :500 {}'\'' --bind "enter:execute(nvim {})"'
+alias fp='fzf --preview '\''bat --style=numbers --color=always --line-range :500 {}'\'' --bind "enter:execute(preview {})"'
alias tree='rg --files'
# Superuser customization
diff --git a/.local/share/applications/file.desktop b/.local/share/applications/file.desktop
new file mode 100644
index 0000000..4cf78cf
--- /dev/null
+++ b/.local/share/applications/file.desktop
@@ -0,0 +1,4 @@
+[Desktop Entry]
+Type=Application
+Name=File Manager
+Exec=/usr/local/bin/st -e nnn %u
diff --git a/.local/share/applications/img.desktop b/.local/share/applications/img.desktop
new file mode 100644
index 0000000..42aa81e
--- /dev/null
+++ b/.local/share/applications/img.desktop
@@ -0,0 +1,4 @@
+[Desktop Entry]
+Type=Application
+Name=Image viewer
+Exec=/usr/bin/sxiv -a %f
diff --git a/.local/share/applications/mail.desktop b/.local/share/applications/mail.desktop
new file mode 100644
index 0000000..dddaf2e
--- /dev/null
+++ b/.local/share/applications/mail.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+NoDisplay=true
+Exec=/usr/lib/thunderbird/thunderbird %u
+Name=Thunderbird
+Comment=Custom definition for Thunderbird
diff --git a/.local/share/applications/mimeinfo.cache b/.local/share/applications/mimeinfo.cache
new file mode 100644
index 0000000..7dab7ea
--- /dev/null
+++ b/.local/share/applications/mimeinfo.cache
@@ -0,0 +1 @@
+[MIME Cache]
diff --git a/.local/share/applications/pdf.desktop b/.local/share/applications/pdf.desktop
new file mode 100644
index 0000000..8c38677
--- /dev/null
+++ b/.local/share/applications/pdf.desktop
@@ -0,0 +1,4 @@
+[Desktop Entry]
+Type=Application
+Name=PDF reader
+Exec=/usr/bin/zathura %u
diff --git a/.local/share/applications/text.desktop b/.local/share/applications/text.desktop
new file mode 100644
index 0000000..41ee05f
--- /dev/null
+++ b/.local/share/applications/text.desktop
@@ -0,0 +1,4 @@
+[Desktop Entry]
+Type=Application
+Name=Text editor
+Exec=/usr/local/bin/st -e nvim %u
diff --git a/.local/share/applications/video.desktop b/.local/share/applications/video.desktop
new file mode 100644
index 0000000..857a6fe
--- /dev/null
+++ b/.local/share/applications/video.desktop
@@ -0,0 +1,4 @@
+[Desktop Entry]
+Type=Application
+Name=Video Player
+Exec=/usr/bin/mpv %u
diff --git a/.scripts/preview b/.scripts/preview
index 822e5b0..18173ec 100755
--- a/.scripts/preview
+++ b/.scripts/preview
@@ -1,9 +1,12 @@
#!/usr/bin/env sh
+if [ -z "$1" ]; then exit 1; fi
+
basename="$(echo "$1" | sed 's/\.[^\/.]*$//')"
case "$1" in
-*.tex | *.m[dse] | *.[rR]md | *.mom | *.[0-9]) compile "$1" && setsid -f xdg-open "$basename".pdf >/dev/null 2>&1 ;;
+*.tex | *.m[dse] | *.[rR]md | *.mom | *.[0-9]) compile "$1" && preview "$basename".pdf >/dev/null 2>&1 ;;
*.html) setsid -f "$BROWSER" "$basename".html >/dev/null 2>&1 ;;
*.sent) setsid -f sent "$1" >/dev/null 2>&1 ;;
+*) setsid -f xdg-open "$1" >/dev/null 2>&1 ;;
esac
diff --git a/README.pdf b/README.pdf
new file mode 100644
index 0000000..76f9dc7
--- /dev/null
+++ b/README.pdf
Binary files differ
diff --git a/backup b/backup
index ecfa89a..e5bb7a6 100755
--- a/backup
+++ b/backup
@@ -10,8 +10,8 @@ fi
printf "\033[0;34m"
echo "Cleaning previous configs"
-rm -rf .config/ .repos/ .scripts/ .boilerplates/ .etc/
-mkdir -p .config/{dunst,qutebrowser,gtk-2.0,gtk-3.0,nvim,zathura,mpv,spicetify}/ .etc/X11/xorg.conf.d/ .repos/
+rm -rf .config/ .local/ .repos/ .scripts/ .boilerplates/ .etc/
+mkdir -p .config/{dunst,qutebrowser,gtk-2.0,gtk-3.0,nvim,zathura,mpv,spicetify}/ .local/share/ .etc/X11/xorg.conf.d/ .repos/
echo "Copying configs"
@@ -28,6 +28,7 @@ cp "$HOME"/.config/zathura/zathurarc .config/zathura/
cp "$HOME"/.config/mpv/mpv.conf .config/mpv/
cp "$HOME"/.config/uncrustify.cfg .config/
cp -r "$HOME"/.config/spicetify/{config.ini,Themes/} .config/spicetify/
+cp -r "$HOME"/.local/share/applications/ .local/share/
# Root configs
cp /etc/logid.cfg .etc/
diff --git a/packages.txt b/packages.txt
index bff5bc7..6346c6c 100644
--- a/packages.txt
+++ b/packages.txt
@@ -148,6 +148,7 @@ nerd-fonts-hack
nerd-fonts-source-code-pro
net-tools
nmap
+nnn
nodejs
noto-fonts-emoji
npm
diff --git a/sync b/sync
index d7e0df3..4a7d01c 100755
--- a/sync
+++ b/sync
@@ -41,7 +41,7 @@ for d in ./.repos/*/; do (cd "$d" && sudo make clean install &>/dev/null); done
printf "\033[0;34m"
echo "Copying configs"
printf "\033[0;37m"
-cp -rv .config/ .lein/ .scripts/ .bash_profile .bashrc .xinitrc .Xresources "$HOME"/
+cp -rv .config/ .local/ .lein/ .scripts/ .boilerplates/ .bash_profile .bashrc .xinitrc .Xresources "$HOME"/
sudo cp -rv .etc/* /etc/
printf "\033[0;34m"