This commit is contained in:
Dr. Amr Osman 2019-03-05 17:19:18 +02:00
parent d3ea9e2eab
commit 6a498b98ca
22 changed files with 308 additions and 49 deletions

42
.config/compton.conf Normal file
View File

@ -0,0 +1,42 @@
# basic configuration
backend = "glx";
glx-no-stencil = true;
vsync = "opengl-swc"
glx-swap-method = 1;
xrender-sync-fence = true;
mark-ovredir-focused = true;
inactive-opacity = 0.9
opacity = 0.9;
# transparancy settings for i3
opacity-rule = [
"0:_NET_WM_STATE@:32a *=
'_NET_WM_STATE_HIDDEN'"
];
shadow-exclude = [
"name = 'Notification'",
"name *= 'compton'",
"class_g = 'Firefox'",
"class_g = 'Conky'",
"class_g = 'Vlc'",
"class_g = 'tor-browser-en'"
];
fade-exclude = [
"class_g = 'Firefox'",
"class_g = 'tor-browser-en'"
];
focus-exclude = [
"class_g = 'Firefox'",
"class_g = 'tor-browser-en'"
];
opacity-exclude = [
"class_g = 'Firefox'"
"class_g = 'tor-browser-en'"
"class_g = 'mpv'"
"class_g = 'mpvfloat'"
];

View File

