Browse Source

Initial commit

master
Albakham 3 months ago
commit
d37e8f946b
Signed by: albakham <dev@geber.ga> GPG Key ID: 6CE390277A579221
100 changed files with 17326 additions and 0 deletions
  1. 2
    0
      .gitignore
  2. 24
    0
      LICENSE
  3. 72
    0
      README.md
  4. 2
    0
      bin/anon
  5. 17
    0
      bin/bonsai
  6. 5
    0
      bin/brightness
  7. 39
    0
      bin/colourbars
  8. 63
    0
      bin/colourblocks
  9. 10
    0
      bin/commit
  10. 6
    0
      bin/faces
  11. 2
    0
      bin/ff
  12. 10
    0
      bin/flac2wav
  13. 10
    0
      bin/generate
  14. 31
    0
      bin/ghosts
  15. 39
    0
      bin/invaders
  16. 20
    0
      bin/kolours
  17. 1
    0
      bin/launcher
  18. 7
    0
      bin/lug
  19. 2
    0
      bin/mansplain
  20. 12
    0
      bin/mkpkg
  21. 10
    0
      bin/name
  22. 50
    0
      bin/nerdy
  23. 24
    0
      bin/panes
  24. 25
    0
      bin/passmenu
  25. 2
    0
      bin/pers
  26. 19
    0
      bin/phone-audio
  27. 5
    0
      bin/png
  28. 10
    0
      bin/proc
  29. 1
    0
      bin/rofi-calc
  30. 248
    0
      bin/rofi-mpd
  31. 864
    0
      bin/rofi-pass
  32. 7
    0
      bin/serve
  33. 9
    0
      bin/shot
  34. 50
    0
      bin/snerdy
  35. 40
    0
      bin/tmux_chooser
  36. 53
    0
      bin/ufetch
  37. 105
    0
      compton/.config/compton.conf
  38. 253
    0
      conky/.config/conky/conky.conf
  39. 257
    0
      dunst/.config/dunst/dunstrc
  40. 10
    0
      dunst/.config/dunst/launch.sh
  41. 1
    0
      fonts/.fonts/.uuid
  42. BIN
      fonts/.fonts/Amnesia.ttf
  43. BIN
      fonts/.fonts/Anurati-Regular.otf
  44. BIN
      fonts/.fonts/ArchitectsDaughter.ttf
  45. BIN
      fonts/.fonts/Better Signature Font.otf
  46. BIN
      fonts/.fonts/Brittanic-Medium.ttf
  47. BIN
      fonts/.fonts/CaviarDreams_BoldItalic.ttf
  48. BIN
      fonts/.fonts/CaviarDreams_Italic.ttf
  49. BIN
      fonts/.fonts/Caviar_Dreams_Bold.ttf
  50. BIN
      fonts/.fonts/Comfortaa-Bold.ttf
  51. BIN
      fonts/.fonts/Comfortaa-Light.ttf
  52. BIN
      fonts/.fonts/Comfortaa-Regular.ttf
  53. BIN
      fonts/.fonts/DrSmith-Regular.otf
  54. 1
    0
      fonts/.fonts/FiraCode/.uuid
  55. BIN
      fonts/.fonts/FiraCode/FiraCode_1.206.zip
  56. BIN
      fonts/.fonts/FiraCode/eot/FiraCode-Bold.eot
  57. BIN
      fonts/.fonts/FiraCode/eot/FiraCode-Light.eot
  58. BIN
      fonts/.fonts/FiraCode/eot/FiraCode-Medium.eot
  59. BIN
      fonts/.fonts/FiraCode/eot/FiraCode-Regular.eot
  60. 43
    0
      fonts/.fonts/FiraCode/fira_code.css
  61. 1
    0
      fonts/.fonts/FiraCode/otf/.uuid
  62. BIN
      fonts/.fonts/FiraCode/otf/FiraCode-Bold.otf
  63. BIN
      fonts/.fonts/FiraCode/otf/FiraCode-Light.otf
  64. BIN
      fonts/.fonts/FiraCode/otf/FiraCode-Medium.otf
  65. BIN
      fonts/.fonts/FiraCode/otf/FiraCode-Regular.otf
  66. BIN
      fonts/.fonts/FiraCode/otf/FiraCode-Retina.otf
  67. 1
    0
      fonts/.fonts/FiraCode/ttf/.uuid
  68. BIN
      fonts/.fonts/FiraCode/ttf/FiraCode-Bold.ttf
  69. BIN
      fonts/.fonts/FiraCode/ttf/FiraCode-Light.ttf
  70. BIN
      fonts/.fonts/FiraCode/ttf/FiraCode-Medium.ttf
  71. BIN
      fonts/.fonts/FiraCode/ttf/FiraCode-Regular.ttf
  72. BIN
      fonts/.fonts/FiraCode/ttf/FiraCode-Retina.ttf
  73. 1
    0
      fonts/.fonts/FiraCode/woff/.uuid
  74. BIN
      fonts/.fonts/FiraCode/woff/FiraCode-Bold.woff
  75. BIN
      fonts/.fonts/FiraCode/woff/FiraCode-Light.woff
  76. BIN
      fonts/.fonts/FiraCode/woff/FiraCode-Medium.woff
  77. BIN
      fonts/.fonts/FiraCode/woff/FiraCode-Regular.woff
  78. BIN
      fonts/.fonts/FiraCode/woff2/FiraCode-Bold.woff2
  79. BIN
      fonts/.fonts/FiraCode/woff2/FiraCode-Light.woff2
  80. BIN
      fonts/.fonts/FiraCode/woff2/FiraCode-Medium.woff2
  81. BIN
      fonts/.fonts/FiraCode/woff2/FiraCode-Regular.woff2
  82. 1
    0
      fonts/.fonts/FontAwesome/.uuid
  83. 4013
    0
      fonts/.fonts/FontAwesome/css/all.css
  84. 5
    0
      fonts/.fonts/FontAwesome/css/all.min.css
  85. 13
    0
      fonts/.fonts/FontAwesome/css/brands.css
  86. 5
    0
      fonts/.fonts/FontAwesome/css/brands.min.css
  87. 3983
    0
      fonts/.fonts/FontAwesome/css/fontawesome.css
  88. 5
    0
      fonts/.fonts/FontAwesome/css/fontawesome.min.css
  89. 14
    0
      fonts/.fonts/FontAwesome/css/regular.css
  90. 5
    0
      fonts/.fonts/FontAwesome/css/regular.min.css
  91. 15
    0
      fonts/.fonts/FontAwesome/css/solid.css
  92. 5
    0
      fonts/.fonts/FontAwesome/css/solid.min.css
  93. 345
    0
      fonts/.fonts/FontAwesome/css/svg-with-js.css
  94. 5
    0
      fonts/.fonts/FontAwesome/css/svg-with-js.min.css
  95. 2166
    0
      fonts/.fonts/FontAwesome/css/v4-shims.css
  96. 5
    0
      fonts/.fonts/FontAwesome/css/v4-shims.min.css
  97. 3756
    0
      fonts/.fonts/FontAwesome/js/all.js
  98. 5
    0
      fonts/.fonts/FontAwesome/js/all.min.js
  99. 516
    0
      fonts/.fonts/FontAwesome/js/brands.js
  100. 0
    0
      fonts/.fonts/FontAwesome/js/brands.min.js

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
nvim/.config/nvim/plugged/
st/

+ 24
- 0
LICENSE View File

@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org>

+ 72
- 0
README.md View File

@@ -0,0 +1,72 @@

