mirror of
https://github.com/The-Repo-Club/DotFiles.git
synced 2024-11-28 10:18:46 -05:00
DotFiles
This commit is contained in:
parent
6ce8f6bba1
commit
ade4f98505
@ -197,7 +197,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Lighting\Keys\y=#ffffff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Lighting\Keys\z=#ffffff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Modified=d2431ffd
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Modified=394adceb
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Name=Rainbow
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\0\Performance\DPI\0=@Point(400 400)
|
||||
@ -425,7 +425,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Lighting\Keys\y=#ff0000
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Lighting\Keys\z=#ff0000
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Modified=f508be9d
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Modified=9389d46a
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Name=Breathing
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\1\Performance\DPI\0=@Point(400 400)
|
||||
@ -675,7 +675,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Lighting\Keys\y=#aa00ff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Lighting\Keys\z=#aa00ff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Modified=9cd81fff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Modified=7a6eaf79
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Name=Trippy
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\2\Performance\DPI\0=@Point(400 400)
|
||||
@ -733,7 +733,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\CurrentMode={51EB6E3A-27A0-4AD6-A35C-6B67E0329A3D}
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\HwModified=7ffd
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\ModeCount=3
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\Modified=abda8bf7
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\Modified=9d268d65
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7B5B1E2E81-ED4F-4F79-9EB5-F8ACA67D1BF0%7D\Name=Multi
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Binding\KeyMap=K68 GB
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Binding\UseRealNames=true
|
||||
@ -929,7 +929,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Lighting\Keys\y=#ffffff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Lighting\Keys\z=#ffffff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Modified=4935ed91
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Modified=5efaf172
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Name=Rainbow
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\0\Performance\DPI\0=@Point(400 400)
|
||||
@ -1157,7 +1157,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Lighting\Keys\y=#ff0000
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Lighting\Keys\z=#ff0000
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Modified=b00d576a
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Modified=79e6ce6f
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Name=Breathing
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\1\Performance\DPI\0=@Point(400 400)
|
||||
@ -1407,7 +1407,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Lighting\Keys\y=#aa00ff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Lighting\Keys\z=#aa00ff
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Lighting\UseRealNames=true
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Modified=a066f62b
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Modified=c11d9b15
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Name=Trippy
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Performance\AngleSnap=false
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\2\Performance\DPI\0=@Point(400 400)
|
||||
@ -1465,7 +1465,7 @@
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\CurrentMode={11C11AE3-3195-4DFC-B8AC-2FEA703414E5}
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\HwModified=40b6f054
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\ModeCount=3
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\Modified=4a91858f
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\Modified=648a05f8
|
||||
0E029022AF4C18835CBDCC7EF5001BC3\%7BBA7FC152-2D51-4C26-A7A6-A036CC93D924%7D\Name=Demo
|
||||
|
||||
[Popups]
|
||||
|
Binary file not shown.
@ -18,6 +18,12 @@ if test -d "$HOME/.local/bin/repobar"
|
||||
set PATH "$HOME/.local/bin/repobar:$PATH"
|
||||
end
|
||||
|
||||
# Adds `~/.local/bin/rofi` to $PATH
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if test -d "$HOME/.local/bin/rofi"
|
||||
set PATH "$HOME/.local/bin/rofi:$PATH"
|
||||
end
|
||||
|
||||
# Adds `~/.local/bin/fzf` to $PATH
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if test -d "$HOME/.local/bin/fzf"
|
||||
|
@ -126,31 +126,31 @@ $super_b+F2 \
|
||||
## Category: Menus;
|
||||
# Description: Start ClipMenu;
|
||||
$super_b+F3 \
|
||||
$exe fzf_run -c clipmenu -i ClipMenu -t $TerminalEmulator
|
||||
$exe clipmenu -p ClipMenu -mesg "Copy from clipboard."
|
||||
|
||||
###############################
|
||||
####### FZFMenu Menu's #######
|
||||
####### Rofi Menu's #######
|
||||
###############################
|
||||
|
||||
## Category: FZFMenu;
|
||||
# Description: Start FZF-FZFMenu;
|
||||
## Category: Menus;
|
||||
# Description: Start Main Menu;
|
||||
$super_b+m \
|
||||
$exe fzf_run -c fzf_menu_run -i Menu -t $TerminalEmulator
|
||||
$exe menu
|
||||
|
||||
## Category: FZFMenu;
|
||||
# Description: Start FZF-MusicMenu;
|
||||
## Category: Menus;
|
||||
# Description: Start Music Menu;
|
||||
$super_b+F6 \
|
||||
$exe fzf_run -c fzf_music -i MusicMenu -t $TerminalEmulator
|
||||
$exe music
|
||||
|
||||
## Category: FZFMenu;
|
||||
# Description: Start FZF-PassMenu;
|
||||
## Category: Menus;
|
||||
# Description: Start Pass Menu;
|
||||
$super_b+p \
|
||||
$exe fzf_run -c 'fzf_pass' -i PassMenu -t $TerminalEmulator
|
||||
$exe passmenu
|
||||
|
||||
## Category: FZFMenu;
|
||||
# Description: Start FZF-YoutubeMenu;
|
||||
## Category: Menus;
|
||||
# Description: Start Youtube Menu;
|
||||
$super_b+s \
|
||||
$exe fzf_run -c 'fzf_youtube_subs' -i YoutubeMenu -t $TerminalEmulator
|
||||
$exe youtube_subs
|
||||
|
||||
# }}} Menus
|
||||
|
||||
@ -163,17 +163,17 @@ $super_b+s \
|
||||
## Category: Main Keybinds;
|
||||
# Description: Exit / Quit / Restart;
|
||||
$super_b+$shift+e \
|
||||
$exe fzf_run -c fzf_powermenu -i PowerMenu -t $TerminalEmulator
|
||||
$exe rofi -show powermenu -config ~/.config/rofi/powermenu.rasi
|
||||
|
||||
## Category: Main Keybinds;
|
||||
# Description: Exit / Quit / Restart;
|
||||
$super_b+$shift+x \
|
||||
$exe fzf_run -c fzf_powermenu -i PowerMenu -t $TerminalEmulator
|
||||
$exe rofi -show powermenu -config ~/.config/rofi/powermenu.rasi
|
||||
|
||||
## Category: Main Keybinds;
|
||||
# Description: Exit / Quit / Restart;
|
||||
$super_b+x \
|
||||
$exe fzf_run -c fzf_powermenu -i PowerMenu -t $TerminalEmulator
|
||||
$exe rofi -show powermenu -config ~/.config/rofi/powermenu.rasi
|
||||
|
||||
# }}} Power
|
||||
|
||||
@ -824,7 +824,7 @@ $exe autostart
|
||||
|
||||
# {{{ Settings
|
||||
|
||||
$exe fzf_youtube_subs -d
|
||||
$exe youtube_subs -d
|
||||
|
||||
# setting variables for later use
|
||||
# use xrandr and/or arandr to know the names of your monitors
|
||||
|
@ -8,8 +8,8 @@
|
||||
# Modified On - Sun 31 Oct 00:33:48 BST 2021
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
: "${CM_LAUNCHER=fzf}"
|
||||
: "${CM_HISTLENGTH=8}"
|
||||
: "${CM_LAUNCHER="rofi"}"
|
||||
: "${CM_HISTLENGTH=15}"
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
|
@ -31,6 +31,7 @@ jetbrains-toolbox
|
||||
lib32-libxft-bgra
|
||||
libart-lgpl
|
||||
libxft-bgra
|
||||
linux-wifi-hotspot
|
||||
linuxrepos-keyring
|
||||
linuxrepos-mirrorlist
|
||||
minecraft-launcher
|
||||
|
@ -21,6 +21,7 @@ MC=0
|
||||
|
||||
PRIMARY=$(xrandr --query | grep " connected" | grep "primary" | cut -d" " -f1)
|
||||
OTHERS=$(xrandr --query | grep " connected" | grep -v "primary" | cut -d" " -f1)
|
||||
DEFAULT_NETWORK_INTERFACE=$(ip route | grep '^default' | awk '{print $5}' | head -n1)
|
||||
|
||||
# Launch bar1 and bar2
|
||||
if type "xrandr" > /dev/null; then
|
||||
@ -38,8 +39,8 @@ if type "xrandr" > /dev/null; then
|
||||
TOP_BAR_CONFIG=$HOME/.config/polybar/monitor_$MC/config_top.ini
|
||||
BOTTOM_BAR_CONFIG=$HOME/.config/polybar/monitor_$MC/config_bottom.ini
|
||||
|
||||
MONITOR=$m polybar --reload -c "$TOP_BAR_CONFIG" $BAR_NAME &
|
||||
MONITOR=$m polybar --reload -c "$BOTTOM_BAR_CONFIG" $BAR_NAME &
|
||||
DEFAULT_NETWORK_INTERFACE=$DEFAULT_NETWORK_INTERFACE MONITOR=$m polybar --reload -c "$TOP_BAR_CONFIG" $BAR_NAME &
|
||||
DEFAULT_NETWORK_INTERFACE=$DEFAULT_NETWORK_INTERFACE MONITOR=$m polybar --reload -c "$BOTTOM_BAR_CONFIG" $BAR_NAME &
|
||||
done
|
||||
else
|
||||
polybar --reload main -c ~/.config/polybar/config_top.ini &
|
||||
|
@ -477,7 +477,7 @@ icon-pause =
|
||||
[module/network]
|
||||
type = internal/network
|
||||
|
||||
interface = wlp0s20f3
|
||||
interface = ${env:DEFAULT_NETWORK_INTERFACE:enp0s20f0u2}
|
||||
interval = 1.0
|
||||
|
||||
accumulate-stats = true
|
||||
@ -499,7 +499,7 @@ label-disconnected = "Disconnected"
|
||||
[module/network_i]
|
||||
type = internal/network
|
||||
|
||||
interface = wlp0s20f3
|
||||
interface = ${env:DEFAULT_NETWORK_INTERFACE:enp0s20f0u2}
|
||||
|
||||
interval = 1.0
|
||||
accumulate-stats = true
|
||||
|
@ -66,7 +66,7 @@ format-background = ${color.cyan}
|
||||
format-foreground = ${color.fg}
|
||||
format-padding = 1
|
||||
|
||||
click-left = fzf_run -c fzf_menu_run -i PolybarMenu -t alacritty
|
||||
click-left = menu
|
||||
|
||||
[module/launcher_i]
|
||||
type = custom/text
|
||||
@ -76,7 +76,7 @@ format-background = ${color.red}
|
||||
format-foreground = ${color.fg}
|
||||
format-padding = 1
|
||||
|
||||
click-left = fzf_run -c fzf_menu_run -i PolybarMenu -t alacritty
|
||||
click-left = menu
|
||||
|
||||
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
|
||||
@ -88,7 +88,7 @@ format-background = ${color.mf}
|
||||
format-foreground = ${color.fg}
|
||||
format-padding = 1
|
||||
|
||||
click-left = fzf_run -c fzf_powermenu -i PowerMenu -t alacritty
|
||||
click-left = rofi -show powermenu -config ~/.config/rofi/powermenu.rasi
|
||||
|
||||
[module/power_i]
|
||||
type = custom/text
|
||||
@ -98,7 +98,7 @@ format-background = ${color.red}
|
||||
format-foreground = ${color.fg}
|
||||
format-padding = 1
|
||||
|
||||
click-left = fzf_run -c fzf_powermenu -i PowerMenu -t alacritty
|
||||
click-left = rofi -show powermenu -config ~/.config/rofi/powermenu.rasi
|
||||
|
||||
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||
|
||||
|
0
rofi/.config/rofi/bookmarks/bm.bmf
Normal file
0
rofi/.config/rofi/bookmarks/bm.bmf
Normal file
10
rofi/.config/rofi/config.rasi
Normal file
10
rofi/.config/rofi/config.rasi
Normal file
@ -0,0 +1,10 @@
|
||||
configuration {
|
||||
modi: "combi,drun,filebrowser,keys,window,run,ssh";
|
||||
font: "Hack Nerd Font 12";
|
||||
combi-modi: "window,ssh";
|
||||
}
|
||||
@theme "repomenu"
|
||||
listview {
|
||||
lines: 20;
|
||||
columns: 1;
|
||||
}
|
39
rofi/.config/rofi/configs/subs.ini
Normal file
39
rofi/.config/rofi/configs/subs.ini
Normal file
@ -0,0 +1,39 @@
|
||||
# Linux
|
||||
UCVls1GmFKf6WlTraIb_IaJg # DistroTube
|
||||
UC2eYFnH61tmytImy1mTYvhA # Luke Smith
|
||||
UCld68syR8Wi-GY_n4CaoJGA # Brodie Robertson
|
||||
UCg6gPGh8HU2U01vaFCAsvmQ # Chris Titus Tech
|
||||
UCCIHOP7e271SIumQgyl6XBQ # OldTechBloke
|
||||
UCJdmdUp5BrsWsYVQUylCMLg # Erik Dubois
|
||||
UCdGFLV7h9RGeTUX7wa5rqGw # Manjaro Linux
|
||||
UCoryWpk4QVYKFCJul9KBdyw # Switched to Linux
|
||||
UC5UAwBUum7CPN5buc-_N1Fw # The Linux Experiment
|
||||
UCX_WM2O-X96URC5n66G-hvw # EF Linux
|
||||
UCZiL6BoryLWxyapUuVYW27g # Average Linux User
|
||||
UCylGUf9BvQooEFjgdNudoQg # The Linux Cast
|
||||
UC8ENHE5xdFSwx71u3fDH5Xw # ThePrimeagen
|
||||
UCRE3NFNtdjR96-H4QG4U1Fg # HexDSL
|
||||
# UCfp-lNJy4QkIGnaEE6NtDSg # Terminal For Life
|
||||
UCmw-QGOHbHA5cDAvwwqUTKQ # Zaney
|
||||
|
||||
#Minecraft
|
||||
UChFur_NwVSbUozOcF_F2kMg # MumboJumbo
|
||||
UC_GQ4mac4oN3wl1UdbFuTEA # ibxToyCat
|
||||
UCRlEFn0L2G_DktbyvN0AZ5A # WadZee
|
||||
UC9mvRrl9o7rG65ABsGVvDBw # Mysticat
|
||||
UCuMJPFqazQI4SofSFEd-5zA # impulseSV
|
||||
|
||||
#Spirit
|
||||
UC_8fJz5gAnhRqZ740QXlzmw # Jen McCarty
|
||||
UCAk3t7WHs2zjsZpopox8Taw # Jonna Jinton
|
||||
|
||||
#Meditations
|
||||
UCUSzc8BHGJPaYt0DjvscIzw # Woke Nation
|
||||
UCM7XCXnxtYJkkMN0zf0tsSw # Meditation And Healing
|
||||
|
||||
#Music
|
||||
UCMvETSFFkMOADyrGBj3gbWA # NerdOut
|
||||
UCXBcDYUr89ImtOLYaHPiiPg # Marcus Veltri
|
||||
|
||||
# Myself
|
||||
UCuKJ0LqxI8t2a9ATl1rWBGA # Myself
|
124
rofi/.config/rofi/passmenu/config
Normal file
124
rofi/.config/rofi/passmenu/config
Normal file
@ -0,0 +1,124 @@
|
||||
# permanently set alternative root dir. Use ":" to separate multiple roots
|
||||
# which can be switched at runtime with shift+left/right
|
||||
# root=/path/to/root
|
||||
|
||||
# rofi command. Make sure to have "$@" as last argument
|
||||
_rofi () {
|
||||
rofi -i -no-auto-select "$@"
|
||||
}
|
||||
|
||||
# default command to generate passwords
|
||||
_pwgen () {
|
||||
pwgen -y "$@"
|
||||
}
|
||||
|
||||
# image viewer to display qrcode of selected entry
|
||||
# qrencode is needed to generate the image and a viewer
|
||||
# that can read from pipes. Known viewers to work are feh and display
|
||||
_image_viewer () {
|
||||
feh -
|
||||
# display
|
||||
}
|
||||
|
||||
# It is possible to use wl-copy and wl-paste from wl-clipboard
|
||||
# Just uncomment the lines with wl-copy and wl-paste
|
||||
# and comment the xclip lines
|
||||
#
|
||||
_clip_in_primary() {
|
||||
xclip
|
||||
# wl-copy-p
|
||||
}
|
||||
|
||||
_clip_in_clipboard() {
|
||||
xclip -selection clipboard
|
||||
# wl-copy
|
||||
}
|
||||
|
||||
_clip_out_primary() {
|
||||
xclip -o
|
||||
# wl-paste -p
|
||||
}
|
||||
|
||||
_clip_out_clipboard() {
|
||||
xclip --selection clipboard -o
|
||||
# wl-paste
|
||||
}
|
||||
|
||||
|
||||
# xdotool needs the keyboard layout to be set using setxkbmap
|
||||
# You can do this in your autostart scripts (e.g. xinitrc)
|
||||
|
||||
# If for some reason, you cannot do this, you can set the command here.
|
||||
# and set fix_layout to true
|
||||
fix_layout=false
|
||||
|
||||
layout_cmd () {
|
||||
setxkbmap us
|
||||
}
|
||||
|
||||
# fields to be used
|
||||
URL_field='url'
|
||||
USERNAME_field='user'
|
||||
AUTOTYPE_field='autotype'
|
||||
|
||||
# delay to be used for :delay keyword
|
||||
delay=2
|
||||
|
||||
# rofi-pass needs to close itself before it can type passwords. Set delay here.
|
||||
wait=0.2
|
||||
|
||||
# delay between keypresses when typing (in ms)
|
||||
xdotool_delay=12
|
||||
|
||||
## Programs to be used
|
||||
# Editor
|
||||
EDITOR='vim -f'
|
||||
|
||||
# Browser
|
||||
BROWSER='xdg-open'
|
||||
|
||||
## Misc settings
|
||||
|
||||
default_do='menu' # menu, autotype, copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl
|
||||
auto_enter='false'
|
||||
notify='false'
|
||||
default_autotype='user :tab pass'
|
||||
|
||||
# color of the help messages
|
||||
# leave empty for autodetection
|
||||
help_color="#4872FF"
|
||||
|
||||
# Clipboard settings
|
||||
# Possible options: primary, clipboard, both
|
||||
clip=primary
|
||||
|
||||
# Seconds before clearing pass from clipboard
|
||||
clip_clear=45
|
||||
|
||||
## Options for generating new password entries
|
||||
|
||||
# open new password entries in editor
|
||||
edit_new_pass="true"
|
||||
|
||||
# default_user is also used for password files that have no user field.
|
||||
#default_user="${ROFI_PASS_DEFAULT_USER-$(whoami)}"
|
||||
#default_user2=mary_ann
|
||||
#password_length=12
|
||||
|
||||
# Custom Keybindings
|
||||
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_entry="Alt+2"
|
||||
type_entry="Alt+1"
|
||||
copy_menu="Alt+c"
|
||||
action_menu="Alt+a"
|
||||
type_menu="Alt+t"
|
||||
help="Alt+h"
|
||||
switch="Alt+x"
|
||||
insert_pass="Alt+n"
|
9
rofi/.config/rofi/powermenu.rasi
Normal file
9
rofi/.config/rofi/powermenu.rasi
Normal file
@ -0,0 +1,9 @@
|
||||
configuration {
|
||||
modi: "powermenu:powermenu";
|
||||
font: "Hack Nerd Font 12";
|
||||
}
|
||||
@theme "powermenu"
|
||||
listview {
|
||||
lines: 6;
|
||||
columns: 1;
|
||||
}
|
183
rofi/.config/rofi/themes/powermenu.rasi
Normal file
183
rofi/.config/rofi/themes/powermenu.rasi
Normal file
@ -0,0 +1,183 @@
|
||||
* {
|
||||
background: #283036;
|
||||
foreground: #e5e9f0;
|
||||
|
||||
active-background: #434c5e;
|
||||
active-foreground: @foreground;
|
||||
normal-background: @background;
|
||||
normal-foreground: @foreground;
|
||||
urgent-background: #ff5959;
|
||||
urgent-foreground: @background;
|
||||
|
||||
alternate-active-background: @active-background;
|
||||
alternate-active-foreground: @active-foreground;
|
||||
alternate-normal-background: @background;
|
||||
alternate-normal-foreground: @foreground;
|
||||
alternate-urgent-background: @background;
|
||||
alternate-urgent-foreground: @foreground;
|
||||
|
||||
selected-active-background: #81a1c1;
|
||||
selected-active-foreground: @foreground;
|
||||
selected-normal-background: #434c5e;
|
||||
selected-normal-foreground: @foreground;
|
||||
selected-urgent-background: #ff5959;
|
||||
selected-urgent-foreground: @foreground;
|
||||
|
||||
background-color: @background;
|
||||
border-color: #59ff59;
|
||||
spacing: 2;
|
||||
|
||||
text-font: "Hack Nerd Font 12";
|
||||
}
|
||||
|
||||
element-text, element-icon {
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
|
||||
#window {
|
||||
background-color: @background;
|
||||
location: 0;
|
||||
width: 30%;
|
||||
padding: 2.5ch;
|
||||
font: @text-font;
|
||||
}
|
||||
|
||||
#mainbox {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#message {
|
||||
border: 2px 2px 2px;
|
||||
border-color: @border-color;
|
||||
padding: 5px;
|
||||
margin: 0px 0px 8px 0px;
|
||||
}
|
||||
|
||||
#textbox {
|
||||
text-color: @foreground;
|
||||
}
|
||||
|
||||
#inputbar {
|
||||
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
|
||||
background-color: @border-color;
|
||||
padding: 2px;
|
||||
margin: 0px 0px 10px 0px;
|
||||
}
|
||||
|
||||
#prompt {
|
||||
spacing: 0;
|
||||
margin: 2px 6px 2px 6px;
|
||||
background-color: @border-color;
|
||||
text-color: @background;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
#textbox-prompt-colon {
|
||||
expand: false;
|
||||
str: "->";
|
||||
text-color: @active-foreground;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#entry {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#case-indicator {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
#listview {
|
||||
fixed-height: 0;
|
||||
border: 2px 2px 2px 2px;
|
||||
border-color: @border-color;
|
||||
scrollbar: false;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#scrollbar {
|
||||
width: 4px ;
|
||||
border: 0;
|
||||
handle-width: 8px ;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
border: 2px 0px 0px;
|
||||
border-color: @border-color;
|
||||
}
|
||||
|
||||
#mode-switcher {
|
||||
border: 2px 0px 0px ;
|
||||
border-color: @border-color;
|
||||
}
|
||||
|
||||
#button {
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
#button.selected {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
|
||||
#inputbar {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
padding: 2px ;
|
||||
}
|
||||
|
||||
#element {
|
||||
border: 0;
|
||||
padding: 6px ;
|
||||
}
|
||||
|
||||
#element.normal.normal {
|
||||
background-color: @normal-background;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
#element.normal.urgent {
|
||||
background-color: @urgent-background;
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
|
||||
#element.normal.active {
|
||||
background-color: @active-background;
|
||||
text-color: @active-foreground;
|
||||
}
|
||||
|
||||
#element.selected.normal {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
|
||||
#element.selected.urgent {
|
||||
background-color: @selected-urgent-background;
|
||||
text-color: @selected-urgent-foreground;
|
||||
}
|
||||
|
||||
#element.selected.active {
|
||||
background-color: @selected-active-background;
|
||||
text-color: @selected-active-foreground;
|
||||
}
|
||||
|
||||
#element.alternate.normal {
|
||||
background-color: @alternate-normal-background;
|
||||
text-color: @alternate-normal-foreground;
|
||||
}
|
||||
|
||||
#element.alternate.urgent {
|
||||
background-color: @alternate-urgent-background;
|
||||
text-color: @alternate-urgent-foreground;
|
||||
}
|
||||
|
||||
#element.alternate.active {
|
||||
background-color: @alternate-active-background;
|
||||
text-color: @alternate-active-foreground;
|
||||
}
|
183
rofi/.config/rofi/themes/repomenu.rasi
Normal file
183
rofi/.config/rofi/themes/repomenu.rasi
Normal file
@ -0,0 +1,183 @@
|
||||
* {
|
||||
background: #283036;
|
||||
foreground: #e5e9f0;
|
||||
|
||||
active-background: #434c5e;
|
||||
active-foreground: @foreground;
|
||||
normal-background: @background;
|
||||
normal-foreground: @foreground;
|
||||
urgent-background: #ff5959;
|
||||
urgent-foreground: @background;
|
||||
|
||||
alternate-active-background: @active-background;
|
||||
alternate-active-foreground: @active-foreground;
|
||||
alternate-normal-background: @background;
|
||||
alternate-normal-foreground: @foreground;
|
||||
alternate-urgent-background: @background;
|
||||
alternate-urgent-foreground: @foreground;
|
||||
|
||||
selected-active-background: #81a1c1;
|
||||
selected-active-foreground: @foreground;
|
||||
selected-normal-background: #434c5e;
|
||||
selected-normal-foreground: @foreground;
|
||||
selected-urgent-background: #ff5959;
|
||||
selected-urgent-foreground: @foreground;
|
||||
|
||||
background-color: @background;
|
||||
border-color: #59ff59;
|
||||
spacing: 2;
|
||||
|
||||
text-font: "Hack Nerd Font 12";
|
||||
}
|
||||
|
||||
element-text, element-icon {
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
|
||||
#window {
|
||||
background-color: @background;
|
||||
location: 0;
|
||||
width: 50%;
|
||||
padding: 2.5ch;
|
||||
font: @text-font;
|
||||
}
|
||||
|
||||
#mainbox {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#message {
|
||||
border: 2px 2px 2px;
|
||||
border-color: @border-color;
|
||||
padding: 5px;
|
||||
margin: 0px 0px 8px 0px;
|
||||
}
|
||||
|
||||
#textbox {
|
||||
text-color: @foreground;
|
||||
}
|
||||
|
||||
#inputbar {
|
||||
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
|
||||
background-color: @border-color;
|
||||
padding: 2px;
|
||||
margin: 0px 0px 10px 0px;
|
||||
}
|
||||
|
||||
#prompt {
|
||||
spacing: 0;
|
||||
margin: 2px 6px 2px 6px;
|
||||
background-color: @border-color;
|
||||
text-color: @background;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
#textbox-prompt-colon {
|
||||
expand: false;
|
||||
str: "->";
|
||||
text-color: @active-foreground;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#entry {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#case-indicator {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
#listview {
|
||||
fixed-height: 0;
|
||||
border: 2px 2px 2px 2px;
|
||||
border-color: @border-color;
|
||||
scrollbar: false;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#scrollbar {
|
||||
width: 4px ;
|
||||
border: 0;
|
||||
handle-width: 8px ;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
border: 2px 0px 0px;
|
||||
border-color: @border-color;
|
||||
}
|
||||
|
||||
#mode-switcher {
|
||||
border: 2px 0px 0px ;
|
||||
border-color: @border-color;
|
||||
}
|
||||
|
||||
#button {
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
#button.selected {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
|
||||
#inputbar {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
padding: 2px ;
|
||||
}
|
||||
|
||||
#element {
|
||||
border: 0;
|
||||
padding: 6px ;
|
||||
}
|
||||
|
||||
#element.normal.normal {
|
||||
background-color: @normal-background;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
#element.normal.urgent {
|
||||
background-color: @urgent-background;
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
|
||||
#element.normal.active {
|
||||
background-color: @active-background;
|
||||
text-color: @active-foreground;
|
||||
}
|
||||
|
||||
#element.selected.normal {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
|
||||
#element.selected.urgent {
|
||||
background-color: @selected-urgent-background;
|
||||
text-color: @selected-urgent-foreground;
|
||||
}
|
||||
|
||||
#element.selected.active {
|
||||
background-color: @selected-active-background;
|
||||
text-color: @selected-active-foreground;
|
||||
}
|
||||
|
||||
#element.alternate.normal {
|
||||
background-color: @alternate-normal-background;
|
||||
text-color: @alternate-normal-foreground;
|
||||
}
|
||||
|
||||
#element.alternate.urgent {
|
||||
background-color: @alternate-urgent-background;
|
||||
text-color: @alternate-urgent-foreground;
|
||||
}
|
||||
|
||||
#element.alternate.active {
|
||||
background-color: @alternate-active-background;
|
||||
text-color: @alternate-active-foreground;
|
||||
}
|
183
rofi/.config/rofi/themes/wifimanager.rasi
Normal file
183
rofi/.config/rofi/themes/wifimanager.rasi
Normal file
@ -0,0 +1,183 @@
|
||||
* {
|
||||
background: #283036;
|
||||
foreground: #e5e9f0;
|
||||
|
||||
active-background: #434c5e;
|
||||
active-foreground: @foreground;
|
||||
normal-background: @background;
|
||||
normal-foreground: @foreground;
|
||||
urgent-background: #ff5959;
|
||||
urgent-foreground: @background;
|
||||
|
||||
alternate-active-background: @active-background;
|
||||
alternate-active-foreground: @active-foreground;
|
||||
alternate-normal-background: @background;
|
||||
alternate-normal-foreground: @foreground;
|
||||
alternate-urgent-background: @background;
|
||||
alternate-urgent-foreground: @foreground;
|
||||
|
||||
selected-active-background: #81a1c1;
|
||||
selected-active-foreground: @foreground;
|
||||
selected-normal-background: #434c5e;
|
||||
selected-normal-foreground: @foreground;
|
||||
selected-urgent-background: #ff5959;
|
||||
selected-urgent-foreground: @foreground;
|
||||
|
||||
background-color: @background;
|
||||
border-color: #59ff59;
|
||||
spacing: 2;
|
||||
|
||||
text-font: "Hack Nerd Font 12";
|
||||
}
|
||||
|
||||
element-text, element-icon {
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
|
||||
#window {
|
||||
background-color: @background;
|
||||
location: 0;
|
||||
width: 50%;
|
||||
padding: 2.5ch;
|
||||
font: @text-font;
|
||||
}
|
||||
|
||||
#mainbox {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#message {
|
||||
border: 2px 2px 2px;
|
||||
border-color: @border-color;
|
||||
padding: 5px;
|
||||
margin: 0px 0px 8px 0px;
|
||||
}
|
||||
|
||||
#textbox {
|
||||
text-color: @foreground;
|
||||
}
|
||||
|
||||
#inputbar {
|
||||
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
|
||||
background-color: @border-color;
|
||||
padding: 2px;
|
||||
margin: 0px 0px 10px 0px;
|
||||
}
|
||||
|
||||
#prompt {
|
||||
spacing: 0;
|
||||
margin: 2px 6px 2px 6px;
|
||||
background-color: @border-color;
|
||||
text-color: @background;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
#textbox-prompt-colon {
|
||||
expand: false;
|
||||
str: "->";
|
||||
text-color: @active-foreground;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#entry {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#case-indicator {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
#listview {
|
||||
fixed-height: 0;
|
||||
border: 2px 2px 2px 2px;
|
||||
border-color: @border-color;
|
||||
scrollbar: false;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#scrollbar {
|
||||
width: 4px ;
|
||||
border: 0;
|
||||
handle-width: 8px ;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
border: 2px 0px 0px;
|
||||
border-color: @border-color;
|
||||
}
|
||||
|
||||
#mode-switcher {
|
||||
border: 2px 0px 0px ;
|
||||
border-color: @border-color;
|
||||
}
|
||||
|
||||
#button {
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
#button.selected {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
|
||||
#inputbar {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
padding: 2px ;
|
||||
}
|
||||
|
||||
#element {
|
||||
border: 0;
|
||||
padding: 6px ;
|
||||
}
|
||||
|
||||
#element.normal.normal {
|
||||
background-color: @normal-background;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
#element.normal.urgent {
|
||||
background-color: @urgent-background;
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
|
||||
#element.normal.active {
|
||||
background-color: @active-background;
|
||||
text-color: @active-foreground;
|
||||
}
|
||||
|
||||
#element.selected.normal {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
|
||||
#element.selected.urgent {
|
||||
background-color: @selected-urgent-background;
|
||||
text-color: @selected-urgent-foreground;
|
||||
}
|
||||
|
||||
#element.selected.active {
|
||||
background-color: @selected-active-background;
|
||||
text-color: @selected-active-foreground;
|
||||
}
|
||||
|
||||
#element.alternate.normal {
|
||||
background-color: @alternate-normal-background;
|
||||
text-color: @alternate-normal-foreground;
|
||||
}
|
||||
|
||||
#element.alternate.urgent {
|
||||
background-color: @alternate-urgent-background;
|
||||
text-color: @alternate-urgent-foreground;
|
||||
}
|
||||
|
||||
#element.alternate.active {
|
||||
background-color: @alternate-active-background;
|
||||
text-color: @alternate-active-foreground;
|
||||
}
|
9
rofi/.config/rofi/wifimanager.rasi
Normal file
9
rofi/.config/rofi/wifimanager.rasi
Normal file
@ -0,0 +1,9 @@
|
||||
configuration {
|
||||
modi: "wifimanager:wifimanager";
|
||||
font: "Hack Nerd Font 12";
|
||||
}
|
||||
@theme "wifimanager"
|
||||
listview {
|
||||
lines: 6;
|
||||
columns: 1;
|
||||
}
|
128
rofi/.local/bin/rofi/README.md
Normal file
128
rofi/.local/bin/rofi/README.md
Normal file
@ -0,0 +1,128 @@
|
||||
# Bookmark Manager
|
||||
|
||||
## Usage
|
||||
|
||||
```help
|
||||
Usage: ./bm [modifier(s)] command [option(s)]
|
||||
|
||||
Commands :
|
||||
==========
|
||||
-h Print this help
|
||||
-H Print help for legacy usage
|
||||
-v/-V Print the version
|
||||
-a 'URL' Add the URL to bookmark file
|
||||
Options for -a
|
||||
-t "TagList" Tags are sparated by a comma ,
|
||||
-T "Title" Title for this URL (if empty and allowed Title
|
||||
downloaded)
|
||||
-A "accel" Accelerator when search for URLs (start with Accel)
|
||||
Default is FQDN without gTld (and www, and sheme)
|
||||
-F Force the bookmark to be created (even if duplicate
|
||||
or invalid)
|
||||
-p Force the screenshot to be taken
|
||||
|
||||
-l List all URLs (default action, same thing as calling bm without args)
|
||||
Options for -l
|
||||
-z Use the alternate print list
|
||||
-n Sort the results by date
|
||||
-N Sort the results by date (reverse)
|
||||
|
||||
|
||||
-s 'object' Search for bookmarks
|
||||
Options for -s
|
||||
-i Incensitive case search
|
||||
-z Use the alternate print list
|
||||
-n Sort the results by date
|
||||
-N Sort the results by date (reverse)
|
||||
|
||||
-o 'object' Search for bookmarks and open it (use the same argument as for -s)
|
||||
Options for -o
|
||||
-i Incensitive case search
|
||||
-O If more than one answer force the first bookmark to be open
|
||||
-Y If more than one answer force ALL bookmarks to be open
|
||||
|
||||
-x 'object' Search for bookmarks and copy it to clipboard (use the same argument as for -s)
|
||||
Options for -x
|
||||
-i Incensitive case search
|
||||
-X If more than one answer force the first bookmark to be copied
|
||||
-Y If more than one answer force ALL bookmarks to be copied
|
||||
|
||||
-r 'object' Search for bookmarks and Print the recorded associated picture (use the same argument as for -s)
|
||||
Options for -r
|
||||
-i Incensitive case search
|
||||
-O If more than one answer force the first bookmark to have its picture printed
|
||||
-Y If more than one answer force ALL bookmarks to have their picture printed
|
||||
|
||||
-d 'URL' or Delete the URL from bookmark file md5sum or 'URL part'
|
||||
Options for -d
|
||||
-D Delete first occurence only
|
||||
-F Force the bookmark to be deleted (even if duplicate)
|
||||
-p Delete the associated picture (no trash available)
|
||||
|
||||
-g Generate a HTML page with all bookmarks
|
||||
If used more than once, generate a page per tag
|
||||
Options for -g
|
||||
-G "filename" If g==1 then generate then use this filename to generate page
|
||||
-O Open the file when generated
|
||||
|
||||
-P 'object' Generate all Non existant picture (check done for all URL in bm), if none argument.
|
||||
If an argument is given (use the same argument as for -s) only the results will have a picture.
|
||||
Options for -P
|
||||
-F Force the picture to be taken again (even if already exists).
|
||||
|
||||
-L List all tags
|
||||
|
||||
-C Print the color table (usefull for configuration)
|
||||
|
||||
-S Show statistics about bookmarks/tags (and also configuration)
|
||||
Options for -S
|
||||
-p Print the list of orphaned Pictures
|
||||
|
||||
Modifiers :
|
||||
===========
|
||||
-c 'file' Use this configuration file instead of the default one
|
||||
|
||||
-b 'file' Use this bookmark file instead of the default one
|
||||
|
||||
Old Legacy usage still available :
|
||||
Usage: bm [options] [cmd]
|
||||
|
||||
Objects:
|
||||
========
|
||||
:string Search in accelerator list
|
||||
+string Search in tags list
|
||||
=string Search in MD5 list
|
||||
/string Search in URL list
|
||||
string Search in full test
|
||||
|
||||
How to use:
|
||||
===========
|
||||
# add a bookmark with the given url, description, and optional tags
|
||||
$ bm add <url> [desc] [tag...] [accelerator]
|
||||
|
||||
# open the first bookmark matching <query>
|
||||
$ bm open <query>
|
||||
$ bm <query>
|
||||
|
||||
# search the bookmarks via full-text <query>
|
||||
$ bm search <query>
|
||||
|
||||
# list tags
|
||||
$ bm tags
|
||||
|
||||
# list bookmarks available
|
||||
$ bm list
|
||||
$ bm ls
|
||||
$ bm
|
||||
|
||||
# display statistics about the bookmarks
|
||||
$ bm statistics
|
||||
$ bm stats
|
||||
|
||||
# view bookmark screenshots in your default browser
|
||||
$ bm view design
|
||||
$ bm view
|
||||
|
||||
# clear all bookmarks
|
||||
$ bm clear
|
||||
```
|
1099
rofi/.local/bin/rofi/bm
Executable file
1099
rofi/.local/bin/rofi/bm
Executable file
File diff suppressed because it is too large
Load Diff
37
rofi/.local/bin/rofi/bm_add
Executable file
37
rofi/.local/bin/rofi/bm_add
Executable file
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
#-*-coding:utf-8 -*-
|
||||
#Auto updated?
|
||||
# Yes
|
||||
#File:
|
||||
# bm_add
|
||||
#Author:
|
||||
# The-Repo-Club [wayne6324@gmail.com]
|
||||
#Github:
|
||||
# https://github.com/The-Repo-Club/
|
||||
#
|
||||
#Created:
|
||||
# Fri 09 December 2022, 06:43:52 AM [GMT]
|
||||
#Modified:
|
||||
# Fri 09 December 2022, 07:33:31 AM [GMT]
|
||||
#
|
||||
#Description:
|
||||
# <Todo>
|
||||
#
|
||||
#Dependencies:
|
||||
# bm
|
||||
#
|
||||
|
||||
result() {
|
||||
echo -n | rofi -dmenu -p "${1:-Add a bookmark:...}"
|
||||
}
|
||||
|
||||
url="$(result "URL:")"
|
||||
|
||||
if [ -z "$url" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
title="$(result "Title:")"
|
||||
tags="$(result "Tags (comma delimited):")"
|
||||
|
||||
bm -w "$HOME/.config/rofi/bookmarks/" -a "$url" -T "$title" -t "$tags"
|
58
rofi/.local/bin/rofi/bm_remove
Executable file
58
rofi/.local/bin/rofi/bm_remove
Executable file
@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
#-*-coding:utf-8 -*-
|
||||
#Auto updated?
|
||||
# Yes
|
||||
#File:
|
||||
# bm_remove
|
||||
#Author:
|
||||
# The-Repo-Club [wayne6324@gmail.com]
|
||||
#Github:
|
||||
# https://github.com/The-Repo-Club/
|
||||
#
|
||||
#Created:
|
||||
# Fri 09 December 2022, 06:43:41 AM [GMT]
|
||||
#Modified:
|
||||
# Fri 09 December 2022, 07:33:33 AM [GMT]
|
||||
#
|
||||
#Description:
|
||||
# <Todo>
|
||||
#
|
||||
#Dependencies:
|
||||
# bm
|
||||
#
|
||||
# shellcheck disable=all
|
||||
|
||||
bmFile="$HOME/.config/rofi/bookmarks/bm.bmf"
|
||||
|
||||
if [[ ! -f $bmFile ]]; then
|
||||
printf "%s\n" "No current bookmark file found.";
|
||||
exit
|
||||
fi
|
||||
|
||||
declare -A bmarray;
|
||||
|
||||
while IFS=\| read -r md5 date accel url title tags;
|
||||
do
|
||||
bookmark="$title-$url-$tags";
|
||||
bmarray["$bookmark"]="$url";
|
||||
done < "$bmFile"
|
||||
|
||||
function load() {
|
||||
while IFS=\| read -r md5 date accel url title tags;
|
||||
do
|
||||
bookmark="$title-$url-$tags";
|
||||
printf "%s\n" "$bookmark";
|
||||
done < "$bmFile"
|
||||
|
||||
}
|
||||
|
||||
choice=$(load | rofi -dmenu i -p "${1:-Remove a bookmark:...}")
|
||||
|
||||
LOOPSETTING="true"
|
||||
while [ -n "$LOOPSETTING" ]; do
|
||||
[ -n "$choice" ] || exit
|
||||
unset LOOPSETTING
|
||||
case "$choice" in
|
||||
*) bm -w "$HOME/.config/rofi/bookmarks/" -d "${bmarray[$choice]}" -D;;
|
||||
esac
|
||||
done
|
54
rofi/.local/bin/rofi/bm_viewer
Executable file
54
rofi/.local/bin/rofi/bm_viewer
Executable file
@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
#-*-coding:utf-8 -*-
|
||||
#Auto updated?
|
||||
# Yes
|
||||
#File:
|
||||
# bm_viewer
|
||||
#Author:
|
||||
# The-Repo-Club [wayne6324@gmail.com]
|
||||
#Github:
|
||||
# https://github.com/The-Repo-Club/
|
||||
#
|
||||
#Created:
|
||||
# Fri 09 December 2022, 06:43:30 AM [GMT]
|
||||
#Modified:
|
||||
# Fri 09 December 2022, 07:36:51 AM [GMT]
|
||||
#
|
||||
#Description:
|
||||
# <Todo>
|
||||
#
|
||||
#Dependencies:
|
||||
# bm
|
||||
#
|
||||
# shellcheck disable=all
|
||||
|
||||
bmFile="$HOME/.config/rofi/bookmarks/bm.bmf"
|
||||
|
||||
if [[ ! -f $bmFile ]]; then
|
||||
printf "%s\n" "No current bookmark file found.";
|
||||
exit
|
||||
fi
|
||||
|
||||
declare -A bmarray;
|
||||
|
||||
function load() {
|
||||
printf "Add\nRemove\n"
|
||||
while IFS=\| read -r md5 date accel url title tags;
|
||||
do
|
||||
bookmark="$title-$url-$tags";
|
||||
printf "%s\n" "$title";
|
||||
done < "$bmFile"
|
||||
}
|
||||
|
||||
choice=$(load | rofi -dmenu)
|
||||
|
||||
LOOPSETTING="true"
|
||||
while [ -n "$LOOPSETTING" ]; do
|
||||
[ -n "$choice" ] || exit
|
||||
unset LOOPSETTING
|
||||
case "$choice" in
|
||||
Add) bm_add ;;
|
||||
Remove) bm_remove ;;
|
||||
*) bm -w "$HOME/.config/rofi/bookmarks/" -o "${bmarray[$choice]}";;
|
||||
esac
|
||||
done
|
27
rofi/.local/bin/rofi/menu
Executable file
27
rofi/.local/bin/rofi/menu
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
#-*-coding:utf-8 -*-
|
||||
#Auto updated?
|
||||
# Yes
|
||||
#File:
|
||||
# menu
|
||||
#Author:
|
||||
# The-Repo-Club [wayne6324@gmail.com]
|
||||
#Github:
|
||||
# https://github.com/The-Repo-Club/
|
||||
#
|
||||
#Created:
|
||||
# Wed 10 March 2021, 12:34:47 PM [GMT+1]
|
||||
#Modified:
|
||||
# Thu 08 December 2022, 07:37:35 AM [GMT]
|
||||
#
|
||||
#Description:
|
||||
# <Todo>
|
||||
#
|
||||
#Dependencies:
|
||||
# rofi
|
||||
#
|
||||
# shellcheck disable=all
|
||||
|
||||
programs=$(compgen -c | sort -u | tail -n +9)
|
||||
cmd=$(echo -e "$programs" | rofi -dmenu -p "Programs" -mesg "Select a program.")
|
||||
exec $cmd
|
61
rofi/.local/bin/rofi/music
Executable file
61
rofi/.local/bin/rofi/music
Executable file
@ -0,0 +1,61 @@
|
||||
#!/usr/bin/env bash
|
||||
# -*-coding:utf-8 -*-
|
||||
# Auto updated?
|
||||
# Yes
|
||||
#File :
|
||||
# repomenue_music
|
||||
#Author:
|
||||
# The-Repo-Club [wayne6324@gmail.com]
|
||||
#Github:
|
||||
# https://github.com/The-Repo-Club/
|
||||
#
|
||||
# Created:
|
||||
# Wed 10 March 2021, 12:34:47 PM [GMT]
|
||||
# Modified:
|
||||
# Wed 07 December 2022, 11:01:08 PM [GMT]
|
||||
#
|
||||
# Description:
|
||||
# <Todo>
|
||||
#
|
||||
# shellcheck disable=all
|
||||
|
||||
MUSICPLAYER="ffplay -nodisp"
|
||||
PLAYING_MSG=" Currently Playing :: "
|
||||
|
||||
for Song in "$HOME/Music/"*; do
|
||||
if [ -f "$Song" ]; then
|
||||
Name=${Song##*/}
|
||||
case $Name in
|
||||
*.mp3 | *.flac | *.wav | .ogg)
|
||||
options+=${Song##*/}$'\n'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
CHOICE=$(rofi -dmenu -no-custom -p "Muisc Player" -kb-custom-1 "Alt+Return" -mesg "${PLAYING_MSG}" "$@" <<ENDOPTS
|
||||
${options::-1}
|
||||
ENDOPTS
|
||||
)
|
||||
|
||||
ret=$?
|
||||
|
||||
if [[ $ret -eq 0 ]]; then
|
||||
case $CHOICE in
|
||||
*.mp3 | *.flac | *.wav | *.ogg)
|
||||
folder=$HOME/Music
|
||||
$MUSICPLAYER "$folder/$CHOICE" &
|
||||
;;
|
||||
*)
|
||||
echo "Program terminated." && exit
|
||||
;;
|
||||
esac
|
||||
elif [[ $ret -gt 1 ]]; then
|
||||
if [[ $ret -eq 10 ]]; then
|
||||
echo "Option selected (stdout): $CHOICE"
|
||||
echo "Return code: $ret"
|
||||
elif [[ $ret -eq 11 ]]; then
|
||||
echo "Option selected (stdout): $CHOICE"
|
||||
echo "Return code: $ret"
|
||||
fi
|
||||
exit $ret
|
||||
fi
|
897
rofi/.local/bin/rofi/passmenu
Executable file
897
rofi/.local/bin/rofi/passmenu
Executable file
@ -0,0 +1,897 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# passmenu
|
||||
# (c) 2022 Wayne Wesley <wayne6324@gmail.com>
|
||||
basecommand="$0"
|
||||
|
||||
# set default settings
|
||||
_rofi () {
|
||||
rofi -no-auto-select -i "$@"
|
||||
}
|
||||
|
||||
_pwgen () {
|
||||
pwgen -y "$@"
|
||||
}
|
||||
|
||||
_image_viewer () {
|
||||
feh -
|
||||
}
|
||||
|
||||
_clip_in_primary() {
|
||||
xclip
|
||||
}
|
||||
|
||||
_clip_in_clipboard() {
|
||||
xclip -selection clipboard
|
||||
}
|
||||
|
||||
_clip_out_primary() {
|
||||
xclip -o
|
||||
}
|
||||
|
||||
_clip_out_clipboard() {
|
||||
xclip --selection clipboard -o
|
||||
}
|
||||
|
||||
|
||||
config_dir=${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
cache_dir=${XDG_CACHE_HOME:-$HOME/.cache}
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
listgpg () {
|
||||
mapfile -d '' pw_list < <(find -L . -name '*.gpg' -print0)
|
||||
pw_list=("${pw_list[@]#./}")
|
||||
printf '%s\n' "${pw_list[@]}" | sort -n
|
||||
}
|
||||
|
||||
# get all password files and output as newline-delimited text
|
||||
list_passwords() {
|
||||
cd "${root}" || exit
|
||||
mapfile -t pw_list < <(listgpg)
|
||||
printf '%s\n' "${pw_list[@]%.gpg}" | sort -n
|
||||
}
|
||||
|
||||
doClip () {
|
||||
case "$clip" in
|
||||
"primary") _clip_in_primary ;;
|
||||
"clipboard") _clip_in_clipboard ;;
|
||||
"both") _clip_in_primary; _clip_out_primary | _clip_in_clipboard;;
|
||||
esac
|
||||
}
|
||||
|
||||
checkIfPass () {
|
||||
printf '%s\n' "${root}: $selected_password" >| "$cache_dir/passmenu/last_used"
|
||||
}
|
||||
|
||||
|
||||
autopass () {
|
||||
x_repeat_enabled=$(xset q | awk '/auto repeat:/ {print $3}')
|
||||
xset r off
|
||||
|
||||
rm -f "$cache_dir/passmenu/last_used"
|
||||
printf '%s\n' "${root}: $selected_password" > "$cache_dir/passmenu/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 "passmenu" "finished typing password";
|
||||
fi
|
||||
elif [[ $notify == "false" ]]; then
|
||||
if [[ "${stuff[notify]}" == "true" ]]; then
|
||||
notify-send "passmenu" "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 "passmenu" "Copied Password\\nClearing in $clip_clear seconds"
|
||||
fi
|
||||
|
||||
if [[ $notify == "true" ]]; then
|
||||
(sleep $clip_clear; printf '%s' "" | _clip_in_primary; printf '%s' "" | _clip_in_clipboard | notify-send "passmenu" "Clipboard cleared") &
|
||||
elif [[ $notify == "false" ]]; then
|
||||
(sleep $clip_clear; printf '%s' "" | _clip_in_primary; printf '%s' "" | _clip_in_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 "passmenu > ")"
|
||||
|
||||
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"
|
||||
-mesg "PW Store: ${root}"
|
||||
-p "passmenu > " )
|
||||
|
||||
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 () {
|
||||
_rofi -dmenu -mesg "Hint: All hotkeys are configurable in config file" -p "Help > " <<- EOM
|
||||
${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)
|
||||
EOM
|
||||
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 "passmenu" "Copied Password\\nClearing in $clip_clear seconds"
|
||||
fi
|
||||
if [[ $notify == "true" ]]; then
|
||||
(sleep $clip_clear; printf '%s' "" | _clip_in_primary; printf '%s' "" | _clip_in_clipboard | notify-send "passmenu" "Clipboard cleared") &
|
||||
elif [[ $notify == "false" ]]; then
|
||||
(sleep $clip_clear; printf '%s' "" | _clip_in_primary; printf '%s' "" | _clip_in_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
|
||||
}
|
||||
|
||||
edit_pass() {
|
||||
if [[ $edit_new_pass == "true" ]]; then
|
||||
PASSWORD_STORE_DIR="${root}" pass edit "${1}"
|
||||
fi
|
||||
}
|
||||
|
||||
insertPass () {
|
||||
url=$(_clip_out_clipboard)
|
||||
|
||||
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 -password -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 && edit_pass "${name}"
|
||||
else
|
||||
pass_content=("${pw}"
|
||||
"---"
|
||||
"${USERNAME_field}: ${user}"
|
||||
)
|
||||
printf '%s\n' "${pass_content[@]}" | PASSWORD_STORE_DIR="${root}" pass insert -m "${name}" > /dev/null && edit_pass "${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 && edit_pass "${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 && edit_pass "${group}/${name}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
help_msg () {
|
||||
cat <<'EOF'
|
||||
Usage:
|
||||
passmenu [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
|
||||
|
||||
passmenu version 1.0.0
|
||||
EOF
|
||||
}
|
||||
|
||||
get_config_file () {
|
||||
configs=("$ROFI_PASS_CONFIG"
|
||||
"$config_dir/rofi/passmenu/config"
|
||||
"/etc/passmenu.conf")
|
||||
|
||||
# return the first config file with a valid path
|
||||
for config in "${configs[@]}"; do
|
||||
# '-n' is needed in case ROFI_PASS_CONFIG is not set
|
||||
if [[ -n "${config}" && -f "${config}" ]]; then
|
||||
printf "%s" "$config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
main () {
|
||||
# load config file
|
||||
config_file="$(get_config_file)"
|
||||
[[ -n "$config_file" ]] && source "$config_file"
|
||||
|
||||
# create tmp dir
|
||||
if [[ ! -d "$cache_dir/passmenu" ]]; then
|
||||
mkdir -p "$cache_dir/passmenu"
|
||||
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 "$cache_dir/passmenu/last_used" ]] && [[ $1 == "--last-used" || $1 == "--show-last" ]]; then
|
||||
roots=("$(awk -F ': ' '{ print $1 }' "$cache_dir/passmenu/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 "$cache_dir/passmenu/last_used" ]]; then
|
||||
entry="$(awk -F ': ' '{ print $2 }' "$cache_dir/passmenu/last_used")"
|
||||
fi
|
||||
mainMenu
|
||||
;;
|
||||
--show-last)
|
||||
if [[ -r "$cache_dir/passmenu/last_used" ]]; then
|
||||
selected_password="$(awk -F ': ' '{ print $2 }' "$cache_dir/passmenu/last_used")" viewEntry
|
||||
else
|
||||
mainMenu
|
||||
fi
|
||||
;;
|
||||
--bmarks)
|
||||
mainMenu --bmarks;
|
||||
;;
|
||||
*)
|
||||
mainMenu
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
292
rofi/.local/bin/rofi/powermenu
Executable file
292
rofi/.local/bin/rofi/powermenu
Executable file
@ -0,0 +1,292 @@
|
||||
#!/usr/bin/env bash
|
||||
#-*-coding:utf-8 -*-
|
||||
#Auto updated?
|
||||
# Yes
|
||||
#File:
|
||||
# powermenu
|
||||
#Author:
|
||||
# The-Repo-Club [wayne6324@gmail.com]
|
||||
#Github:
|
||||
# https://github.com/The-Repo-Club/
|
||||
#
|
||||
#Created:
|
||||
# Wed 07 December 2022, 11:01:52 PM [GMT]
|
||||
#Modified:
|
||||
# Wed 07 December 2022, 11:02:38 PM [GMT]
|
||||
#
|
||||
#Description:
|
||||
# This script defines just a mode for rofi instead of being a self-contained
|
||||
# executable that launches rofi by itself. This makes it more flexible than
|
||||
# running rofi inside this script as now the user can call rofi as one pleases.
|
||||
# For instance:
|
||||
#
|
||||
# rofi -show powermenu -modi powermenu:~/.config/rofi/powermenu
|
||||
#
|
||||
#Dependencies:
|
||||
# <None>
|
||||
#
|
||||
# shellcheck disable=all
|
||||
|
||||
if [ -z "${ROFI_OUTSIDE}" ]
|
||||
then
|
||||
echo "run this script in rofi".
|
||||
exit
|
||||
fi
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
# All supported choices
|
||||
all=(shutdown reboot suspend hibernate logout lockscreen)
|
||||
|
||||
# By default, show all (i.e., just copy the array)
|
||||
show=("${all[@]}")
|
||||
|
||||
declare -A texts
|
||||
texts[lockscreen]="lock screen"
|
||||
texts[switchuser]="switch user"
|
||||
texts[logout]="log out"
|
||||
texts[suspend]="suspend"
|
||||
texts[hibernate]="hibernate"
|
||||
texts[reboot]="reboot"
|
||||
texts[shutdown]="shut down"
|
||||
|
||||
declare -A icons
|
||||
icons[lockscreen]="\uf023"
|
||||
icons[switchuser]="\uf518"
|
||||
icons[logout]="\uf842"
|
||||
icons[suspend]="\uf9b1"
|
||||
icons[hibernate]="\uf7c9"
|
||||
icons[reboot]="\ufc07"
|
||||
icons[shutdown]="\uf011"
|
||||
icons[cancel]="\u00d7"
|
||||
|
||||
declare -A actions
|
||||
actions[lockscreen]="multimonitorlock -l -- --time-str=\"%I:%M:%S %p\""
|
||||
actions[logout]="pkill -KILL -u ${USER}"
|
||||
actions[suspend]="systemctl suspend"
|
||||
actions[hibernate]="systemctl hibernate"
|
||||
actions[reboot]="systemctl reboot"
|
||||
actions[shutdown]="systemctl poweroff"
|
||||
|
||||
# By default, ask for confirmation for actions that are irreversible
|
||||
confirmations=(reboot shutdown logout)
|
||||
|
||||
# By default, no dry run
|
||||
dryrun=false
|
||||
showsymbols=true
|
||||
|
||||
getuptime() {
|
||||
uptime -p >/dev/null 2>&1
|
||||
|
||||
if [ "$?" -eq 0 ]; then
|
||||
# Supports most Linux distro
|
||||
# when the machine is up for less than '0' minutes then
|
||||
# 'uptime -p' returns ONLY 'up', so we need to set a default value
|
||||
UP_SET_OR_EMPTY=$(uptime -p | awk -F 'up ' '{print $2}')
|
||||
UP=${UP_SET_OR_EMPTY:-'less than a minute'}
|
||||
else
|
||||
# Supports Mac OS X, Debian 7, etc
|
||||
UP=$(uptime | sed -E 's/^[^,]*up *//; s/mins/minutes/; s/hrs?/hours/;
|
||||
s/([[:digit:]]+):0?([[:digit:]]+)/\1 hours, \2 minutes/;
|
||||
s/^1 hours/1 hour/; s/ 1 hours/ 1 hour/;
|
||||
s/min,/minutes,/; s/ 0 minutes,/ less than a minute,/; s/ 1 minutes/ 1 minute/;
|
||||
s/ / /; s/, *[[:digit:]]* users?.*//')
|
||||
fi
|
||||
|
||||
state="$UP"
|
||||
}
|
||||
|
||||
function check_valid {
|
||||
option="$1"
|
||||
shift 1
|
||||
for entry in "${@}"
|
||||
do
|
||||
if [ -z "${actions[$entry]+x}" ]
|
||||
then
|
||||
echo "Invalid choice in $option: $entry" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Parse command-line options
|
||||
parsed=$(getopt --options=h --longoptions=help,dry-run,confirm:,choices:,choose:,symbols,no-symbols --name "$0" -- "$@")
|
||||
if [ $? -ne 0 ]; then
|
||||
echo 'Terminating...' >&2
|
||||
exit 1
|
||||
fi
|
||||
eval set -- "$parsed"
|
||||
unset parsed
|
||||
while true; do
|
||||
case "$1" in
|
||||
"-h"|"--help")
|
||||
echo "rofi-power-menu - a power menu mode for Rofi"
|
||||
echo
|
||||
echo "Usage: rofi-power-menu [--choices CHOICES] [--confirm CHOICES]"
|
||||
echo " [--choose CHOICE] [--dry-run] [--symbols|--no-symbols]"
|
||||
echo
|
||||
echo "Use with Rofi in script mode. For instance, to ask for shutdown or reboot:"
|
||||
echo
|
||||
echo " rofi -show menu -modi \"menu:rofi-power-menu --choices=shutdown/reboot\""
|
||||
echo
|
||||
echo "Available options:"
|
||||
echo " --dry-run Don't perform the selected action but print it to stderr."
|
||||
echo " --choices CHOICES Show only the selected choices in the given order. Use / "
|
||||
echo " as the separator. Available choices are lockscreen, logout,"
|
||||
echo " suspend, hibernate, reboot and shutdown. By default, all"
|
||||
echo " available choices are shown."
|
||||
echo " --confirm CHOICES Require confirmation for the gives choices only. Use / as"
|
||||
echo " the separator. Available choices are lockscreen, logout,"
|
||||
echo " suspend, hibernate, reboot and shutdown. By default, only"
|
||||
echo " irreversible actions logout, reboot and shutdown require"
|
||||
echo " confirmation."
|
||||
echo " --choose CHOICE Preselect the given choice and only ask for a confirmation"
|
||||
echo " (if confirmation is set to be requested). It is strongly"
|
||||
echo " recommended to combine this option with --confirm=CHOICE"
|
||||
echo " if the choice wouldn't require confirmation by default."
|
||||
echo " Available choices are lockscreen, logout, suspend,"
|
||||
echo " hibernate, reboot and shutdown."
|
||||
echo " --[no-]symbols Show Unicode symbols or not. Requires a font with support"
|
||||
echo " for the symbols. Use, for instance, fonts from the"
|
||||
echo " Nerdfonts collection. By default, they are shown"
|
||||
echo " -h,--help Show this help text."
|
||||
exit 0
|
||||
;;
|
||||
"--dry-run")
|
||||
dryrun=true
|
||||
shift 1
|
||||
;;
|
||||
"--confirm")
|
||||
IFS='/' read -ra confirmations <<< "$2"
|
||||
check_valid "$1" "${confirmations[@]}"
|
||||
shift 2
|
||||
;;
|
||||
"--choices")
|
||||
IFS='/' read -ra show <<< "$2"
|
||||
check_valid "$1" "${show[@]}"
|
||||
shift 2
|
||||
;;
|
||||
"--choose")
|
||||
# Check that the choice is valid
|
||||
check_valid "$1" "$2"
|
||||
selectionID="$2"
|
||||
shift 2
|
||||
;;
|
||||
"--symbols")
|
||||
showsymbols=true
|
||||
shift 1
|
||||
;;
|
||||
"--no-symbols")
|
||||
showsymbols=false
|
||||
shift 1
|
||||
;;
|
||||
"--")
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Internal error" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Define the messages after parsing the CLI options so that it is possible to
|
||||
# configure them in the future.
|
||||
|
||||
function write_message {
|
||||
icon="<span font_size=\"medium\">$1</span>"
|
||||
text="<span font_size=\"medium\">$2</span>"
|
||||
if [ "$showsymbols" = "true" ]
|
||||
then
|
||||
echo -n "\u200e$icon \u2068$text\u2069"
|
||||
else
|
||||
echo -n "$text"
|
||||
fi
|
||||
}
|
||||
|
||||
function print_selection {
|
||||
echo -e "$1" | $(read -r -d '' entry; echo "echo $entry")
|
||||
}
|
||||
|
||||
declare -A messages
|
||||
declare -A confirmationMessages
|
||||
for entry in "${all[@]}"
|
||||
do
|
||||
messages[$entry]=$(write_message "${icons[$entry]}" "${texts[$entry]^}")
|
||||
done
|
||||
for entry in "${all[@]}"
|
||||
do
|
||||
confirmationMessages[$entry]=$(write_message "${icons[$entry]}" "Yes, ${texts[$entry]}")
|
||||
done
|
||||
confirmationMessages[cancel]=$(write_message "${icons[cancel]}" "No, cancel")
|
||||
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
# If arguments given, use those as the selection
|
||||
selection="${*}"
|
||||
else
|
||||
# Otherwise, use the CLI passed choice if given
|
||||
if [ -n "${selectionID+x}" ]
|
||||
then
|
||||
selection="${messages[$selectionID]}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Don't allow custom entries
|
||||
echo -e "\0no-custom\x1ftrue"
|
||||
|
||||
echo -e "\0markup-rows\x1ftrue"
|
||||
|
||||
if [ -z "${selection+x}" ]
|
||||
then
|
||||
getuptime
|
||||
echo -e "\0prompt\x1fPower Menu"
|
||||
echo -en "\0message\x1f\tUptime :: ${state^}\n"
|
||||
for entry in "${show[@]}"
|
||||
do
|
||||
echo -e "${messages[$entry]}\0icon\x1f${icons[$entry]}"
|
||||
done
|
||||
else
|
||||
for entry in "${show[@]}"
|
||||
do
|
||||
if [ "$selection" = "$(print_selection "${messages[$entry]}")" ]
|
||||
then
|
||||
# Check if the selected entry is listed in confirmation requirements
|
||||
for confirmation in "${confirmations[@]}"
|
||||
do
|
||||
if [ "$entry" = "$confirmation" ]
|
||||
then
|
||||
# Ask for confirmation
|
||||
echo -e "\0prompt\x1fAre you sure"
|
||||
echo -e "${confirmationMessages[$entry]}\0icon\x1f${icons[$entry]}"
|
||||
echo -e "${confirmationMessages[cancel]}\0icon\x1f${icons[cancel]}"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
# If not, then no confirmation is required, so mark confirmed
|
||||
selection=$(print_selection "${confirmationMessages[$entry]}")
|
||||
fi
|
||||
if [ "$selection" = "$(print_selection "${confirmationMessages[$entry]}")" ]
|
||||
then
|
||||
if [ $dryrun = true ]
|
||||
then
|
||||
# Tell what would have been done
|
||||
echo "Selected: $entry" >&2
|
||||
else
|
||||
# Perform the action
|
||||
${actions[$entry]}
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
if [ "$selection" = "$(print_selection "${confirmationMessages[cancel]}")" ]
|
||||
then
|
||||
# Do nothing
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
# The selection didn't match anything, so raise an error
|
||||
echo "Invalid selection: $selection" >&2
|
||||
exit 1
|
||||
fi
|
223
rofi/.local/bin/rofi/wifimanager
Executable file
223
rofi/.local/bin/rofi/wifimanager
Executable file
@ -0,0 +1,223 @@
|
||||
#!/bin/sh
|
||||
#-*-coding:utf-8 -*-
|
||||
#Auto updated?
|
||||
# Yes
|
||||
#File:
|
||||
# wifimanager
|
||||
#Author:
|
||||
# The-Repo-Club [wayne6324@gmail.com]
|
||||
#Github:
|
||||
# https://github.com/The-Repo-Club/
|
||||
#
|
||||
#Created:
|
||||
# Wed 07 December 2022, 11:01:26 PM [GMT]
|
||||
#Modified:
|
||||
# Wed 07 December 2022, 11:01:44 PM [GMT]
|
||||
#
|
||||
#Description:
|
||||
# <Todo>
|
||||
#
|
||||
#Dependencies:
|
||||
# rofi nmcli(Network Manager) dunst
|
||||
#
|
||||
# shellcheck disable=all
|
||||
|
||||
if [ -z "${ROFI_OUTSIDE}" ]
|
||||
then
|
||||
echo "run this script in rofi".
|
||||
exit
|
||||
fi
|
||||
|
||||
CACHE_DIR="$HOME/.cache/rofi/network"
|
||||
[ ! -d $CACHE_DIR ] && mkdir -p "$CACHE_DIR"
|
||||
|
||||
station=$(nmcli device | grep "wifi " | awk '{ printf $1 }') # Device Station name
|
||||
|
||||
function network_status () {
|
||||
state=$(nmcli -fields WIFI g | sed -n 2p | xargs) # Wifi enbaled or disabled
|
||||
connection=$(nmcli connection show --active | grep "wifi" | awk -F "wifi" '{ print $1 }' | sed -e '1{s/[^ ]\+\s*$//}')
|
||||
}
|
||||
|
||||
# Don't allow custom entries
|
||||
echo -e "\0no-custom\x1ftrue"
|
||||
|
||||
function network_options() {
|
||||
if [[ "$state" == "enabled" ]]; then
|
||||
if [ -z "$connection" ]; then
|
||||
echo "-=|> Connect to a Network"
|
||||
echo "-=|> Connect to a Hidden Network"
|
||||
elif [ ! -z "$connection" ]; then
|
||||
echo "-=|> Connect to a Network"
|
||||
echo "-=|> Connect to a Hidden Network"
|
||||
echo "-=|> Disconnect Current Network"
|
||||
fi
|
||||
echo "-=|> Disable Wifi"
|
||||
elif [[ "$state" =~ "disabled" ]]; then
|
||||
echo "-=|> Enable Wifi"
|
||||
fi
|
||||
}
|
||||
|
||||
function main_scrn() { # Main window to be displayed on start
|
||||
rm $CACHE_DIR/* >/dev/null 2>&1
|
||||
network_status
|
||||
network_options
|
||||
echo -en "\x00prompt\x1fWifi\n"
|
||||
echo -en "\0message\x1f\tWIFI Status :: ${state^}\t\tConnected to :: ${connection}\n"
|
||||
echo -en "-=|> Delete existing connections\n"
|
||||
echo -en "-=|> Refresh\n"
|
||||
}
|
||||
|
||||
function show_available_networks(){ # Output the list of available Wifi networks
|
||||
nmcli -f BSSID,SSID device wifi list > "$CACHE_DIR/available_networks"
|
||||
echo -en "\0message\x1f $(cat "$CACHE_DIR/available_networks" | sed '1!d')\n"
|
||||
echo "$(cat "$CACHE_DIR/available_networks" | sed '1d')"
|
||||
echo "-=|> Rescan available networks"
|
||||
echo "<|=- To Previous Menu"
|
||||
}
|
||||
|
||||
function saved_connections() {
|
||||
echo "delete_network" > "$CACHE_DIR/delete_connection"
|
||||
echo -en "\0message\x1f\t\t\t\t\t\t[Enter] - Delete selected connection\n"
|
||||
echo -en "UUID\t\t\t\t TYPE\tNAME\0nonselectable\x1ftrue\n"
|
||||
echo -en "\0active\x1f0\n"
|
||||
nmcli --fields UUID,TYPE,NAME con show | grep wifi
|
||||
echo "<|=- To Previous Menu"
|
||||
}
|
||||
|
||||
function error_status() {
|
||||
if [[ "$status" =~ "Connection successfully activated " ]]; then # If connected successfully, then notify and exit
|
||||
notify-send "Connected to " "$SSID"
|
||||
exit 0
|
||||
elif [[ "$status" =~ "Device '$station' successfully activated with " ]]; then # If connected successfully, then notify and exit
|
||||
notify-send "Network " "$(echo $status | cut -c 6-)"
|
||||
rm $CACHE_DIR/*
|
||||
exit 0
|
||||
else
|
||||
if [ -f $CACHE_DIR/network_ssid ]; then
|
||||
echo -en "\0message\x1f! Connection Failed. This is normal if connecting to a hidden network, Try again.\n"
|
||||
elif [ -f $CACHE_DIR/network_bssid ]; then
|
||||
echo -en "\0message\x1f! Connection Failed! Check your password.\n"
|
||||
fi
|
||||
echo "$status" # If failed to connect, shows the error code and asks for password
|
||||
echo "<|=- To Previous Menu"
|
||||
fi
|
||||
}
|
||||
|
||||
function get_ssid() {
|
||||
echo "hidden" > "$CACHE_DIR/get_ssid"
|
||||
echo -en "\00prompt\x1fEnter SSID\n"
|
||||
echo -en "\0message\x1f# Type your network SSID (Network Name).\n"
|
||||
echo "<|=- To Previous Menu"
|
||||
}
|
||||
|
||||
function get_password() {
|
||||
echo -en "\00prompt\x1fPassword\n"
|
||||
echo -en "\0message\x1f# Type your network security passphrase here.\n"
|
||||
echo "<|=- To Previous Menu"
|
||||
}
|
||||
|
||||
function restore_view() {
|
||||
if [ -f $CACHE_DIR/delete_connection ]; then
|
||||
saved_connections
|
||||
elif [ -f $CACHE_DIR/available_networks ]; then
|
||||
show_available_networks
|
||||
elif [ -f $CACHE_DIR/network_selected ]; then
|
||||
show_available_networks
|
||||
elif [ -f $CACHE_DIR/get_ssid ]; then
|
||||
get_ssid
|
||||
elif [ -f $CACHE_DIR/network_bssid ] || [ -f $CACHE_DIR/network_ssid ]; then
|
||||
get_password
|
||||
else
|
||||
main_scrn
|
||||
fi
|
||||
}
|
||||
|
||||
function show_previous_menu() {
|
||||
if [ -f $CACHE_DIR/network_bssid ]; then
|
||||
rm $CACHE_DIR/network_bssid
|
||||
show_available_networks
|
||||
elif [ -f $CACHE_DIR/network_ssid ]; then
|
||||
rm $CACHE_DIR/network_ssid
|
||||
get_ssid
|
||||
else
|
||||
main_scrn
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ "${ROFI_RETV}" == "0" ]]; then
|
||||
main_scrn
|
||||
|
||||
elif [[ "${ROFI_RETV}" == "1" ]]; then
|
||||
if [[ "$@" == "<|=- To Previous Menu" ]]; then
|
||||
show_previous_menu
|
||||
elif [[ "$@" == "-=|> Refresh" ]]; then
|
||||
main_scrn
|
||||
elif [[ "$@" == "-=|> Disable Wifi" ]]; then
|
||||
nmcli radio wifi off
|
||||
restore_view
|
||||
elif [[ "$@" == "-=|> Enable Wifi" ]]; then
|
||||
nmcli radio wifi on
|
||||
restore_view
|
||||
elif [[ "$@" == "-=|> Connect to a Network" ]]; then
|
||||
show_available_networks
|
||||
elif [[ "$@" == "-=|> Connect to a Hidden Network" ]]; then
|
||||
get_ssid
|
||||
elif [[ "$@" == "-=|> Disconnect Current Network" ]]; then # Disconnect any connected network
|
||||
con_uuid=$(nmcli connection show --active | grep "wifi" | awk -F "wifi" '{print $1}' | awk '{print $NF}' | xargs)
|
||||
nmcli connection down "$con_uuid" > /dev/null 2>&1
|
||||
restore_view
|
||||
elif [[ "$@" == "-=|> Delete existing connections" ]]; then # Opens the saved networks list window
|
||||
saved_connections
|
||||
elif [ -f $CACHE_DIR/delete_connection ]; then
|
||||
connection_uuid=$(echo "$@" | awk '{print $1}')
|
||||
nmcli con delete uuid "$connection_uuid" >/dev/null 2>&1
|
||||
restore_view
|
||||
elif [ -f $CACHE_DIR/available_networks ]; then
|
||||
if [[ "$@" == "-=|> Rescan available networks" ]]; then
|
||||
nmcli device wifi rescan >/dev/null 2>&1
|
||||
restore_view
|
||||
else
|
||||
rm $CACHE_DIR/available_networks
|
||||
echo "$@" > "$CACHE_DIR/network_selected"
|
||||
BSSID=$(echo "$@" | awk '{print $1}')
|
||||
SSID=$(echo "$@" | cut -c 20- | xargs)
|
||||
SECURITY=$(nmcli -f BSSID,SECURITY device wifi | grep "$BSSID" | awk -F " " '{print $2}' | xargs)
|
||||
if [[ $(nmcli -f NAME con show | grep -o -m 1 "$SSID") == "$SSID" ]]; then
|
||||
status=$(nmcli connection up "$SSID")
|
||||
error_status
|
||||
exit 0
|
||||
elif [[ "$SECURITY" =~ "--" ]] || [ -z "$SECURITY" ]; then
|
||||
nmcli device wifi connect "$BSSID" >/dev/null 2>&1
|
||||
notify-send "Successfully connected to " "$SSID"
|
||||
elif [[ "$SECURITY" =~ "WPA" ]] || [ "$SECURITY" =~ "WEP" ]; then
|
||||
rm $CACHE_DIR/network_selected
|
||||
echo "$BSSID" > "$CACHE_DIR/network_bssid"
|
||||
get_password
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [[ "${ROFI_RETV}" == "2" ]]; then
|
||||
if [ -f $CACHE_DIR/get_ssid ]; then
|
||||
rm $CACHE_DIR/get_ssid
|
||||
echo "$@" > "$CACHE_DIR/network_ssid"
|
||||
get_password
|
||||
elif [ -f $CACHE_DIR/network_bssid ]; then
|
||||
PASSWORD="$@"
|
||||
BSSID=$(cat "$CACHE_DIR/network_bssid")
|
||||
status=$(nmcli device wifi connect "$BSSID" password "$PASSWORD")
|
||||
error_status
|
||||
elif [ -f $CACHE_DIR/network_ssid ]; then
|
||||
PASSWORD="$@"
|
||||
SSID=$(cat "$CACHE_DIR/network_ssid")
|
||||
status=$(nmcli device wifi connect "$SSID" password "$PASSWORD" hidden true)
|
||||
error_status
|
||||
else
|
||||
restore_view
|
||||
fi
|
||||
|
||||
else
|
||||
restore_view
|
||||
echo -en "\0message\x1f# Custom key events are not valid in this mode.\n"
|
||||
|
||||
fi
|
269
rofi/.local/bin/rofi/youtube_subs
Executable file
269
rofi/.local/bin/rofi/youtube_subs
Executable file
@ -0,0 +1,269 @@
|
||||
#!/usr/bin/env bash
|
||||
#-*-coding:utf-8 -*-
|
||||
#Auto updated?
|
||||
# Yes
|
||||
#File:
|
||||
# youtube_subs
|
||||
#Author:
|
||||
# The-Repo-Club [wayne6324@gmail.com]
|
||||
#Github:
|
||||
# https://github.com/The-Repo-Club/
|
||||
#
|
||||
#Created:
|
||||
# Sun 03 January 2021, 05:09:33 PM [GMT]
|
||||
#Modified:
|
||||
# Thu 08 December 2022, 07:36:45 AM [GMT]
|
||||
#
|
||||
#Description:
|
||||
# Watch your youtube subscriptions without a youtube account
|
||||
# via curl, repomenu, browser and basic unix commands.
|
||||
#
|
||||
# The $SUBS_FILE is a text file containing usernames or channel IDs
|
||||
# comments and blank lines are ignored.
|
||||
#
|
||||
#
|
||||
#Dependencies:
|
||||
# rofi
|
||||
#
|
||||
|
||||
rofis() {
|
||||
rofi -dmenu -p "Youtube Subs:" -mesg "Select a video."
|
||||
}
|
||||
|
||||
# -/-/-/-/- Settings -/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/
|
||||
: "${SUBS_FILE:=${HOME}/.config/rofi/configs/subs.ini}"
|
||||
: "${SUBS_MENU_PROG:=rofis}"
|
||||
: "${SUBS:=${HOME}/.cache/subs}"
|
||||
: "${SUBS_LINKS:=$SUBS/links}"
|
||||
: "${SUBS_CACHE:=$SUBS/cache}"
|
||||
: "${SUBS_SLEEP_VALUE:=0.05}" # raise this if you experience problems
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
SEP=^^^^^ # shouldn't need to change this
|
||||
SUBS_OPEN="mpv --volume=50"
|
||||
# -/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/
|
||||
|
||||
die() {
|
||||
printf >&2 '%s\n' "$*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
usage() {
|
||||
die 'Usage: repomenue_youtube_subs [-c cat_subs] [-g gen_links] [-u update_subs] [-d daemonize]'
|
||||
}
|
||||
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
# Synopsis: $SUBS_FILE [txt] -> $SUBS_LINKS [xml links]
|
||||
#
|
||||
# Updates local cache of xml subscription links from the
|
||||
# subscription file containing either usernames or channel ids.
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
gen_links() {
|
||||
: >"$SUBS_LINKS"
|
||||
|
||||
count=0
|
||||
total=$(sed -e '/^$/d' -e '/^#/d' <"$SUBS_FILE" | wc -l)
|
||||
|
||||
while read -r line; do
|
||||
|
||||
# ignore comments and blank lines
|
||||
case $line in '' | ' ' | '#'*) continue ;; esac
|
||||
|
||||
# strip off in-line comments and any trailing whitespace
|
||||
line=${line%%#*}
|
||||
line=${line%% *}
|
||||
|
||||
count=$((count + 1))
|
||||
|
||||
case $line in
|
||||
UC*)
|
||||
# YT channel IDs always begin with 'UC' and are 24 chars long
|
||||
printf "[%s/%s] using channel ID '%s' for xml link\n" "$count" "$total" "$line"
|
||||
|
||||
[ ${#line} -eq 24 ] &&
|
||||
printf 'https://youtube.com/feeds/videos.xml?%s\n' \
|
||||
"channel_id=$line" >>"$SUBS_LINKS"
|
||||
;;
|
||||
*)
|
||||
# otherwise we are given a username, we must find out its channel ID
|
||||
printf "fetching channel ID for %s...\n" "$line"
|
||||
|
||||
curl -sfL --retry 10 "https://youtube.com/user/$line/about" |
|
||||
while read -r line; do
|
||||
case $line in
|
||||
*channel/UC??????????????????????*)
|
||||
line=${line##*channel/}
|
||||
line=${line%%\"*}
|
||||
printf "[%s/%s] using channel ID '%s' for xml link\n" "$count" "$total" "$line"
|
||||
printf 'https://youtube.com/feeds/videos.xml?channel_id=%s\n' \
|
||||
"$line" >>"$SUBS_LINKS"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done &
|
||||
sleep "${SUBS_SLEEP_VALUE:-0}"
|
||||
;;
|
||||
esac
|
||||
|
||||
done <"$SUBS_FILE"
|
||||
|
||||
count=0
|
||||
while [ "$count" -ne "$total" ]; do
|
||||
count=$(wc -l <"$SUBS_LINKS")
|
||||
printf "[%s/%s] waiting for jobs to complete...\n" "$count" "$total"
|
||||
sleep 0.5
|
||||
done
|
||||
}
|
||||
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
# Synopsis: $1 [LINK] -> $SUBS_CACHE/$chan_name/concat [CHANNEL INFO]
|
||||
#
|
||||
# Takes a channel rss feed link and creates a file
|
||||
# with a line of its videos dates, titles, and urls.
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
get_vids() {
|
||||
data=$(curl -sfL --retry 15 "$1")
|
||||
|
||||
# hide the first <published> tag which is the channel
|
||||
# creation date
|
||||
data=${data#*\<\/published\>}
|
||||
|
||||
# trim off outer <name> tags
|
||||
chan=${data%%</name*}
|
||||
chan=${chan##*name>}
|
||||
|
||||
printf "%s\n" "$data" |
|
||||
while read -r line; do
|
||||
case $line in
|
||||
*'link rel='*)
|
||||
line=${line#*href=\"}
|
||||
line=${line%\"/\>}
|
||||
line=https://${line#*www.}
|
||||
url=$line
|
||||
;;
|
||||
*'<published>'*)
|
||||
line=${line%+00:*}
|
||||
line=${line#*<published>}
|
||||
date=$line
|
||||
;;
|
||||
*'<media:title>'*)
|
||||
line=${line%</*}
|
||||
line=${line#*:title>}
|
||||
title=$line
|
||||
printf '%s\n' \
|
||||
"${date}${SEP}${chan}${SEP}${title}${SEP}${url}" \
|
||||
>>"$SUBS_CACHE/$chan"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
# Updates the local cache of subscriptions. ([-u] flag)
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
update_subs() {
|
||||
[ -f "$SUBS_LINKS" ] || die 'Subs links have not been generated.'
|
||||
|
||||
rm -r "${SUBS_CACHE:-?}" 2>/dev/null || :
|
||||
mkdir -p "$SUBS_CACHE"
|
||||
|
||||
total=$(wc -l <"$SUBS_LINKS")
|
||||
|
||||
count=0
|
||||
while read -r link; do
|
||||
count=$((count + 1))
|
||||
printf 'starting job [%s/%s] for %s\n' "$count" "$total" "$link"
|
||||
get_vids "$link" &
|
||||
sleep "${SUBS_SLEEP_VALUE:-0}"
|
||||
done <"$SUBS_LINKS"
|
||||
|
||||
count=0
|
||||
while [ "$count" -ne "$total" ]; do
|
||||
count=$(printf '%s\n' "$SUBS_CACHE"/* | wc -l)
|
||||
printf "[%s/%s] waiting for fetch jobs to complete...\n" "$count" "$total"
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
printf '%s\n\n' 'done!'
|
||||
}
|
||||
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
# Grab current cache of subscriptions, sort by date uploaded
|
||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||
cat_subs() {
|
||||
sort -r "$SUBS_CACHE"/* |
|
||||
while read -r line; do
|
||||
chan=${line#*$SEP}
|
||||
chan=${chan%%$SEP*}
|
||||
title=${line#*$chan$SEP}
|
||||
title=${title%%$SEP*}
|
||||
date=${line%%$SEP*}
|
||||
date=${date#*-}
|
||||
date=${date%T*}
|
||||
printf '[%s %s] %s\n' "$date" "$chan" "$title"
|
||||
done
|
||||
}
|
||||
|
||||
# Split the concatenated lines into entities, send to menu program.
|
||||
# Finally, play the result with mpv.
|
||||
get_sel() {
|
||||
if [ -d "$SUBS_CACHE" ]; then
|
||||
sel=$(cat_subs | $SUBS_MENU_PROG)
|
||||
else
|
||||
die 'Subs cache has not been retrieved.'
|
||||
fi
|
||||
|
||||
[ "$sel" ] || die Interrupted
|
||||
|
||||
chan="${sel#* }"
|
||||
chan="${chan%%] *}"
|
||||
title=${sel#*"$chan"\] }
|
||||
while read -r line; do
|
||||
case $line in
|
||||
*"$SEP$title$SEP"*)
|
||||
url=${line##*$SEP}
|
||||
if [ "$url" ]; then
|
||||
printf 'playing: %s\n' "$url"
|
||||
# Play the selection.
|
||||
# shellcheck disable=2086
|
||||
exec $SUBS_OPEN "$url"
|
||||
fi
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done <"$SUBS_CACHE/$chan"
|
||||
}
|
||||
|
||||
daemonize() {
|
||||
# create a cached copy of the subs file to check for changes
|
||||
# if changes occur, re-generate links automatically
|
||||
daemon_file=${HOME}/.cache/subs_daemon.cache
|
||||
if [ ! -f "$daemon_file" ]; then
|
||||
cp -f "${SUBS_FILE:=${HOME}/.config/repomenu/subs.ini}" "$daemon_file"
|
||||
fi
|
||||
|
||||
while true; do
|
||||
if ! cmp "${SUBS_FILE:=${HOME}/.config/repomenu/subs.ini}" "$daemon_file"; then
|
||||
cp -f "${SUBS_FILE:=${HOME}/.config/repomenu/subs.ini}" "$daemon_file"
|
||||
fi
|
||||
gen_links
|
||||
update_subs
|
||||
interval=${SUBS_DAEMON_INTERVAL:-$((10 * 60))}
|
||||
printf 'Sleeping for %s seconds...\n' "$interval"
|
||||
sleep "$interval"
|
||||
done
|
||||
}
|
||||
|
||||
main() {
|
||||
mkdir -p "$SUBS"
|
||||
|
||||
case ${1#-} in
|
||||
h) usage ;;
|
||||
g) gen_links ;;
|
||||
u) update_subs ;;
|
||||
c) cat_subs ;;
|
||||
d) daemonize ;;
|
||||
*) get_sel ;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
Loading…
Reference in New Issue
Block a user