@ -19,9 +19,11 @@
# #---Basic Definitions---# # # #---Basic Definitions---# #
# Needed for i3-gaps # Needed for i3-gaps
for_window [class="^.*"] border pixel 2 #new_window normal
gaps inner 15 for_window [class="^.*"] border pixel 3
gaps outer 15 for_window [class="mpv"] floating enable
gaps inner 5
gaps outer 5
set $term --no-startup-id $TERMINAL set $term --no-startup-id $TERMINAL
set $mod Mod4 set $mod Mod4
set $stoprec --no-startup-id dmenurecord kill set $stoprec --no-startup-id dmenurecord kill
@ -29,6 +31,7 @@ set $shutdown sudo -A shutdown -h now
set $reboot sudo -A reboot set $reboot sudo -A reboot
set $netrefresh --no-startup-id sudo -A systemctl restart NetworkManager set $netrefresh --no-startup-id sudo -A systemctl restart NetworkManager
set $hibernate sudo -A systemctl suspend set $hibernate sudo -A systemctl suspend
floating_modifier $mod
# #---Dropdown Windows---# # # #---Dropdown Windows---# #
@ -44,6 +47,9 @@ for_window [instance="dropdown_dropdowncalc"] border pixel 2
for_window [instance="dropdown_*"] move position center for_window [instance="dropdown_*"] move position center
# #---Starting External Scripts---# # # #---Starting External Scripts---# #
#lock
exec --no-startup-id lockr
#-e -f -c 1d2021
# mpd startup # mpd startup
exec --no-startup-id mpd exec --no-startup-id mpd
# Setting the background: # Setting the background:
@ -51,7 +57,8 @@ exec --no-startup-id setbg
# Starts dunst for notifications: # Starts dunst for notifications:
exec --no-startup-id dunst exec --no-startup-id dunst
# Composite manager: # Composite manager:
exec --no-startup-id xcompmgr exec --no-startup-id compton --config ~/.config/compton.conf -b
#exec --no-startup-id xcompmgr
# Runs the key remapping scripts # Runs the key remapping scripts
exec --no-startup-id remaps exec --no-startup-id remaps
# Unclutter makes the mouse invisible after a brief period # Unclutter makes the mouse invisible after a brief period
@ -60,9 +67,50 @@ exec --no-startup-id unclutter
exec_always --no-startup-id mpdupdate exec_always --no-startup-id mpdupdate
# Podboat automatic queue and download # Podboat automatic queue and download
exec_always --no-startup-id podentr exec_always --no-startup-id podentr
# project to HDMI
exec_always --no-startup-id /usr/bin/project2HDMI &
# start bluetooth
#exec_always --no-startup-id /usr/bin/blueman-manager &
#set bilang
exec_always --no-startup-id setxkbmap -layout fi,ara &
# Set Xresources colors:
set_from_resource $darkblack color0 #000000
set_from_resource $black color8 #000000
set_from_resource $darkred color1 #000000
set_from_resource $red color9 #000000
set_from_resource $darkgreen color2 #000000
set_from_resource $green color10 #000000
set_from_resource $darkyellow color3 #000000
set_from_resource $yellow color11 #000000
set_from_resource $darkblue color4 #000000
set_from_resource $blue color12 #000000
set_from_resource $darkmagenta color5 #000000
set_from_resource $magenta color13 #000000
set_from_resource $darkcyan color6 #000000
set_from_resource $cyan color14 #000000
set_from_resource $darkwhite color7 #000000
set_from_resource $white color15 #000000
set $transparent #00000000
# BORDER BACKGROUND TEXT INDICATOR CHILD_BORDER
client.focused $red $red $magenta $darkmagenta $darkblue
client.unfocused $transparent $blue $white $darkblue $darkblack
client.focused_inactive $transparent $blue $white $darkblue $darkblack
client.urgent $darkred $darkred $black $darkred $darkred
client.background $black
bar { bar {
font pango:mono 10 font pango:Ubuntu 9
colors {
background $darkblack
statusline $darkwhite
separator $cyan
focused_workspace $blue $darkblue $darkblack
active_workspace $blue $blue $darkwhite
inactive_workspace $darkblack $darkblack $white
urgent_workspace $darkblack $darkblack $white
}
status_command i3blocks status_command i3blocks
position top position top
mode dock mode dock
@ -72,46 +120,53 @@ bar {
# #---Basic Bindings---# # # #---Basic Bindings---# #
bindsym $mod+Return exec $term bindsym $mod+Return exec $term
bindsym $mod+Shift+Return exec --no-startup-id samedir bindsym $mod+Shift+Return exec --no-startup-id samedir
#bindsym $mod+section exec $term
bindsym $mod+Shift+space floating toggle bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle bindsym $mod+space focus mode_toggle
bindsym $mod+Escape workspace prev #bindsym $mod+Escape workspace prev
bindsym $mod+Shift+Escape exec --no-startup-id prompt "Exit i3?" "i3-msg exit" #bindsym $mod+Shift+Escape exec --no-startup-id prompt "Exit i3?" "i3-msg exit"
bindsym $mod+Shift+Escape exec --no-startup-id prompt "Shutdown computer?" "$shutdown"
# bindsym $mod+BackSpace # bindsym $mod+BackSpace
bindsym $mod+Shift+BackSpace exec --no-startup-id prompt "Reboot computer?" "$reboot" bindsym $mod+Shift+BackSpace exec --no-startup-id prompt "Reboot computer?" "$reboot"
bindsym $mod+grave exec --no-startup-id dmenuunicode bindsym $mod+u exec --no-startup-id dmenuunicode
##bindsym $mod+asciitilde ##bindsym $mod+asciitilde
#STOP/HIDE EVERYTHING: #STOP/HIDE EVERYTHING:
bindsym $mod+Shift+Delete exec --no-startup-id lmc truemute ; exec --no-startup-id lmc pause ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e $FILE bindsym $mod+Shift+Delete exec --no-startup-id lmc truemute ; exec --no-startup-id lmc pause ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e $FILE
# Show selection: # Show selection:
bindsym $mod+Insert exec --no-startup-id showclip bindsym $mod+Shift+Home exec --no-startup-id showclip
bindsym $mod+Pause exec --no-startup-id xcqr bindsym $mod+Shift+End exec --no-startup-id xcqr
# #---Letter Key Bindings---# # # #---Letter Key Bindings---# #
bindsym $mod+q [con_id="__focused__" instance="^(?!dropdown_).*$"] kill bindsym $mod+q [con_id="__focused__" instance="^(?!dropdown_).*$"] kill
bindsym $mod+Shift+q [con_id="__focused__" instance="^(?!dropdown_).*$"] kill bindsym $mod+Shift+q [con_id="__focused__" instance="^(?!dropdown_).*$"] kill
bindsym $mod+w exec $term -e nmtui bindsym $mod+Shift+w exec $term -e nmtui
bindsym $mod+Shift+w exec --no-startup-id $BROWSER bindsym $mod+w exec --no-startup-id $BROWSER
bindsym $mod+Ctrl+w exec --no-startup-id tor-browser-en
bindsym $mod+e exec $term -e neomutt && pkill -RTMIN+12 i3blocks bindsym $mod+e exec $term -e neomutt && pkill -RTMIN+12 i3blocks
bindsym $mod+Shift+e exec --no-startup-id tutorialvids bindsym $mod+Shift+e exec --no-startup-id tutorialvids
bindsym $mod+r exec $term -e $FILE bindsym $mod+r exec $term -e $FILE
bindsym $mod+Shift+r exec --no-startup-id winresize bindsym $mod+Ctrl+r exec --no-startup-id winresize
bindsym $mod+Shift+r exec $term -e vifmrun
bindsym $mod+t split toggle bindsym $mod+t split toggle
bindsym $mod+Shift+t gaps inner current set 15; gaps outer current set 15 bindsym $mod+Shift+t gaps inner current set 15; gaps outer current set 15
bindsym $mod+y exec $term -e calcurse -D ~/.config/calcurse bindsym $mod+y exec $term -e calcurse
bindsym $mod+Shift+y exec --no-startup-id i3resize left bindsym $mod+Shift+y exec --no-startup-id i3resize left
bindsym $mod+u exec --no-startup-id ddspawn tmuxdd #bindsym $mod+u exec --no-startup-id ddspawn tmuxdd
bindsym $mod+Shift+u exec --no-startup-id i3resize down bindsym $mod+Shift+u exec --no-startup-id i3resize down
bindsym $mod+i exec $term -e htop bindsym $mod+i exec $term -e htop
@ -157,7 +212,8 @@ bindsym $mod+Shift+l move right 30
bindsym $mod+z gaps outer current plus 5 bindsym $mod+z gaps outer current plus 5
bindsym $mod+Shift+z gaps outer current minus 5 bindsym $mod+Shift+z gaps outer current minus 5
bindsym $mod+x exec --no-startup-id mpc pause; exec --no-startup-id pauseallmpv ; exec --no-startup-id i3lock -e -f -c 1d2021 bindsym $mod+x exec --no-startup-id mpc pause; exec --no-startup-id pauseallmpv ; exec --no-startup-id lockr
#-e -f -c 1d2021
bindsym $mod+Shift+x exec --no-startup-id prompt "Shutdown computer?" "$shutdown" bindsym $mod+Shift+x exec --no-startup-id prompt "Shutdown computer?" "$shutdown"
bindsym $mod+c exec --no-startup-id freealf bindsym $mod+c exec --no-startup-id freealf
@ -177,9 +233,9 @@ bindsym $mod+Shift+m exec --no-startup-id lmc mute
# #---Workspace Bindings---# # # #---Workspace Bindings---# #
bindsym $mod+Home workspace $ws1 bindsym $mod+Home workspace $ws1
bindsym $mod+Shift+Home move container to workspace $ws1 #bindsym $mod+Shift+Home move container to workspace $ws1
bindsym $mod+End workspace $ws10 bindsym $mod+End workspace $ws10
bindsym $mod+Shift+End move container to workspace $ws10 #bindsym $mod+Shift+End move container to workspace $ws10
bindsym $mod+Prior workspace prev bindsym $mod+Prior workspace prev
bindsym $mod+Shift+Prior move container to workspace prev bindsym $mod+Shift+Prior move container to workspace prev
bindsym $mod+Next workspace next bindsym $mod+Next workspace next
@ -256,7 +312,9 @@ bindsym $mod+F8 exec --no-startup-id ~/.config/mutt/etc/mailsync.sh
bindsym $mod+F9 exec --no-startup-id dmenumount bindsym $mod+F9 exec --no-startup-id dmenumount
bindsym $mod+F10 exec --no-startup-id dmenuumount bindsym $mod+F10 exec --no-startup-id dmenuumount
bindsym $mod+F11 exec --no-startup-id ducksearch bindsym $mod+F11 exec --no-startup-id ducksearch
bindsym $mod+F12 exec $term -e nmtui #bindsym $mod+F12 exec $term -e nmtui
bindsym $mod+F12 exec --no-startup-id clipmenu -i -fn Ubuntu:size=10 -nb '#002b36' -nf '#839496' -sb '#073642' -sf '#93a1a1'
bindsym $mod+Shift+F9 exec --no-startup-id myCloud && pkill -RTMIN+17 i3blocks
# #---Arrow Keys---# # # #---Arrow Keys---# #
bindsym $mod+Left focus left bindsym $mod+Left focus left
@ -292,7 +350,7 @@ bindsym Shift+Print exec --no-startup-id maimpick
bindsym $mod+Print exec --no-startup-id dmenurecord bindsym $mod+Print exec --no-startup-id dmenurecord
bindsym $mod+Scroll_Lock exec --no-startup-id "killall screenkey || screenkey" bindsym $mod+Scroll_Lock exec --no-startup-id "killall screenkey || screenkey"
bindsym $mod+Delete exec $stoprec bindsym $mod+Delete exec $stoprec
bindsym XF86Launch1 exec --no-startup-id xset dpms force off bindsym $mod+BackSpace exec --no-startup-id xset dpms force off
# #---Extra XF86 Keys---# # # #---Extra XF86 Keys---# #
# These are the extra media keys that some keyboards have. # These are the extra media keys that some keyboards have.
@ -303,13 +361,13 @@ bindsym Control+XF86AudioLowerVolume exec --no-startup-id lmc down 1
bindsym XF86AudioRaiseVolume exec --no-startup-id lmc up 5 bindsym XF86AudioRaiseVolume exec --no-startup-id lmc up 5
bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id lmc up 10 bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id lmc up 10
bindsym Control+XF86AudioRaiseVolume exec --no-startup-id lmc up 1 bindsym Control+XF86AudioRaiseVolume exec --no-startup-id lmc up 1
bindsym XF86PowerOff exec --no-startup-id prompt "Shutdown computer?" "$shutdown" #bindsym XF86PowerOff exec --no-startup-id prompt "Shutdown computer?" "$shutdown"
##bindsym XF86Copy exec ##bindsym XF86Copy exec
##bindsym XF86Open exec ##bindsym XF86Open exec
##bindsym XF86Paste exec ##bindsym XF86Paste exec
##bindsym XF86Cut exec ##bindsym XF86Cut exec
##bindsym XF86MenuKB exec ##bindsym XF86MenuKB exec
bindsym XF86Calculator exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24 bindsym XF86Calculator exec $term -e R -q --no-save
##bindsym XF86Sleep This binding is typically mapped by systemd automatically. ##bindsym XF86Sleep This binding is typically mapped by systemd automatically.
##bindsym XF86WakeUp exec ##bindsym XF86WakeUp exec
bindsym XF86Explorer exec $term -e $FILE bindsym XF86Explorer exec $term -e $FILE
@ -363,8 +421,8 @@ bindsym XF86Search exec $BROWSER https://duckduckgo.com
##bindsym XF86Finance exec ##bindsym XF86Finance exec
##bindsym XF86Game exec ##bindsym XF86Game exec
bindsym XF86Shop exec $BROWSER https://ebay.com bindsym XF86Shop exec $BROWSER https://ebay.com
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 15 bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 5 && pkill -RTMIN+16 i3blocks
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 15 bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 5 && pkill -RTMIN+16 i3blocks
bindsym XF86AudioMedia exec --no-startup-id $term -e ncmpcpp bindsym XF86AudioMedia exec --no-startup-id $term -e ncmpcpp
bindsym XF86Display exec --no-startup-id displayselect bindsym XF86Display exec --no-startup-id displayselect
#bindsym XF86KbdLightOnOff exec #bindsym XF86KbdLightOnOff exec
@ -377,3 +435,11 @@ bindsym XF86Documents exec $term -e $FILE ~/Documents
##bindsym XF86Battery exec ##bindsym XF86Battery exec
##bindsym XF86Bluetooth exec ##bindsym XF86Bluetooth exec
bindsym XF86WLAN exec $netrefresh bindsym XF86WLAN exec $netrefresh
bindsym $mod+period exec /usr/lib/virtualbox/VirtualBoxVM --comment 'w7litex86' --startvm '{196d2f4b-8a17-44fb-b05f-4a20cc87a212}'
#/usr/lib/virtualbox/VirtualBoxVM --comment 'w7litex86' --startvm '{196d2f4b-8a17-44fb-b05f-4a20cc87a212}'"
exec_always --no-startup-id notify-send -i ~/.scripts/pix/larbs.png '<b>Welcome to LARBS:</b> Press Super+F1 for the manual.' -t 10000
bindsym $mod+section exec --no-startup-id xkblayout-state set +1 && pkill -RTMIN+17 i3blocks

View File

@ -54,7 +54,7 @@ in vim or another program.
- `opout` -- "Open output", opens the corresponding `.pdf` file if run on a `.md`, `.tex` or `.rmd` file, or if given an `.html` file, will open it in the browser. Bound to `<leader>p` in my vim config to reveal typical output. - `opout` -- "Open output", opens the corresponding `.pdf` file if run on a `.md`, `.tex` or `.rmd` file, or if given an `.html` file, will open it in the browser. Bound to `<leader>p` in my vim config to reveal typical output.
- `pauseallmpv` -- Pauses all mpv instances by sending the `,` key to each. Used by several scripts, but can be used alone as well. It will not pause an audio only mpv instance. If you know how to add a hack to do this, feel free to PR it or email me an addition. - `pauseallmpv` -- Pauses all mpv instances by sending the `,` key to each. Used by several scripts, but can be used alone as well. It will not pause an audio only mpv instance. If you know how to add a hack to do this, feel free to PR it or email me an addition.
- `remaps` -- Remaps capslock to escape when pressed and super/mod when held. Maps the menu key to super as well. Runs the US international keyboard setup. If you want another keyboard setup, edit this fine. - `remaps` -- Remaps capslock to escape when pressed and super/mod when held. Maps the menu key to super as well. Runs the US international keyboard setup. If you want another keyboard setup, edit this fine.
- `shortcuts` -- For updating bash and ranger shortcuts. Reads `~/.config/bmdirs` and `~/.config/bmfiles` for pairs of keypresses and directories and files, then autoproduces bash aliases and ranger shortcuts for them which output to `~/.config/shortcutrc` and `~/.config/ranger/shortcuts.conf` respectively. These are read automatically by my bash and ranger configs. You don't have to run this script manually though, as it's run by vim whenever you edit one of the `~/.bm*` files. - `shortcuts` -- For updating bash and ranger shortcuts. Reads `~/.key_directories` and `~/.key_files` for pairs of keypresses and directories and files, then autoproduces bash aliases and ranger shortcuts for them which output to `~/.shortcuts` and `~/.config/ranger/shortcuts.conf` respectively. These are read automatically by my bash and ranger configs. You don't have to run this script manually though, as it's run by vim whenever you edit one of the `~/.key_*` files.
- `speedvid` -- Speed up a given video file (`$1`) by a given ammount (`$2`). - `speedvid` -- Speed up a given video file (`$1`) by a given ammount (`$2`).
- `tpb` -- Search Pirate Bay for the certain search terms given as arguments. - `tpb` -- Search Pirate Bay for the certain search terms given as arguments.
- `texclear` -- Remove all `.tex` related build files. This is run by my vim when I stop editing any `.tex` file. - `texclear` -- Remove all `.tex` related build files. This is run by my vim when I stop editing any `.tex` file.

View File

@ -1,2 +1,2 @@
#!/bin/sh #!/bin/sh
pkill -f /dev/video || mpv --no-osc --no-input-default-bindings --input-conf=/dev/null --geometry=-0-0 --autofit=30% --title="mpvfloat" /dev/video0 pkill -f /dev/video || mpv --no-osc --no-input-default-bindings --input-conf=/dev/null --geometry=-0-0 --autofit=15% --title="mpvfloat" /dev/video0

View File

@ -36,7 +36,7 @@ twoscreen() { # If multi-monitor is selected and there are two screens.
secondary=$(echo "$screens" | grep -v "$primary") secondary=$(echo "$screens" | grep -v "$primary")
direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?")
xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0 xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0
fi fi
} }
morescreen() { # If multi-monitor is selected and there are more than two screens. morescreen() { # If multi-monitor is selected and there are more than two screens.
@ -65,7 +65,7 @@ chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p
case "$chosen" in case "$chosen" in
"manual selection") arandr ; exit ;; "manual selection") arandr ; exit ;;
"multi-monitor") multimon ;; "multi-monitor") multimon ;;
*) xrandr --output "$chosen" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "$chosen" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;; *) xrandr --output "$chosen" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "$chosen" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ');;
esac esac
setbg # Fix background if screen size/arangement has changed. setbg # Fix background if screen size/arangement has changed.