```
_____/\\\\\\\\\_______________________________________/\\\\\\_________________________/\\\__________/\\\\______________
___/\\\\\\\\\\\\\____________________________________\////\\\________________________\/\\\_________\///\\______________
__/\\\/////////\\\______________________________________\/\\\_____/\\\_____/\\\______\/\\\__________/\\/_______________
_\/\\\_______\/\\\____/\\\\\__/\\\\\_______/\\\\\_______\/\\\____\///___/\\\\\\\\\\\_\/\\\_________\//_____/\\\\\\\\\\_
_\/\\\\\\\\\\\\\\\__/\\\///\\\\\///\\\___/\\\///\\\_____\/\\\_____/\\\_\////\\\////__\/\\\\\\\\\\_________\/\\\//////__
_\/\\\/////////\\\_\/\\\_\//\\\__\/\\\__/\\\__\//\\\____\/\\\____\/\\\____\/\\\______\/\\\/////\\\________\/\\\\\\\\\\_
_\/\\\_______\/\\\_\/\\\__\/\\\__\/\\\_\//\\\__/\\\_____\/\\\____\/\\\____\/\\\_/\\__\/\\\___\/\\\________\////////\\\_
_\/\\\_______\/\\\_\/\\\__\/\\\__\/\\\__\///\\\\\/____/\\\\\\\\\_\/\\\____\//\\\\\___\/\\\___\/\\\_________/\\\\\\\\\\_
_\///________\///__\///___\///___\///_____\/////_____\/////////__\///______\/////____\///____\///_________\//////////__
__/\\\\\\\\\\\\_______________________________________/\\\\\________/\\\\\\________________________________
_\/\\\////////\\\___________________________________/\\\///________\////\\\________________________________
_\/\\\______\//\\\___________________/\\\__________/\\\_______/\\\____\/\\\________________________________
_\/\\\_______\/\\\_____/\\\\\_____/\\\\\\\\\\\__/\\\\\\\\\___\///_____\/\\\________/\\\\\\\\___/\\\\\\\\\\_
_\/\\\_______\/\\\___/\\\///\\\__\////\\\////__\////\\\//_____/\\\____\/\\\______/\\\/////\\\_\/\\\//////__
_\/\\\_______\/\\\__/\\\__\//\\\____\/\\\_________\/\\\______\/\\\____\/\\\_____/\\\\\\\\\\\__\/\\\\\\\\\\_
_\/\\\_______/\\\__\//\\\__/\\\_____\/\\\_/\\_____\/\\\______\/\\\____\/\\\____\//\\///////___\////////\\\_
_\/\\\\\\\\\\\\/____\///\\\\\/______\//\\\\\______\/\\\______\/\\\__/\\\\\\\\\__\//\\\\\\\\\\__/\\\\\\\\\\_
_\////////////________\/////_________\/////_______\///_______\///__\/////////____\//////////__\//////////__

```
This is just a collection of my dotfiles. I manage them all with [GNU stow](https://www.archlinux.org/packages/community/any/stow/)

There is a setup script in the repo. **Do not use it**. There are like nine lines. It isn't *even* close to finished. If you want to finish it for me, go ahead and open a PR and I'll merge after review! 😁

# Setup

* **distro:** [arch](archlinux.org)
* **GTK theme:** [wal](https://github.com/dylanaraps/pywal/)
* **icon theme:** [sardi-mono](https://aur.archlinux.org/packages/sardi-icons/)
* **terminal:** [kitty](https://sw.kovidgoyal.net/kitty/)
* **shell:** [zsh](https://www.zsh.org/) with [powerlevel10k](https://github.com/romkatv/powerlevel10k)
* **text editor:** [neovim](https://neovim.io/)
* **bar:** [polybar](https://github.com/jaagr/polybar)
* **fonts:** [Fira Code](https://github.com/tonsky/FiraCode/) for polybar, terminal, and rofi and [nerd fonts](https://github.com/ryanoasis/nerd-fonts) for polybar icons
* **wm:** [i3-gaps](https://github.com/Airblader/i3)
* **launcher:** [rofi](https://github.com/DaveDavenport/rofi)
* **lockscreen:** [i3lock-fancy](https://github.com/meskarune/i3lock-fancy)
* **screenshot tool:** [flameshot](https://github.com/lupoDharkael/flameshot)
* **notification daemon:** [dunst](https://dunst-project.org/)
* **file manager:** [ranger](https://github.com/ranger/ranger/)

# Notes
* Credit to my good friend, [Ceda](https://t.me/ceda_ei), for help with the wallpaper and theming script.
* Credit to [jibreil](https://github.com/jibreil/dotfiles) for some of his `/bin` scripts

# Dr. Smith, a custom font

I have developed my own font that is based on my handwriting with a pen. It exceeds the requirements to be an Adobe Western Pro font; it has over 400 characters (not just the English alphabet and punctuation πŸ˜‰) as well as many ligatures so it simulates my handwriting as closely as possible without me following you around and writing on your computer screen. If you don't want to dig into my files, [this](https://gitlab.com/Amolith/dotfiles/blob/master/fonts/.fonts/DrSmith-Regular.otf) will take you to the `.otf`. If you've found something that doesn't work right, *please* open an issue here and I'll get it fixed as soon as I can. I love this font and want it to be the best it can be.

![](screenshots/dr-smith.png)

If you end up using Dr. Smith, please [email](mailto:amolithseregion@protonmail.com) me a screenshot and/or link and, if possible (without ruining the aesthetics), give me credit for my work and link to my [website](http://nixnet.xyz) or [dotfiles](https://git.nixnet.xyz/Amolith/dotfiles)!

# Screenshots

### clean
![](screenshots/1.png)

### vim, bonsai, snerdy, panes
![](screenshots/2.png)

### fullscreen vim with the [Goyo](https://github.com/junegunn/goyo.vim) plugin
![](screenshots/3.png)

### ranger
![](screenshots/4.png)

[Auto-theming i3-gaps on Arch](https://pe.ertu.be/videos/watch/9bab0dd7-13cb-4dbe-a885-e25e70fa50b4)

This is a link to a Peertube video that demonstrates the theming command that Ceda and I wrote. It gives you a random wallpaper and theme based on the wallpaper every time you run it. It also sends a notification telling you the path to the image and whether or not it's in your favourites (`/Pictures/Wallpapers/Favourites`). Once I have the time to write it, I'll add a part that opens a `xenity` window asking if you want to delete it, copy it to your favourites, or do nothing.

+ 2
- 0
bin/anon View File

@@ -0,0 +1,2 @@
cat ~/.anon.asc | xclip -selection clipboard


+ 17
- 0
bin/bonsai View File

@@ -0,0 +1,17 @@
#!/bin/bash
echo -e " \e[32m&&"
echo -e " \e[32m&&&&&"
echo -e " \e[32m&&&\/& &&&"
echo -e " \e[32m&&\e[33m|,/ |/\e[32m& &&"
echo -e " \e[32m&&\e[33m/ / /_\e[32m& &&"
echo -e " \e[33m\ { |_____/_\e[32m&"
echo -e " \e[33m{ / / \e[32m&&&"
echo -e " \e[33m.\`. \\{___\________\/_\}"
echo -e " \e[33m\} \}\{ \\"
echo -e " \e[33m}\{\{ \\____\e[32m&"
echo -e " \e[33m\{\}\{ \`\e[32m&\e[33m\\e[32m&&"
echo -e " \e[33m{{} \e[32m&&"
echo -e " \e[33m, -=-~{ .-^- _"
echo -e " \`}"
echo -e " {"


+ 5
- 0
bin/brightness View File

@@ -0,0 +1,5 @@
#!/bin/bash

old_brightness=$(cat /sys/class/backlight/amdgpu_bl0/brightness)
new_brightness=$(($old_brightness $1))
echo $new_brightness > /sys/class/backlight/amdgpu_bl0/brightness

+ 39
- 0
bin/colourbars View File

@@ -0,0 +1,39 @@
#!/bin/sh
#
# colorbars - smpte color bars in sh
# http://git.io/colorbars

echo

for y in $(seq 0 13); do
printf %s ' '
for color in 7 3 6 2 5 1 4; do
tput setab ${color}
printf %s ' '
done
tput sgr0
echo
done

for y in 0 1; do
printf %s ' '
for color in 4 0 5 0 6 0 7; do
tput setab ${color}
printf %s ' '
done
tput sgr0
echo
done

for y in $(seq 0 4); do
printf %s ' '
for color in 4 4 4 4 4 7 7 7 7 7 5 5 5 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0; do
tput setab ${color}
printf %s ' '
done
tput sgr0
echo
done

echo


+ 63
- 0
bin/colourblocks View File

@@ -0,0 +1,63 @@
#!/bin/bash
# Prints the terminal colors in a line
# Only works with terminals that use .Xdefaults/.Xresources
#
# Created by Dylan Araps
# https://github.com/dylanaraps/dotfiles
# Edited by fullsalvo

number="0"

echo

# This echo is outside of the for loop to manually set it's text color

regular() {

for color in $( xrdb -query | awk '/*color[1-8]:/ {print $2}' ); do
echo -n "$(tput setaf "$number")$(tput smso) $(tput sgr0)"
number=$((number+1))
done

echo
echo

}

bold() {

for color in $( xrdb -query | awk '/*color[1-8]:/ {print $2}' ); do
echo -n "$(tput setaf "$number")$(tput smso) $(tput sgr0)"
number=$((number + 1))
done

echo

for color in $( xrdb -query | awk '/*color[1-8]:/ {print $2}' ); do
echo -n "$(tput setaf "$number")$(tput smso) $(tput sgr0)"
number=$((number + 1))
done

echo
echo

}

usage() {
echo "blocks"
echo " -b: include bold"
}

case $1 in
-b)
bold
;;
-h)
usage
;;
*)
regular
;;
esac



+ 10
- 0
bin/commit View File

@@ -0,0 +1,10 @@
git pull
git add .
git status
echo "###############"
echo "Commit comment:"
echo "###############"
read input
git commit -m "$input"
git push


+ 6
- 0
bin/faces View File

@@ -0,0 +1,6 @@
#!/bin/bash
for i in {1..10000};do
curl https://thispersondoesnotexist.com/image --header "User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0" --output image.jpg
mv image.jpg $i.jpg
sleep 2
done

+ 2
- 0
bin/ff View File

@@ -0,0 +1,2 @@
MOZ_USE_XINPUT2=1 firefox-beta-bin


+ 10
- 0
bin/flac2wav View File

@@ -0,0 +1,10 @@
#!/bin/bash

# recursively convert flac to wav
# with ffmpeg's default settings

IFS=$'\n'
for i in $(find . -type f -name "*.flac"); do
wav=$(echo "$i" | sed "s/.[^./]\+$/.wav/")
ffmpeg -i "$i" wav/"$wav"
done

+ 10
- 0
bin/generate View File

@@ -0,0 +1,10 @@
#!/bin/bash
cd ~/repos/nixnet/
bundle exec jekyll build
python cards.py
cp -r ~/repos/nixnet/.well-known ~/repos/nixnet/_site
ssh server \
"cd /var/www/nixnet.xyz && \
rm -rf *"
rsync -a ~/repos/nixnet/_site/ server:/var/www/nixnet.xyz
notify-send "Website has been updated"

+ 31
- 0
bin/ghosts View File

@@ -0,0 +1,31 @@
#!/bin/bash

# ANSI color scheme script by pfh
# Source: http://crunchbang.org/forums/viewtopic.php?pid=157979#p157979
# Initializing mod by lolilolicon from Archlinux

f=3 b=4
for j in f b; do
for i in {0..7}; do
printf -v $j$i %b "\e[${!j}${i}m"
done
done
bld=$'\e[1m'
rst=$'\e[0m'
inv=$'\e[7m'
cat << EOF

$f1 β–„β–„β–„ $f2 β–„β–„β–„ $f3 β–„β–„β–„ $f4 β–„β–„β–„ $f5 β–„β–„β–„ $f6 β–„β–„β–„
$f1 β–€β–ˆβ–€β–ˆβ–ˆ β–„ $f2 β–€β–ˆβ–€β–ˆβ–ˆ β–„ $f3 β–€β–ˆβ–€β–ˆβ–ˆ β–„ $f4 β–€β–ˆβ–€β–ˆβ–ˆ β–„ $f5 β–€β–ˆβ–€β–ˆβ–ˆ β–„ $f6 β–€β–ˆβ–€β–ˆβ–ˆ β–„
$f1 β–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ $f2 β–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ $f3 β–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ $f4 β–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ $f5 β–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ $f6 β–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€
$f1 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ $f2 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ $f3 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ $f4 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ $f5 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ $f6 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
$f1 β–€β–€β–€β–€β–„ $f2 β–€β–€β–€β–€β–„ $f3 β–€β–€β–€β–€β–„ $f4 β–€β–€β–€β–€β–„ $f5 β–€β–€β–€β–€β–„ $f6 β–€β–€β–€β–€β–„
$bld
$f1 β–„β–„β–„ $f2 β–„β–„β–„ $f3 β–„β–„β–„ $f4 β–„β–„β–„ $f5 β–„β–„β–„ $f6 β–„β–„β–„
$f1 β–€β–ˆβ–€β–ˆβ–ˆ β–„ $f2 β–€β–ˆβ–€β–ˆβ–ˆ β–„ $f3 β–€β–ˆβ–€β–ˆβ–ˆ β–„ $f4 β–€β–ˆβ–€β–ˆβ–ˆ β–„ $f5 β–€β–ˆβ–€β–ˆβ–ˆ β–„ $f6 β–€β–ˆβ–€β–ˆβ–ˆ β–„
$f1 β–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ $f2 β–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ $f3 β–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ $f4 β–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ $f5 β–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ $f6 β–€β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€
$f1 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ $f2 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ $f3 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ $f4 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ $f5 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ $f6 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
$f1 β–€β–€β–€β–€β–„ $f2 β–€β–€β–€β–€β–„ $f3 β–€β–€β–€β–€β–„ $f4 β–€β–€β–€β–€β–„ $f5 β–€β–€β–€β–€β–„ $f6 β–€β–€β–€β–€β–„
$rst
EOF


+ 39
- 0
bin/invaders View File

@@ -0,0 +1,39 @@
#!/usr/bin/env bash

# ANSI color scheme script featuring Space Invaders

# Original: http://crunchbanglinux.org/forums/post/126921/#p126921
# Modified by lolilolicon

f=3 b=4
for j in f b; do
for i in {0..7}; do
printf -v $j$i %b "\e[${!j}${i}m"
done
done
bld=$'\e[1m'
rst=$'\e[0m'

cat << EOF

$f1 β–€β–„ β–„β–€ $f2 β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–„ $f3 β–„β–ˆβ–ˆβ–„ $f4 β–€β–„ β–„β–€ $f5 β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–„ $f6 β–„β–ˆβ–ˆβ–„ $rst
$f1 β–„β–ˆβ–€β–ˆβ–ˆβ–ˆβ–€β–ˆβ–„ $f2β–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆ $f3β–„β–ˆβ–€β–ˆβ–ˆβ–€β–ˆβ–„ $f4 β–„β–ˆβ–€β–ˆβ–ˆβ–ˆβ–€β–ˆβ–„ $f5β–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆ $f6β–„β–ˆβ–€β–ˆβ–ˆβ–€β–ˆβ–„$rst
$f1β–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–ˆ $f2β–€β–€β–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–€β–€ $f3β–€β–ˆβ–€β–ˆβ–ˆβ–€β–ˆβ–€ $f4β–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€β–ˆ $f5β–€β–€β–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆβ–€β–€ $f6β–€β–ˆβ–€β–ˆβ–ˆβ–€β–ˆβ–€$rst
$f1β–€ β–€β–„β–„ β–„β–„β–€ β–€ $f2 β–€β–ˆβ–„ β–€β–€ β–„β–ˆβ–€ $f3β–€β–„ β–„β–€ $f4β–€ β–€β–„β–„ β–„β–„β–€ β–€ $f5 β–€β–ˆβ–„ β–€β–€ β–„β–ˆβ–€ $f6β–€β–„ β–„β–€$rst

$bld$f1β–„ β–€β–„ β–„β–€ β–„ $f2 β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–„ $f3 β–„β–ˆβ–ˆβ–„ $f4β–„ β–€β–„ β–„β–€ β–„ $f5 β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–„ $f6 β–„β–ˆβ–ˆβ–„ $rst
$bld$f1β–ˆβ–„β–ˆβ–€β–ˆβ–ˆβ–ˆβ–€β–ˆβ–„β–ˆ $f2β–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆ $f3β–„β–ˆβ–€β–ˆβ–ˆβ–€β–ˆβ–„ $f4β–ˆβ–„β–ˆβ–€β–ˆβ–ˆβ–ˆβ–€β–ˆβ–„β–ˆ $f5β–ˆβ–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–ˆ $f6β–„β–ˆβ–€β–ˆβ–ˆβ–€β–ˆβ–„$rst
$bld$f1β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ $f2β–€β–€β–€β–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–€β–€β–€ $f3β–€β–€β–ˆβ–€β–€β–ˆβ–€β–€ $f4β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€ $f5β–€β–€β–€β–ˆβ–ˆβ–€β–€β–ˆβ–ˆβ–€β–€β–€ $f6β–€β–€β–ˆβ–€β–€β–ˆβ–€β–€$rst
$bld$f1 β–„β–€ β–€β–„ $f2β–„β–„β–€β–€ β–€β–€ β–€β–€β–„β–„ $f3β–„β–€β–„β–€β–€β–„β–€β–„ $f4 β–„β–€ β–€β–„ $f5β–„β–„β–€β–€ β–€β–€ β–€β–€β–„β–„ $f6β–„β–€β–„β–€β–€β–„β–€β–„$rst


$f7β–Œ$rst

$f7β–Œ$rst

$f7 β–„β–ˆβ–„ $rst
$f7β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„$rst
$f7β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€$rst

EOF


+ 20
- 0
bin/kolours View File

@@ -0,0 +1,20 @@
#!/bin/bash

# dunst has issues with compton while this script runs so . . .
pkill dunst

# Pick a random wallpaper (ignoring anything starting with .) and set the path equal to ${WP}
WP="$(find ~/Images/Wallpapers -not -path '*/\.*' -type f | shuf | head -n1 )"

# Generate a GTK theme/colour scheme
# Apply the colour scheme to terminals
wal -i "$WP" -a 75

# Scale the wallpaper (fixes multi-monitor setups)
feh --bg-scale "$WP"

# restart dunst
dunst

# Send notification with variable defined above
notify-send "Wallpaper Changed to $WP" "$TEXT"

+ 1
- 0
bin/launcher View File

@@ -0,0 +1 @@
~/repos/launcher/launcher

+ 7
- 0
bin/lug View File

@@ -0,0 +1,7 @@
#!/bin/bash
cd ~/repos/lenoirlug.org/
ssh server \
"cd /var/www/lug/dev/ && \
rm -rf *"
rsync -a ~/repos/lenoirlug.org/ --exclude '*git*' server:/var/www/lug/dev/
notify-send "Website has been updated"

+ 2
- 0
bin/mansplain View File

@@ -0,0 +1,2 @@
#!/bin/bash
man -k . | rofi -dmenu -l 30 | awk '{print $1}' | xargs -r man -Tpdf | zathura -

+ 12
- 0
bin/mkpkg View File

@@ -0,0 +1,12 @@
#!/bin/bash
sudo -v; while : ; do sudo -v ; sleep 240 ; done &
mkdir ~/repo
mkdir ~/clones
cd ~/clones
for i in $(pacman -Qmq); do
git clone https://aur.archlinux.org/${i}.git
cd $i
makechrootpkg -c -r $CHROOT
mv *.pkg.tar.xz $HOME/repo/
done


+ 10
- 0
bin/name View File

@@ -0,0 +1,10 @@
#!/bin/bash

# recursively rename files to their
# sha256sum for easier organisation
IFS=$'\n'
for i in $(find . -type f ); do
sha=$(sha256sum "$i" | cut -f1 -d" ")
shaname=$(echo $i | sed "s|/[^/]\+\$|/$sha|")
mv "$i" "$shaname"
done

+ 50
- 0
bin/nerdy View File

@@ -0,0 +1,50 @@
#!/bin/bash

# a system info script written by yours truly
# it's hardcoded stuff, lulz

red="\e[31m"
grn="\e[32m"
ylw="\e[33m"
cyn="\e[36m"
blu="\e[34m"
prp="\e[35m"
bprp="\e[35;1m"
rst="\e[0m"

echo

color-echo()
{ # print with colors
echo -e " $grn$1 $rst$2"
}

# kernel
#color-echo ' kernel' "$(uname -smr)"

# uptime
up=$(</proc/uptime)
up=${up//.*} # string before first . is seconds
days=$((${up}/86400)) # seconds divided by 86400 is days
hours=$((${up}/3600%24)) # seconds divided by 3600 mod 24 is hours
mins=$((${up}/60%60)) # seconds divided by 60 mod 60 is mins

# shell
color-echo 'shell ' 'zsh'

# wm
color-echo 'wm ' 'i3'

# distro
color-echo 'distro ' 'Arch'

# ascii art
echo
echo -e " |⌐ β€’_β€’| Amolith"
echo
# colors
echo -e " $redβ–ͺ$rst $grnβ–ͺ$rst $bluβ–ͺ$rst $ylwβ–ͺ$rst $cynβ–ͺ$rst $prpβ–ͺ$rst $bprpβ–ͺ$rst"

echo
echo


+ 24
- 0
bin/panes View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash

# Author: GekkoP
# Source: http://linuxbbq.org/bbs/viewtopic.php?f=4&t=1656#p33189
f=3 b=4
for j in f b; do
for i in {0..7}; do
printf -v $j$i %b "\e[${!j}${i}m"
done
done
d=$'\e[1m'
t=$'\e[0m'
v=$'\e[7m'
cat << EOF
$f1β–ˆβ–ˆβ–ˆ$dβ–„$t $f2β–ˆβ–ˆβ–ˆ$dβ–„$t $f3β–ˆβ–ˆβ–ˆ$dβ–„$t $f4β–ˆβ–ˆβ–ˆ$dβ–„$t $f5β–ˆβ–ˆβ–ˆ$dβ–„$t $f6β–ˆβ–ˆβ–ˆ$dβ–„$t $f7β–ˆβ–ˆβ–ˆ$dβ–„$t
$f1β–ˆβ–ˆβ–ˆ$dβ–ˆ$t $f2β–ˆβ–ˆβ–ˆ$dβ–ˆ$t $f3β–ˆβ–ˆβ–ˆ$dβ–ˆ$t $f4β–ˆβ–ˆβ–ˆ$dβ–ˆ$t $f5β–ˆβ–ˆβ–ˆ$dβ–ˆ$t $f6β–ˆβ–ˆβ–ˆ$dβ–ˆ$t $f7β–ˆβ–ˆβ–ˆ$dβ–ˆ$t
$f1β–ˆβ–ˆβ–ˆ$dβ–ˆ$t $f2β–ˆβ–ˆβ–ˆ$dβ–ˆ$t $f3β–ˆβ–ˆβ–ˆ$dβ–ˆ$t $f4β–ˆβ–ˆβ–ˆ$dβ–ˆ$t $f5β–ˆβ–ˆβ–ˆ$dβ–ˆ$t $f6β–ˆβ–ˆβ–ˆ$dβ–ˆ$t $f7β–ˆβ–ˆβ–ˆ$dβ–ˆ$t
$d$f1 β–€β–€β–€ $f2β–€β–€β–€ $f3β–€β–€β–€ $f4β–€β–€β–€ $f5β–€β–€β–€ $f6β–€β–€β–€ $f7β–€β–€β–€
EOF


+ 25
- 0
bin/passmenu View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash

shopt -s nullglob globstar

typeit=0
if [[ $1 == "--type" ]]; then
typeit=1
shift
fi

prefix=${PASSWORD_STORE_DIR-~/.password-store}
password_files=( "$prefix"/**/*.gpg )
password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" )

password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")

[[ -n $password ]] || exit

if [[ $typeit -eq 0 ]]; then
pass show -c "$password" 2>/dev/null
else
pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } |
xdotool type --clearmodifiers --file -
fi

+ 2
- 0
bin/pers View File

@@ -0,0 +1,2 @@
cat ~/.pers.asc | xclip -selection clipboard


+ 19
- 0
bin/phone-audio View File

@@ -0,0 +1,19 @@
#!/bin/bash

dir=$"/home/amolith/android/backups/Music/"
IFS=$'\n'

for i in $(find . -type d); do
mkdir -p "$dir""$i"
done

for i in $(find . -type f -name "*.flac"); do
mp3=$(echo "$i" | sed "s/.[^./]\+$/.mp3/")
ffmpeg -i "$i" "$dir""$mp3"
done

for i in $(find . -type f -not -name "*.flac"); do
cp "$i" "$dir""$i"
done

notify-send "Music converted and copied"

+ 5
- 0
bin/png View File

@@ -0,0 +1,5 @@
#!/bin/bash

# convert jpgs to pngs and remove jpgs

ls -1 *.jpg | xargs -n 1 bash -c 'convert "$0" "${0%.jpg}.png"' && rm *.jpg

+ 10
- 0
bin/proc View File

@@ -0,0 +1,10 @@
#!/bin/bash

# process my audio files

IFS=$'\n'
for i in $(find . -maxdepth 1 -type d ); do
cp -r "$i" ../HDD/
mv "$i" ../3\ -\ Tag/
notify-send "\"$i\" has been processed"
done

+ 1
- 0
bin/rofi-calc View File

@@ -0,0 +1 @@
rofi -show calc -modi calc -no-show-match -no-sort

+ 248
- 0
bin/rofi-mpd View File

@@ -0,0 +1,248 @@
#!/bin/bash

#when set to exit, mpd_control will exit if you press escape
#when set to break, mpd_control will go the upper level if possible
ESC_ACTION="break"
# source configuration file for rofi if exists

ROFI="rofi -dmenu -i -p 'Search:'"
PORT="6600"

addaftercurrent(){

#playlist is empty, just add the song
if [ "$(mpc -p $PORT playlist | wc -l)" == "0" ]; then
mpc -p $PORT add "$1"

#there is no current song so mpd is stopped
#it seems to be impossible to determine the current songs' position when
#mpd is stopped, so just add to the end
elif [ -z "$(mpc -p $PORT current)" ]; then
mpc -p $PORT play
CUR_POS=$(mpc -p $PORT | tail -2 | head -1 | awk '{print $2}' | sed 's/#//' | awk -F/ '{print $1}')
END_POS=$(mpc -p $PORT playlist | wc -l)
mpc -p $PORT add "$1"
mpc -p $PORT move $(($END_POS+1)) $(($CUR_POS+1))
mpc -p $PORT stop

#at least 1 song is in the playlist, determine the position of the
#currently played song and add $1 after it
else

CUR_POS=$(mpc -p $PORT | tail -2 | head -1 | awk '{print $2}' | sed 's/#//' | awk -F/ '{print $1}')
END_POS=$(mpc -p $PORT playlist | wc -l)
mpc -p $PORT add "$1"
mpc -p $PORT move $(($END_POS+1)) $(($CUR_POS+1))
fi
}
addaftercurrentandplay(){

#playlist is empty, just add the song
if [ "$(mpc -p $PORT playlist | wc -l)" == "0" ]; then
mpc -p $PORT add "$1"
mpc -p $PORT play

#there is no current song so mpd is stopped
#it seems to be impossible to determine the current songs' position when
#mpd is stopped, so just add to the end
elif [ -z "$(mpc -p $PORT current)" ]; then
mpc -p $PORTplay
CUR_POS=$(mpc -p $PORT | tail -2 | head -1 | awk '{print $2}' | sed 's/#//' | awk -F/ '{print $1}')
END_POS=$(mpc -p $PORT playlist | wc -l)
mpc -p $PORT add "$1"
mpc -p $PORT move $(($END_POS+1)) $(($CUR_POS+1))
mpc -p $PORT play $(($CUR_POS+1))

#at least 1 song is in the playlist, determine the position of the
#currently played song and add $1 after it
else

CUR_POS=$(mpc -p $PORT | tail -2 | head -1 | awk '{print $2}' | sed 's/#//' | awk -F/ '{print $1}')
END_POS=$(mpc -p $PORT playlist | wc -l)
mpc -p $PORT add "$1"
mpc -p $PORT move $(($END_POS+1)) $(($CUR_POS+1))
mpc -p $PORT play $(($CUR_POS+1))
fi
}

case $1 in

-a|--artist)

while true; do

ARTIST="$(mpc -p $PORT list artist | sort -f | $ROFI)";
if [ "$ARTIST" = "" ]; then $ESC_ACTION; fi

while true; do

ALBUMS=$(mpc -p $PORT list album artist "$ARTIST" | sort -f);
ALBUM=$(echo -e "replace all\nadd all\n--------------------------\n$ALBUMS" | $ROFI);
if [ "$ALBUM" = "" ]; then $ESC_ACTION;

elif [ "$ALBUM" = "replace all" ]; then
CUR_SONG=$(mpc -p $PORT current)
mpc -p $PORT clear
mpc -p $PORT find artist "$ARTIST" | mpc -p $PORT add
if [ -n "$CUR_SONG" ]; then mpc -p $PORT play; fi
$ESC_ACTION
elif [ "$ALBUM" = "add all" ]; then
mpc -p $PORT find artist "$ARTIST" | mpc -p $PORT add
$ESC_ACTION
fi

while true; do

TITLES=$(mpc -p $PORT list title artist "$ARTIST" album "$ALBUM")
TITLE=$(echo -e "replace all\nadd all\n--------------------------\n$TITLES" | $ROFI);
if [ "$TITLE" = "" ]; then $ESC_ACTION
elif [ "$TITLE" = "replace all" ]; then
CUR_SONG=$(mpc -p $PORT current)
mpc -p $PORT clear;
mpc -p $PORT find artist "$ARTIST" album "$ALBUM" | mpc -p $PORT add
if [ -n "$CUR_SONG" ]; then mpc -p $PORT play; fi
$ESC_ACTION
elif [ "$TITLE" = "add all" ]; then
mpc -p $PORT find artist "$ARTIST" album "$ALBUM" | mpc -p $PORT add
$ESC_ACTION

fi

while true; do
DEC=$(echo -e "add after current and play\nadd after current\nreplace\nadd at the end" | $ROFI);
case $DEC in

"")
$ESC_ACTION
;;

"add after current and play")
addaftercurrentandplay "$(mpc -p $PORT find artist "$ARTIST" album "$ALBUM" title "$TITLE" | head -1 )"
;;

"add after current")
addaftercurrent "$(mpc -p $PORT find artist "$ARTIST" album "$ALBUM" title "$TITLE" | head -1 )"
;;

"replace")
CUR_SONG=$(mpc -p $PORT current)
mpc -p $PORT clear
mpc -p $PORT find artist "$ARTIST" album "$ALBUM" title "$TITLE" | head -1 | mpc -p $PORT add
if [ -n "$CUR_SONG" ]; then mpc -p $PORT play; fi
;;

"add at the end")
mpc -p $PORT find artist "$ARTIST" album "$ALBUM" title "$TITLE" | head -1 | mpc -p $PORT add
;;

esac
$ESC_ACTION
done
done
done
done
;;

-t|--track)

TITLE=$(mpc -p $PORT list title | sort -f | $ROFI)
if [ "$TITLE" = "" ]; then exit; fi

SONG=$(mpc -p $PORT find title "$TITLE" | head -1)
addaftercurrentandplay "$SONG"
;;

-p|--playlist)
PLAYLIST=$(mpc -p $PORT lsplaylists | $ROFI);
if [ "$PLAYLIST" = "" ]; then exit; fi
CUR_SONG=$(mpc -p $PORT current)
mpc -p $PORT clear
mpc -p $PORT load "$PLAYLIST";
if [ -n "$CUR_SONG" ]; then mpc -p $PORT play; fi
;;

-j|--jump)

TITLE=$(mpc -p $PORT playlist | $ROFI);
if [ "$TITLE" = "" ]; then exit; fi
POS=$(mpc -p $PORT playlist | grep -Fn "$TITLE" | awk -F: '{print $1}')
mpc -p $PORT play $POS;
;;

-l|--longplayer)

while true; do

ALBUM=$(mpc -p $PORT list album | sort -f | $ROFI);
if [ "$ALBUM" = "" ]; then $ESC_ACTION;
fi

while true; do

TITLES=$(mpc -p $PORT list title album "$ALBUM")
TITLE=$(echo -e "replace all\nadd all\n--------------------------\n$TITLES" | $ROFI);
if [ "$TITLE" = "" ]; then $ESC_ACTION
elif [ "$TITLE" = "replace all" ]; then
CUR_SONG=$(mpc -p $PORT current)
mpc -p $PORT clear;
mpc -p $PORT find album "$ALBUM" | mpc -p $PORT add
if [ -n "$CUR_SONG" ]; then mpc -p $PORT play; fi
$ESC_ACTION
elif [ "$TITLE" = "add all" ]; then
mpc -p $PORT find album "$ALBUM" | mpc -p $PORT add
$ESC_ACTION

fi

while true; do
DEC=$(echo -e "add after current and play\nadd after current\nreplace\nadd at the end" | $ROFI);
case $DEC in

"")
$ESC_ACTION
;;

"add after current and play")
addaftercurrentandplay "$(mpc -p $PORT find album "$ALBUM" title "$TITLE" | head -1 )"
;;

"add after current")
addaftercurrent "$(mpc -p $PORT find album "$ALBUM" title "$TITLE" | head -1 )"
;;

"replace")
CUR_SONG=$(mpc -p $PORT current)
mpc -p $PORT clear
mpc -p $PORT find album "$ALBUM" title "$TITLE" | head -1 | mpc -p $PORT add
if [ -n "$CUR_SONG" ]; then mpc -p $PORT play; fi
;;

"add at the end")
mpc -p $PORT find album "$ALBUM" title "$TITLE" | head -1 | mpc -p $PORT add
;;

esac
$ESC_ACTION
done
done
done
;;

-h|--help)
echo "-a, --artist search for artist, then album, then title"
echo "-t, --track search for a single track in the whole database"
echo "-p, --playlist search for a playlist load it"
echo "-j, --jump jump to another song in the current playlist"
echo "-l, --longplayer search for album, then title"




;;

*)
echo "Usage: rofi-mpd [OPTION]"
echo "Try 'rofi-mpd --help' for more information."
;;

esac

+ 864
- 0
bin/rofi-pass View File

@@ -0,0 +1,864 @@
#!/usr/bin/env bash

# rofi-pass
# (c) 2015 Rasmus Steinke <rasi@xssn.at>
basecommand="$0"

# set default settings
_rofi () {
rofi -no-auto-select -i "$@"
}

_image_viewer () {
feh -
}

# We expect to find these fields in pass(1)'s output
URL_field='url'
USERNAME_field='user'
AUTOTYPE_field='autotype'
OTPmethod_field='otp_method'

default_autotype="user :tab pass"
delay=2
wait=0.2
xdotool_delay=12
default_do='menu' # menu, copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl
auto_enter='false'
notify='false'
help_color=""
clip=primary
clip_clear=45
default_user="${ROFI_PASS_DEFAULT_USER-$(whoami)}"
default_user2=john_doe
password_length=12
fix_layout=false