15
.scripts/i3cmds/myCloud Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
if [ $(mount | grep -c ~/MyCloud) != 1 ]
then
echo "12345" | sshfs root@192.168.1.3:/opt/MyCloud ~/MyCloud -o idmap=user,uid=1000,gid=1000,password_stdin,reconnect,allow_other,default_permissions,cache=yes,kernel_cache,no_readahead,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,compression=no && notify-send "MyCloudDisk was mounted successfuly" || notify-send "MyCloudDisk was not mounted"
else
fusermount -u ~/MyCloud && notify-send "MyCloudDisk was unmounted successfuly" || notify-send "Unmount Failed"
fi
if [ $(mount | grep -c ~/MyCloud) == 1 ]
then
echo 😄
else
echo 😞
fi

10
.scripts/i3cmds/mycloudoff Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
ask() { \
case $(printf "Yes\\nNo" | dmenu -i -p "Are you sure?") in
Yes) sshpass -p 12345 ssh root@192.168.1.3 PowerOff;;
No) echo "!";;
esac
}
ask

2
.scripts/i3cmds/umountMyCloud Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
fusermount -u ~/MyCloud && notify-send "MyCloudDisk was unmounted successfuly" || notify-send "Unmount Failed"

53
.scripts/i3cmds/vifmimg Executable file
View File