# default shortcuts
autotype="Alt+1"
type_user="Alt+2"
type_pass="Alt+3"
open_url="Alt+4"
copy_name="Alt+u"
copy_url="Alt+l"
copy_pass="Alt+p"
show="Alt+o"
copy_menu="Alt+c"
action_menu="Alt+a"
type_menu="Alt+t"
help="Alt+h"
switch="Alt+x"
insert_pass="Alt+n"
qrcode="Alt+q"
previous_root="Shift+Left"
next_root="Shift+Right"

# Safe permissions
umask 077

has_qrencode() {
command -v qrencode >/dev/null 2>&1
}

# get all password files and create an array
list_passwords() {
cd "${root}" || exit
pw_list=(**/*.gpg)
printf '%s\n' "${pw_list[@]%.gpg}" | sort -n

}

doClip () {
case "$clip" in
"primary") xclip ;;
"clipboard") xclip -selection clipboard;;
"both") xclip; xclip -o | xclip -selection clipboard;;
esac
}

checkIfPass () {
printf '%s\n' "${root}: $selected_password" >| "$HOME/.cache/rofi-pass/last_used"
}


autopass () {
x_repeat_enabled=$(xset q | awk '/auto repeat:/ {print $3}')
xset r off

rm -f "$HOME/.cache/rofi-pass/last_used"
printf '%s\n' "${root}: $selected_password" > "$HOME/.cache/rofi-pass/last_used"
for word in ${stuff["$AUTOTYPE_field"]}; do
case "$word" in
":tab") xdotool key Tab;;
":space") xdotool key space;;
":delay") sleep "${delay}";;
":enter") xdotool key Return;;
":otp") printf '%s' "$(generateOTP)" | xdotool type --delay ${xdotool_delay} --clearmodifiers --file -;;
"pass") printf '%s' "${password}" | xdotool type --delay ${xdotool_delay} --clearmodifiers --file -;;
"path") printf '%s' "${selected_password}" | rev | cut -d'/' -f1 | rev | xdotool type --clearmodifiers --file -;;
*) printf '%s' "${stuff[${word}]}" | xdotool type --delay ${xdotool_delay} --clearmodifiers --file -;;
esac
done

if [[ ${auto_enter} == "true" ]]; then
xdotool key Return
fi

xset r "$x_repeat_enabled"
unset x_repeat_enabled
clearUp
}

generateQrCode() {
has_qrencode

if [[ $? -eq "1" ]]; then
printf '%s\n' "qrencode not found" | _rofi -dmenu
exit_code=$?
if [[ $exit_code -eq "1" ]]; then
exit
else
"${basecommand}"
fi
fi

checkIfPass
pass "$selected_password" | head -n 1 | qrencode -d 300 -v 8 -l H -o - | _image_viewer
if [[ $? -eq "1" ]]; then
printf '%s\n' "" | _rofi -dmenu -mesg "Image viewer not defined or cannot read from pipe"
exit_value=$?
if [[ $exit_value -eq "1" ]]; then
exit
else
"${basecommand}"
fi
fi
clearUp
}

openURL () {
checkIfPass
$BROWSER "$(PASSWORD_STORE_DIR="${root}" pass "$selected_password" | grep "${URL_field}: " | gawk '{sub(/:/,"")}{print $2}1' | head -1)"; exit;
clearUp
}

typeUser () {
checkIfPass

x_repeat_enabled=$(xset q | awk '/auto repeat:/ {print $3}')
xset r off

printf '%s' "${stuff[${USERNAME_field}]}" | xdotool type --delay ${xdotool_delay} --clearmodifiers --file -

xset r "$x_repeat_enabled"
unset x_repeat_enabled

clearUp
}

typePass () {
checkIfPass

x_repeat_enabled=$(xset q | awk '/auto repeat:/ {print $3}')
xset r off

printf '%s' "${password}" | xdotool type --delay ${xdotool_delay} --clearmodifiers --file -

if [[ $notify == "true" ]]; then
if [[ "${stuff[notify]}" == "false" ]]; then
:
else
notify-send "rofi-pass" "finished typing password";
fi
elif [[ $notify == "false" ]]; then
if [[ "${stuff[notify]}" == "true" ]]; then
notify-send "rofi-pass" "finished typing password";
else
:
fi
fi

xset r "$x_repeat_enabled"
unset x_repeat_enabled
clearUp
}

typeField () {
checkIfPass
local to_type

x_repeat_enabled=$(xset q | awk '/auto repeat:/ {print $3}')
xset r off

case $typefield in
"OTP") to_type="$(generateOTP)" ;;
*) to_type="${stuff[${typefield}]}" ;;
esac

printf '%s' "$to_type" | xdotool type --delay ${xdotool_delay} --clearmodifiers --file -

xset r "$x_repeat_enabled"
unset x_repeat_enabled
unset to_type

clearUp
}

generateOTP () {
checkIfPass

# First, we check if there is a non-conventional OTP command in the pass file
if PASSWORD_STORE_DIR="${root}" pass "$selected_password" | grep -q "${OTPmethod_field}: "; then
# We execute the commands after otp_method: AS-IS
bash -c "$(PASSWORD_STORE_DIR="${root}" pass "$selected_password" | grep "${OTPmethod_field}: " | cut -d' ' -f2-)"
else
# If there is no method defined, fallback to pass-otp
PASSWORD_STORE_DIR="${root}" pass otp "$selected_password"
fi

clearUp
}

copyUser () {
checkIfPass
printf '%s' "${stuff[${USERNAME_field}]}" | doClip
clearUp
}

copyField () {
checkIfPass
printf '%s' "${stuff[${copyfield}]}" | doClip
clearUp
}

copyURL () {
checkIfPass
printf '%s' "${stuff[${URL_field}]}" | doClip
clearUp
}

copyPass () {
checkIfPass
printf '%s' "$password" | doClip
if [[ $notify == "true" ]]; then
notify-send "rofi-pass" "Copied Password\\nClearing in $clip_clear seconds"
fi

if [[ $notify == "true" ]]; then
(sleep $clip_clear; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard | notify-send "rofi-pass" "Clipboard cleared") &
elif [[ $notify == "false" ]]; then
(sleep $clip_clear; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard) &
fi
}

viewEntry () {
checkIfPass
showEntry "${selected_password}"
}

generatePass () {
askmenu_content=(
"Yes"
"No")

askGenMenu=$(printf '%s\n' "${askmenu_content[@]}" | _rofi -dmenu -p "Generate new Password for ${selected_password}? > ")
askgen_exit=$?

if [[ $askgen_exit -eq 1 ]]; then
exit
fi
if [[ $askGenMenu == "Yes" ]]; then
true
elif [[ $askGenMenu == "No" ]]; then
actionMenu
fi

checkIfPass

symbols_content=(
"0 Cancel"
"1 Yes"
"2 No")

symbols=$(printf '%s\n' "${symbols_content[@]}" | _rofi -dmenu -p "Use Symbols? > ")
symbols_val=$?

if [[ $symbols_val -eq 1 ]]; then
exit
fi
if [[ $symbols == "0 Cancel" ]]; then
mainMenu;
elif [[ $symbols == "1 Yes" ]]; then
symbols="";
elif [[ $symbols == "2 No" ]]; then
symbols="-n";
fi

HELP="<span color='$help_color'>Enter Number or hit Enter to use default length</span>"
length=$(printf '%s' "" | _rofi -dmenu -mesg "${HELP}" -p "Password length? (Default: ${password_length}) > ")
length_exit=$?

if [[ $length_exit -eq 1 ]]; then
exit
fi
if [[ $length == "" ]]; then
PASSWORD_STORE_DIR="${root}" pass generate ${symbols} -i "$selected_password" "${password_length}" > /dev/null;
else
PASSWORD_STORE_DIR="${root}" pass generate ${symbols} -i "$selected_password" "${length}" > /dev/null;
fi
}

# main Menu
mainMenu () {
if [[ $1 == "--bmarks" ]]; then
selected_password="$(list_passwords 2>/dev/null \
| _rofi -mesg "Bookmarks Mode. ${switch} to switch" \
-dmenu \
-kb-custom-10 "${switch}" \
-select "$entry" \
-p "rofi-pass > ")"

rofi_exit=$?

if [[ $rofi_exit -eq 1 ]]; then
exit
elif [[ $rofi_exit -eq 19 ]]; then
${basecommand}
elif [[ $rofi_exit -eq 0 ]]; then
openURL
fi
else
unset selected_password

args=( -dmenu
-kb-custom-1 "${autotype}"
-kb-custom-2 "${type_user}"
-kb-custom-3 "${type_pass}"
-kb-custom-4 "${open_url}"
-kb-custom-5 "${copy_name}"
-kb-custom-6 "${copy_pass}"
-kb-custom-7 "${show}"
-kb-custom-8 "${copy_url}"
-kb-custom-9 "${type_menu}"
-kb-custom-10 "${previous_root}"
-kb-custom-11 "${next_root}"
-kb-custom-14 "${action_menu}"
-kb-custom-15 "${copy_menu}"
-kb-custom-16 "${help}"
-kb-custom-17 "${switch}"
-kb-custom-18 "${insert_pass}"
-kb-custom-19 "${qrcode}")
args+=(-kb-mode-previous "" # These keyboard shortcut options are needed, because
-kb-mode-next "" # Shift+<Left|Right> are otherwise taken by rofi.
-select "$entry"
-p "> ")

if [[ ${#roots[@]} -gt "1" || $custom_root == "true" ]]; then
args+=(-mesg "PW Store: ${root}")
fi

selected_password="$(list_passwords 2>/dev/null | _rofi "${args[@]}")"

rofi_exit=$?
if [[ $rofi_exit -eq 1 ]]; then
exit
fi

# Actions based on exit code, which do not need the entry.
# The exit code for -kb-custom-X is X+9.
case "${rofi_exit}" in
19) roots_index=$(( (roots_index-1+roots_length) % roots_length)); root=${roots[$roots_index]}; mainMenu; return;;
20) roots_index=$(( (roots_index+1) % roots_length)); root=${roots[$roots_index]}; mainMenu; return;;
25) helpMenu; return;;
26) ${basecommand} --bmarks; return;;
esac

mapfile -t password_temp < <(PASSWORD_STORE_DIR="${root}" pass show "$selected_password")
password=${password_temp[0]}

if [[ ${password} == "#FILE="* ]]; then
pass_file="${password#*=}"
mapfile -t password_temp2 < <(PASSWORD_STORE_DIR="${root}" pass show "${pass_file}")
password=${password_temp2[0]}
fi

fields=$(printf '%s\n' "${password_temp[@]:1}" | awk '$1 ~ /:$/ || /otpauth:\/\// {$1=$1;print}')
declare -A stuff
stuff["pass"]=${password}
if [[ -n $fields ]]; then
while read -r LINE; do
unset _id _val
case "$LINE" in
"otpauth://"*|"${OTPmethod_field}"*)
_id="OTP"
_val=""
;;
*)
_id="${LINE%%: *}"
_val="${LINE#* }"
;;
esac

if [[ -n "$_id" ]]; then
stuff["${_id}"]=${_val}
fi
done < <(printf '%s\n' "${fields}")

if test "${stuff['autotype']+autotype}"; then
:
else
stuff["autotype"]="${USERNAME_field} :tab pass"
fi
fi
fi

if [[ -z "${stuff["${AUTOTYPE_field}"]}" ]]; then
if [[ -n $default_autotype ]]; then
stuff["${AUTOTYPE_field}"]="${default_autotype}"
fi
fi
if [[ -z "${stuff["${USERNAME_field}"]}" ]]; then
if [[ -n $default_user ]]; then
if [[ "$default_user" == ":filename" ]]; then
stuff["${USERNAME_field}"]="$(basename $selected_password)"
else
stuff["${USERNAME_field}"]="${default_user}"
fi
fi
fi
pass_content="$(for key in "${!stuff[@]}"; do printf '%s\n' "${key}: ${stuff[$key]}"; done)"

# actions based on keypresses
# The exit code for -kb-custom-X is X+9.
case "${rofi_exit}" in
0) typeMenu;;
10) sleep $wait; autopass;;
11) sleep $wait; typeUser;;
12) sleep $wait; typePass;;
13) openURL;;
14) copyUser;;
15) copyPass;;
16) viewEntry;;
17) copyURL;;
18) default_do="menu" typeMenu;;
23) actionMenu;;
24) copyMenu;;
27) insertPass;;
28) generateQrCode;;
esac
clearUp
}


clearUp () {
password=''
selected_password=''
unset stuff
unset password
unset selected_password
unset password_temp
unset stuff
}

helpMenu () {
printf '%s' "${autotype}: Autotype
${type_user}: Type Username
${type_pass}: Type Password
${qrcode}: Generate and display qrcode
---
${copy_name}: Copy Username
${copy_pass}: Copy Password
${copy_url}: Copy URL
${open_url}: Open URL
${copy_menu}: Copy Custom Field
---
${action_menu}: Edit, Move, Delete, Re-generate Submenu
${show}: Show Password File
${insert_pass}: Insert new Pass Entry
${switch}: Switch Pass/Bookmark Mode
---
${previous_root}: Switch to previous password store (--root)
${next_root}: Switch to next password store (--root)
" | _rofi -dmenu -mesg "Hint: All hotkeys are configurable in config file" -p "Help > "
help_val=$?

if [[ $help_val -eq 1 ]]; then
exit;
else
unset helptext; mainMenu;
fi
}


typeMenu () {
if [[ -n $default_do ]]; then
if [[ $default_do == "menu" ]]; then
checkIfPass
local -a keys=("${!stuff[@]}")
keys=("${keys[@]/$AUTOTYPE_field}")
typefield=$({ printf '%s' "${AUTOTYPE_field}" ; printf '%s\n' "${keys[@]}" | sort; } | _rofi -dmenu -p "Choose Field to type > ")
typefield_exit=$?
if [[ $typefield_exit -eq 1 ]]; then
exit
fi
case "$typefield" in
'') exit;;
'pass') sleep $wait; typePass;;
"${AUTOTYPE_field}") sleep $wait; autopass;;
*) sleep $wait; typeField
esac
clearUp
elif [[ $default_do == "${AUTOTYPE_field}" ]]; then
sleep $wait; autopass
else
${default_do}
fi
fi
}

copyMenu () {
checkIfPass
copyfield=$(printf '%s\n' "${!stuff[@]}" | sort | _rofi -dmenu -p "Choose Field to copy > ")
val=$?
if [[ $val -eq 1 ]]; then
exit;
fi
if [[ $copyfield == "pass" ]]; then
copyPass;
else
copyField
fi
clearUp
}

actionMenu () {
checkIfPass
action_content=("< Return"
"---"
"1 Move Password File"
"2 Copy Password File"
"3 Delete Password File"
"4 Edit Password File"
"5 Generate New Password")

action=$(printf '%s\n' "${action_content[@]}" | _rofi -dmenu -p "Choose Action > ")
if [[ ${action} == "1 Move Password File" ]]; then
manageEntry move;
elif [[ ${action} == "3 Delete Password File" ]]; then
manageEntry delete;
elif [[ ${action} == "2 Copy Password File" ]]; then
manageEntry copy;
elif [[ ${action} == "4 Edit Password File" ]]; then
manageEntry edit;
elif [[ ${action} == "5 Generate New Password" ]]; then
generatePass;
elif [[ ${action} == "< Return" ]]; then
mainMenu;
elif [[ ${action} == "" ]]; then
exit
fi
}

showEntry () {
if [[ -z $pass_content ]]; then
pass_temp=$(PASSWORD_STORE_DIR="${root}" pass show "$selected_password")
password="${pass_temp%%$'\n'*}"
pass_key_value=$(printf '%s\n' "${pass_temp}" | tail -n+2 | grep ': ')
declare -A stuff

while read -r LINE; do
_id="${LINE%%: *}"
_val="${LINE#* }"
stuff["${_id}"]=${_val}
done < <(printf '%s\n' "${pass_key_value}")

stuff["pass"]=${password}

if test "${stuff['autotype']+autotype}"; then
:
else
stuff["autotype"]="${USERNAME_field} :tab pass"
fi

pass_content="$(for key in "${!stuff[@]}"; do printf '%s\n' "${key}: ${stuff[$key]}"; done)"
fi

bla_content=("< Return"
"${pass_content}")

bla=$(printf '%s\n' "${bla_content[@]}" | _rofi -dmenu -mesg "Enter: Copy entry to clipboard" -p "> ")
rofi_exit=$?

word=$(printf '%s' "$bla" | gawk -F': ' '{print $1}')

if [[ ${rofi_exit} -eq 1 ]]; then
exit
elif [[ ${rofi_exit} -eq 0 ]]; then
if [[ ${bla} == "< Return" ]]; then
mainMenu
else
if [[ -z $(printf '%s' "${stuff[${word}]}") ]]; then
printf '%s' "$word" | doClip
else
printf '%s' "${stuff[${word}]}" | doClip
fi
if [[ $notify == "true" ]]; then
notify-send "rofi-pass" "Copied Password\\nClearing in $clip_clear seconds"
fi
if [[ $notify == "true" ]]; then
(sleep $clip_clear; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard | notify-send "rofi-pass" "Clipboard cleared") &
elif [[ $notify == "false" ]]; then
(sleep $clip_clear; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard) &
fi
exit
fi
fi
exit
unset stuff
unset password
unset selected_password
unset password_temp
unset stuff
exit
}

manageEntry () {
if [[ "$1" == "edit" ]]; then
EDITOR=$EDITOR PASSWORD_STORE_DIR="${root}" pass edit "${selected_password}"
mainMenu
elif [[ $1 == "move" ]]; then
cd "${root}" || exit
group_array=(*/)
group=$(printf '%s\n' "${group_array[@]%/}" | _rofi -dmenu -p "Choose Group > ")
if [[ $group == "" ]]; then
exit
fi
PASSWORD_STORE_DIR="${root}" pass mv "$selected_password" "${group}"
mainMenu
elif [[ $1 == "copy" ]]; then
cd "${root}" || exit
group_array=(*/)
group=$(printf '%s\n' "${group_array[@]%/}" | _rofi -dmenu -p "Choose Group > ")
if [[ $group == "" ]]; then
exit
else
new_name="$(listgpg | _rofi -dmenu -format 'f' -mesg "Copying to same Group. Please enter a name for the new entry" -p "> ")"
fi
PASSWORD_STORE_DIR="${root}" pass cp "$selected_password" "${group}/${new_name}"
mainMenu
elif [[ "$1" == "delete" ]]; then
HELP="<span color='$help_color'>Selected entry: ${selected_password}</span>"
ask_content=("Yes"
"No")
ask=$(printf '%s\n' "${ask_content[@]}" | _rofi -mesg "${HELP}" -dmenu -p "Are You Sure? > ")
if [[ "$ask" == "Yes" ]]; then
PASSWORD_STORE_DIR="${root}" pass rm --force "${selected_password}"
elif [[ "$ask" == "No" ]]; then
mainMenu
elif [[ -z "$ask" ]]; then
exit
fi
else
mainMenu
fi
}

listgpg () {
pw_list=(**/*.gpg)
printf '%s\n' "${pw_list[@]}" | sort -n
}

insertPass () {
url=$(xclip --selection clipboard -o)

if [[ "${url:0:4}" == "http" ]]; then
domain_name="$(printf '%s\n' "${url}" | awk -F / '{l=split($3,a,"."); print (a[l-1]=="com"?a[l-2] OFS:X) a[l-1] OFS a[l]}' OFS=".")"
help_content="Domain: ${domain_name}
Type name, make sure it is unique"
else
help_content="Hint: Copy URL to clipboard before calling this menu.
Type name, make sure it is unique"
fi

cd "${root}" || exit
group_array=(*/)
grouplist=$(printf '%s\n' "${group_array[@]%/}")
name="$(listgpg | _rofi -dmenu -format 'f' -filter "${domain_name}" -mesg "${help_content}" -p "> ")"
val=$?

if [[ $val -eq 1 ]]; then
exit
fi

user_content=("${default_user2}"
"${USER}"
"${default_user}")

user=$(printf '%s\n' "${user_content[@]}" | _rofi -dmenu -mesg "Chose Username or type" -p "> ")
val=$?

if [[ $val -eq 1 ]]; then
exit
fi

group_content=("No Group"
"---"
"${grouplist}")

group=$(printf '%s\n' "${group_content[@]}" | _rofi -dmenu -p "Choose Group > ")
val=$?

if [[ $val -eq 1 ]]; then
exit
fi

pw=$(printf '%s' "Generate" | _rofi -dmenu -p "Password > " -mesg "Type Password or hit Enter to generate one")

if [[ $pw == "Generate" ]]; then
pw=$(_pwgen "${password_length}")
fi

clear

if [[ "$group" == "No Group" ]]; then
if [[ $url == http* ]]; then
pass_content=("${pw}"
"---"
"${USERNAME_field}: ${user}"
"${URL_field}: ${url}")
printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${name}" > /dev/null && PASSWORD_STORE_DIR="${root}" pass edit "${name}"
else
pass_content=("${pw}"
"---"
"${USERNAME_field}: ${user}")
printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${name}" > /dev/null && PASSWORD_STORE_DIR="${root}" pass edit "${name}"
fi
else
if [[ $url == http* ]]; then
pass_content=("${pw}"
"---"
"${USERNAME_field}: ${user}"
"${URL_field}: ${url}")
printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${group}/${name}" > /dev/null && PASSWORD_STORE_DIR="${root}" pass edit "${group}/${name}"
else
pass_content=("${pw}"
"---"
"${USERNAME_field}: ${user}")
printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${group}/${name}" > /dev/null
if [[ $edit_new_pass == "true" ]]; then
PASSWORD_STORE_DIR="${root}" pass edit "${group}/${name}"
fi
fi
fi
}