@ -0,0 +1,53 @@
#!/usr/bin/env bash
readonly ID_PREVIEW="preview"
#AUTO_REMOVE="yes"
# By enabling this option the script will remove the preview file after it is drawn
# and by doing so the preview will always be up-to-date with the file.
# This however, requires more CPU and therefore affects the overall performance.
if [ -e "$FIFO_UEBERZUG" ]; then
if [[ "$1" == "draw" ]]; then
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="${PWD}/$6") \
> "$FIFO_UEBERZUG"
elif [[ "$1" == "videopreview" ]]; then
echo -e "Loading preview..\nFile: $6"
[[ ! -d "/tmp${PWD}/$6/" ]] && mkdir -p "/tmp${PWD}/$6/"
[[ ! -f "/tmp${PWD}/$6.png" ]] && ffmpegthumbnailer -i "${PWD}/$6" -o "/tmp${PWD}/$6.png" -s 0 -q 10
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp${PWD}/$6.png") \
> "$FIFO_UEBERZUG"
elif [[ "$1" == "gifpreview" ]]; then
echo -e "Loading preview..\nFile: $6"
[[ ! -d "/tmp${PWD}/$6/" ]] && mkdir -p "/tmp${PWD}/$6/" && convert -coalesce "${PWD}/$6" "/tmp${PWD}/$6/$6.png"
for frame in $(ls -1 /tmp${PWD}/$6/$6*.png | sort -V); do
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="$frame") \
> "$FIFO_UEBERZUG"
# Sleep between frames to make the animation smooth.
sleep .07
done
elif [[ "$1" == "pdfpreview" ]]; then
echo -e "Loading preview..\nFile: $6"
[[ ! -d "/tmp${PWD}/$6/" ]] && mkdir -p "/tmp${PWD}/$6/"
[[ ! -f "/tmp${PWD}/$6.png" ]] && pdftoppm -png -singlefile "$6" "/tmp${PWD}/$6"
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
[path]="/tmp${PWD}/$6.png") \
> "$FIFO_UEBERZUG"
elif [[ "$1" == "clear" ]]; then
declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") \
> "$FIFO_UEBERZUG"
[[ ! -z $AUTO_REMOVE ]] && [[ -f "/tmp${PWD}/$6.png" ]] && rm -f "/tmp${PWD}/$6.png"
[[ ! -z $AUTO_REMOVE ]] && [[ -d "/tmp${PWD}/$6/" ]] && rm -rf "/tmp${PWD}/$6/"
fi
fi