help_msg () {
cat <<'EOF'
Usage:
rofi-pass [command]

Commands:
--insert insert new entry to password store
--root set custom root directories (colon separated)
--last-used highlight last used item
--show-last show details of last used Entry
--bmarks start in bookmarks mode

rofi-pass version 1.5.3
EOF
}

get_config_file () {
configs=("$ROFI_PASS_CONFIG"
"$HOME/.config/rofi-pass/config"
"/etc/rofi-pass.conf")

# return the first config file with a valid path
for config in "${configs[@]}"; do
# '! -z' is needed in case ROFI_PASS_CONFIG is not set
if [[ ! -z "${config}" && -f "${config}" ]]; then
printf "%s" "$config"
return
fi
done
}

main () {
# enable extended globbing
shopt -s nullglob globstar

# load config file
config_file="$(get_config_file)"
[[ ! -z "$config_file" ]] && source "$config_file"

# create tmp dir
if [[ ! -d "$HOME/.cache/rofi-pass" ]]; then
mkdir "$HOME/.cache/rofi-pass"
fi

# fix keyboard layout if enabled in config
if [[ $fix_layout == "true" ]]; then
layout_cmd
fi

# set help color
if [[ $help_color == "" ]]; then
help_color=$(rofi -dump-xresources | grep 'rofi.color.normal' | gawk -F ',' '/,/{gsub(/ /, "", $2); print $2}')
fi

# check for BROWSER variable, use xdg-open as fallback
if [[ -z $BROWSER ]]; then
export BROWSER=xdg-open
fi

# check if alternative root directory was given on commandline
if [[ -r "$HOME/.cache/rofi-pass/last_used" ]] && [[ $1 == "--last-used" || $1 == "--show-last" ]]; then
roots=("$(awk -F ': ' '{ print $1 }' "$HOME/.cache/rofi-pass/last_used")")
elif [[ -n "$2" && "$1" == "--root" ]]; then
custom_root=true; IFS=: read -r -a roots <<< "$2"
elif [[ -n $root ]]; then
custom_root=true; IFS=: read -r -a roots <<< "${root}"
elif [[ -n ${PASSWORD_STORE_DIR} ]]; then
roots=("${PASSWORD_STORE_DIR}")
else
roots=("$HOME/.password-store")
fi
roots_index=0
roots_length=${#roots[@]}
export root=${roots[$roots_index]}
export PASSWORD_STORE_DIR="${root}"
case $1 in
--insert)
insertPass
;;
--root)
mainMenu
;;
--help)
help_msg
;;
--last-used)
if [[ -r "$HOME/.cache/rofi-pass/last_used" ]]; then
entry="$(awk -F ': ' '{ print $2 }' "$HOME/.cache/rofi-pass/last_used")"
fi
mainMenu
;;
--show-last)
if [[ -r "$HOME/.cache/rofi-pass/last_used" ]]; then
selected_password="$(awk -F ': ' '{ print $2 }' "$HOME/.cache/rofi-pass/last_used")" viewEntry
else
mainMenu
fi
;;
--bmarks)
mainMenu --bmarks;
;;
*)
mainMenu
;;
esac
}

main "$@"


+ 7
- 0
bin/serve View File

@@ -0,0 +1,7 @@
#!/bin/bash
dir=${pwd}
ssh server \
"cd /var/www/'$dir' && \
rm -rf *"
rsync -a ~/repos/nixnet/_site/ server:/var/www/nixnet.xyz
notify-send "Website has been updated"

+ 9
- 0
bin/shot View File

@@ -0,0 +1,9 @@

#!/usr/bin/env bash

tmp_file=$(mktemp)
flameshot gui -p /home/amolith/Pictures/Screenshots/ -r > $tmp_file
convert $tmp_file -distort SRT 1.4 10 - | xclip -selection clipboard -t image/png



+ 50
- 0
bin/snerdy View File

@@ -0,0 +1,50 @@
#!/bin/bash

# a system info script written by yours truly
# it's hardcoded stuff, lulz

red="\e[31m"
grn="\e[32m"
ylw="\e[33m"
cyn="\e[36m"
blu="\e[34m"
prp="\e[35m"
bprp="\e[35;1m"
rst="\e[0m"

echo

color-echo()
{ # print with colors
echo -e " $grn$1 $rst$2"
}

# kernel
#color-echo 'kernel ' "$(uname -smr)"

# uptime
up=$(</proc/uptime)
up=${up//.*} # string before first . is seconds
days=$((${up}/86400)) # seconds divided by 86400 is days
hours=$((${up}/3600%24)) # seconds divided by 3600 mod 24 is hours
mins=$((${up}/60%60)) # seconds divided by 60 mod 60 is mins

# shell
color-echo 'shell ' 'zsh'

# wm
color-echo 'wm ' 'i3-gaps'

# distro
color-echo 'distro ' 'Arch'

# art
#echo
#echo -e " |⌐ β€’_β€’| Jibreil"

echo

# colors
echo -e " $redβ–ͺ$rst $grnβ–ͺ$rst $bluβ–ͺ$rst $ylwβ–ͺ$rst $cynβ–ͺ$rst $prpβ–ͺ$rst $bprpβ–ͺ$rst"

echo

+ 40
- 0
bin/tmux_chooser View File

@@ -0,0 +1,40 @@
#!/usr/bin/bash
function ctrl_c() {
echo -e "\renter nil to drop to normal prompt"
}

trap ctrl_c SIGINT

no_of_terminals=$(tmux list-sessions | wc -l)
output=`tmux list-sessions`
IFS=$'\n'
k=1
echo "Choose the terminal to attach: "
for i in $output; do
echo "$k - $i"
((k++))
done
echo
echo "Create a new session by entering a name for it"
check_var=0
read -r input
for i in `seq 1 $no_of_terminals`; do
if [[ $i -eq $input ]]; then
check_var=1
terminal_name=$(tmux list-sessions -F\#S | head -n $input | tail -n 1)
tmux attach -t $terminal_name
exit 0
fi
done

if [[ $check_var -eq 0 ]]; then
if [[ $input == "" ]]; then
tmux new-session
elif [[ $input == 'nil' ]]; then
exit 1
elif [[ $input == 'x' ]]; then
exit 2
else
tmux new-session -s $input
fi
fi

+ 53
- 0
bin/ufetch View File

@@ -0,0 +1,53 @@
#!/bin/sh
#
# ufetch-arch - tiny system info for arch linux
#

## INFO

# user is already defined
hostname="$(hostname)"
os='Arch Linux'
kernel="$(uname -sr)"
uptime="$(uptime -p | sed 's/up //')"
packages="$(pacman -Q | wc -l)"
shell="$(basename ${SHELL})"
if [ -z "${WM}" ]; then
WM="$(tail -n 1 "${HOME}/.xinitrc" | cut -d ' ' -f 2)"
fi

## DEFINE COLORS

# probably don't change these
bc="$(tput bold)" # bold
c0="$(tput setaf 0)" # black
c1="$(tput setaf 1)" # red
c2="$(tput setaf 2)" # green
c3="$(tput setaf 3)" # yellow
c4="$(tput setaf 4)" # blue
c5="$(tput setaf 5)" # magenta
c6="$(tput setaf 6)" # cyan
c7="$(tput setaf 7)" # white
rc="$(tput sgr0)" # reset

# you can change these
lc="${rc}${bc}${c6}" # labels
nc="${rc}${bc}${c6}" # user and hostname
ic="${rc}${bc}${c7}" # info
fc="${rc}${bc}${c6}" # first color
sc="${rc}${c6}" # second color

## OUTPUT

cat <<EOF

${fc} /\ ${nc}${USER}${ic}@${nc}${hostname}${rc}
${fc} /^^\ ${lc}OS: ${ic}${os}${rc}
${fc} /\ \ ${lc}KERNEL: ${ic}${kernel}${rc}
${fc} / ${sc}__ \ ${lc}UPTIME: ${ic}${uptime}${rc}
${sc} / ( ) \ ${lc}PACKAGES: ${ic}${packages}${rc}
${sc} / __| |__\\\\ ${lc}SHELL: ${ic}${shell}${rc}
${sc} /// \\\\\ ${lc}WM: ${ic}${WM}${rc}

EOF


+ 105
- 0
compton/.config/compton.conf View File

@@ -0,0 +1,105 @@
backend = "glx";
fading = true;
fade-in-step = 0.08;
fade-out-step = 0.08;
dbe = false;
unredir-if-possible = true;
detect-transient = true;
detect-client-opacity = true;
glx-copy-from-front = false;
glx-no-rebind-pixmap = true;
glx-no-stencil = true;
glx-swap-method = "undefined";
glx-use-gpushader4 = true;
mark-wmwin-focused = true;
paint-on-overlay = true;
use-ewmh-active-win = true;
vsync = "opengl-swc";
shadow = true;
clear-shadow = true;
no-dnd-shadow = true;
no-dock-shadow = true;
shadow-ignore-shaped = true;
shadow-offset-x = -8;
shadow-offset-y = -8;
shadow-opacity = 1.0;
shadow-radius = 9;
menu-opacity = 1;
inactive-opacity = 0.8;
active-opacity = 1;
frame-opacity = 0.4;
inactive-opacity-override = false;
alpha-step = 0.06;
#opacity-rule = [ "40:class_g = 'rofi'"
# Dim inactive windows. (0.0 - 1.0)
inactive-dim = 0.2;
# Do not let dimness adjust based on window opacity.
inactive-dim-fixed = true;
# Available options: 5x5box, 7x7box, 3x3gaussian, 5x5gaussian, 7x7gaussian, 9x9gaussian y 11x11gaussian.
#blur-kern = "9x9gaussian";
blur-method = "kawase";
blur-strength = 5;
#
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
blur-background = true;
# Blur background of opaque windows with transparent frames as well.
blur-background-frame = true;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
shadow-exclude = [
"class_g *= 'Rofi'",
"class_i *= 'tray'",
"class_i *= 'conky'",
"class_g *= 'Compton'",
"class_g *= 'compton'",
"class_g *= 'conky'",
"class_g = 'Chromium' && argb",
"class_g = 'Firefox' && argb",
"class_g ?= 'maim'",
#"!focused",
"fullscreen",
"width >= 1920",
"window_type *= 'normal' && ! name ~= ''"
];
focus-exclude = [
"name *= 'rofi'",
"class_i = 'Popup'",
"class_g = 'mpv'"
];
blur-background-exclude = [
"window_type = 'desktop'",
"class_i *= 'tray'",
"class_g = 'conky'",
"class_g = 'GLava'",
"class_g ?= 'maim'",
"class_g ?= 'slop'",
"class_g = 'vlc'",
"class_g = 'plexmediaplayer'"
];
fade-exclude = [
"width >= 1920",
"fullscreen"
];
opacity-rule = [
"80:class_g = 'Termite'",
"80:class_g = 'Rofi'",
"80:class_g = 'Polybar'",
"99:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_FULLSCREEN'",
"99:_NET_WM_STATE@[1]:32a = '_NET_WM_STATE_FULLSCREEN'",
"99:_NET_WM_STATE@[2]:32a = '_NET_WM_STATE_FULLSCREEN'",
"99:_NET_WM_STATE@[3]:32a = '_NET_WM_STATE_FULLSCREEN'",
"99:_NET_WM_STATE@[4]:32a = '_NET_WM_STATE_FULLSCREEN'",
];

+ 253
- 0
conky/.config/conky/conky.conf View File

@@ -0,0 +1,253 @@
conky.config = {

-------------------------------------
-- Generic Settings
-------------------------------------
background=true,
update_interval=1,
double_buffer=true,
no_buffers=true,
imlib_cache_size=10,

draw_shades=false,
draw_outline=false,
draw_borders=false,
draw_graph_borders=false,
default_graph_height=26,
default_graph_width=80,
show_graph_scale=false,
show_graph_range=false,


-------------------------------------
-- Window Specifications
-------------------------------------
gap_x=1100,
gap_y=70,
minimum_height=620,
minimum_width=268,
own_window=true,
own_window_class=Conky,
own_window_type="override",
own_window_transparent=true,
own_window_hints="undecorated,below,sticky,skip_taskbar,skip_pager",
border_inner_margin=0,
border_outer_margin=0,
--alignment="middle_middle",
--own_window_argb_visual=true,
--own_window_argb_value=0,


-------------------------------------
-- Text Settings
-------------------------------------
use_xft=true,
xftalpha=1,
font="Droid Sans:size=8",
text_buffer_size=256,
override_utf8_locale=true,

short_units=true,
short_units=true,
pad_percents=2,
top_name_width=7,


-------------------------------------
-- Color Scheme
-------------------------------------
default_color="DCDCDC",
color1="DCDCDC",
color2="DCDCDC",
color3="DCDCDC",
color4="F9F9F9",
color5="D64937",
color6="888888",
color7="484848",
color8="2D2D2D",


-------------------------------------
-- API Key
-------------------------------------
template6="2e02964a519b8d7a2ca53d3166263d8c",


-------------------------------------
-- City ID
-------------------------------------
template7="2973385",


-------------------------------------
-- Temp Unit (default, metric, imperial)
-------------------------------------
template8="metric",


-------------------------------------
-- Locale (e.g. "es_ES.UTF-8")
-- Leave empty for default
-------------------------------------
template9=""

}


---------------------------------------------------
---------------------------------------------------


conky.text = [[
\
\
${execi 300 ~/.harmattan-assets/get_weather ${template6} ${template7} ${template8} ${template9}}\
\
\
\
\
\
${image ~/.harmattan-assets/misc/Numix/God-Mode/top-bg.png -p 20,30 -s 228x61}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/bottom-bg.png -p 20,473 -s 228x119}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/border.png -p 20,91 -s 228x86}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/fav-color.png -p 20,91 -s 228x86}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/bg-1.png -p 20,177 -s 228x86}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/bg-2.png -p 20,263 -s 228x105}\
${image ~/.harmattan-assets/misc/Numix/God-Mode/bg-3.png -p 20,368 -s 228x105}\