15
.scripts/i3cmds/vifmrun Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
export FIFO_UEBERZUG="/tmp/vifm-ueberzug-${PPID}"
function cleanup {
rm "$FIFO_UEBERZUG" 2>/dev/null
pkill -P $$ 2>/dev/null
}
rm "$FIFO_UEBERZUG" 2>/dev/null
mkfifo "$FIFO_UEBERZUG"
trap cleanup EXIT
tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser bash &
vifm
cleanup

View File

@ -1,33 +1,37 @@
#!/bin/sh #!/bin/sh
# Give a battery name (e.g. BAT0) as an argument. # Give a battery name (e.g. BAT0) as an argument.
#if [ $1=="BAT0" ]; then
# battery=$(acpi | grep -i 'Battery 0')
#else
# battery=$(acpi | grep -i 'Battery 1')
#fi
battery="$(acpi -i)"
# get xresources colors
for x in "$(xrdb -query | sed "s/.*\./export /g;s/:\s*/=\"/g;s/$/\"/g")"; do eval "$x"; done
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b> 1) pgrep -x dunst >/dev/null && notify-send "${battery}";;
🔋: discharging
🛑: not charging
♻: stagnant charge
🔌: charging
⚡: charged
❗: battery very low!
- Text color reflects charge left" ;;
esac esac
capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit
status=$(cat /sys/class/power_supply/"$1"/status) status=$(cat /sys/class/power_supply/"$1"/status)
if [ "$capacity" -ge 75 ]; then if [ "$capacity" -ge 75 ]; then
color="#00ff00" color="$color10"
elif [ "$capacity" -ge 50 ]; then elif [ "$capacity" -ge 50 ]; then
color="#ffffff" color="$color15"
elif [ "$capacity" -ge 25 ]; then elif [ "$capacity" -ge 25 ]; then
color="#ffff00" color="$color11"
else else
color="#ff0000" color="$color9"
warn="❗" warn="❗"
fi fi
[ -z $warn ] && warn=" " [ -z $warn ] && warn=" "
[ "$status" = "Charging" ] && color="#ffffff" [ "$status" = "Charging" ] && color="$color15"
printf "<span color='%s'>%s%s%s</span>" "$color" "$(echo "$status" | sed -e "s/,//;s/Discharging/🔋/;s/Not Charging/🛑/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" printf "<span color='%s'>%s%s%s</span>" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')"

10
.scripts/statusbar/brightness Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
icon="🔆"
case $BLOCK_BUTTON in
4) xbacklight -inc 4 ;;
5) xbacklight -dec 4 ;;
esac
printf "%s %s%%\\n" "$icon" "$(echo "$(xbacklight -get)*100/100" | bc)"

21
.scripts/statusbar/layswitch Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
case $BLOCK_BUTTON in
1) xkblayout-state set +1 ;;
esac
LNG=$(xkblayout-state print %s | awk '{print toupper($0)}')
case $LNG in
"FI")
#CLR=\#00FF00 ;; # green
LNG=🇫🇮;;
"ARA")
#CLR=\#FF0000 ;; # red
LNG=🇪🇬;;
*)
CLR=\#FFFFFF ;; # all others default-white
esac
echo "$LNG"
echo "$LNG"
#echo "$CLR"

View File

@ -14,4 +14,5 @@ case $BLOCK_BUTTON in
- Middle click syncs mail" ;; - Middle click syncs mail" ;;
esac esac
echo "$(du -a ~/.mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat /tmp/imapsyncicon 2>/dev/null)" echo "$(du -a ~/.mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat ~/.config/mutt/.dl 2>/dev/null)"

8
.scripts/statusbar/mycloud Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
if [ $(mount | grep -c ~/MyCloud) == 1 ]
then
echo 💾
else
echo ""
fi

View File

@ -3,6 +3,7 @@
printf "Beginning upgrade.\\n" printf "Beginning upgrade.\\n"
yay -Syu yay -Syu
pacman -Qu | wc -l > ~/.pacupgrnum
pkill -RTMIN+8 i3blocks pkill -RTMIN+8 i3blocks
printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n" printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n"

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
[ "$(stat -c %y /tmp/weatherreport | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] && getforecast [ "$(stat -c %y /tmp/weatherreport | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] && getforecast Damietta
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) $TERMINAL -e less -S /tmp/weatherreport ;; 1) $TERMINAL -e less -S /tmp/weatherreport ;;

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
# If $1 command is not available, error code and notify. # If $1 command is not available, error code and notify.
command -v "$1" >/dev/null || { notify-send "📦 <b>$1</b> must be installed for this function." && exit 1 ;} command -v "$1" >/dev/null || { notify-send -i "$PIX/larbs.svg" "<b>$1</b> must be installed for this function." && exit 1 ;}

3
.scripts/tools/lockr Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
#i3lock-fancy -f Comic-Sans-MS -- scrot -z
i3lock-fancy -b=25x5

8
.scripts/tools/note Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
# This is a general notification command for my own ease.
# $1 should be a message
# $2 is an optional image for notify-send
# Echos content on terminal and if dunst is running, shows notification.
[ -z "$2" ] || img="-i $2"
echo "$1" && pgrep -x dunst >/dev/null && notify-send $img "$1"

View File

@ -3,8 +3,8 @@
# Increase key speed via a rate change # Increase key speed via a rate change
xset r rate 300 50 xset r rate 300 50
# Map the caps lock key to super... # Map the caps lock key to super...
setxkbmap -option caps:super #setxkbmap -option caps:super
# But when it is pressed only once, treat it as escape. # But when it is pressed only once, treat it as escape.
killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape' #killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape'
# Map the menu button to right super as well. # Map the menu button to right super as well.
xmodmap -e 'keycode 135 = Super_R' #xmodmap -e 'keycode 135 = Super_R'

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
# Sets the background. If given an argument, will set file as background. # Sets the background. If given an argument, will set file as background.
[ ! -z "$1" ] && cp "$1" ~/.config/wall.png && notify-send -i "$HOME/.config/wall.png" "Wallpaper changed." [ ! -z "$1" ] && cp "$1" ~/.config/wall.png && notify-send -i "$HOME/.config/wall.png" "Wallpaper changed."
xwallpaper --zoom ~/.config/wall.png xwallpaper --stretch ~/.config/wall.png