init
25
README.md
@ -1,2 +1,23 @@
|
|||||||
# dots
|
# edwark43 dotfiles:
|
||||||
dotfiles
|

|
||||||
|
|
||||||
|
<img src="https://github.com/edwark43/dotfiles/misc/assets/readme-preview.png" alt="Rice" align="center" width="100%">
|
||||||
|
|
||||||
|
## Setup:
|
||||||
|
The installer only works for **ARCH** Linux based distros that use systemd.
|
||||||
|
|
||||||
|
<b>Open a terminal in HOME</b>
|
||||||
|
- **First download the installer**
|
||||||
|
```sh
|
||||||
|
curl -L https://is.gd/lkarch -o $HOME/setup.sh
|
||||||
|
```
|
||||||
|
- **Now give it execute permissions**
|
||||||
|
```sh
|
||||||
|
chmod +x setup.sh
|
||||||
|
```
|
||||||
|
- **Finally run the installer**
|
||||||
|
```sh
|
||||||
|
./setup.sh
|
||||||
|
```
|
||||||
|
## Credits
|
||||||
|
- [gh0stzk](https://github.com/gh0stzk)
|
||||||
|
69
config/alacritty/alacritty.yml
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
font:
|
||||||
|
normal:
|
||||||
|
family: JetBrainsMono Nerd Font
|
||||||
|
|
||||||
|
bold:
|
||||||
|
family: JetBrainsMono Nerd Font
|
||||||
|
|
||||||
|
italic:
|
||||||
|
family: JetBrainsMono Nerd Font
|
||||||
|
|
||||||
|
bold_italic:
|
||||||
|
family: JetBrainsMono Nerd Font
|
||||||
|
|
||||||
|
size: 10
|
||||||
|
|
||||||
|
colors:
|
||||||
|
primary:
|
||||||
|
background: '#1f2329'
|
||||||
|
foreground: '#b8bfe5'
|
||||||
|
|
||||||
|
normal:
|
||||||
|
black: '#0f1319'
|
||||||
|
red: '#644d66'
|
||||||
|
green: '#375759'
|
||||||
|
yellow: '#736871'
|
||||||
|
blue: '#3f5273'
|
||||||
|
magenta: '#543f66'
|
||||||
|
cyan: '#324f66'
|
||||||
|
white: '#b3b3b3'
|
||||||
|
|
||||||
|
bright:
|
||||||
|
black: '#b3b3b3'
|
||||||
|
red: '#735771'
|
||||||
|
green: '#3f6566'
|
||||||
|
yellow: '#807476'
|
||||||
|
blue: '#465b80'
|
||||||
|
magenta: '#533969'
|
||||||
|
cyan: '#385a73'
|
||||||
|
white: '#e5e5e5'
|
||||||
|
|
||||||
|
cursor:
|
||||||
|
cursor: '#465b80'
|
||||||
|
text: '#e5e5e5'
|
||||||
|
|
||||||
|
window:
|
||||||
|
padding:
|
||||||
|
x: 15
|
||||||
|
y: 15
|
||||||
|
|
||||||
|
decorations: none
|
||||||
|
|
||||||
|
opacity: 1.0
|
||||||
|
dynamic_title: true
|
||||||
|
|
||||||
|
history: 10000
|
||||||
|
multiplier: 3
|
||||||
|
|
||||||
|
selection:
|
||||||
|
save_to_clipboard: false
|
||||||
|
|
||||||
|
cursor:
|
||||||
|
style:
|
||||||
|
shape: Block
|
||||||
|
blinking: On
|
||||||
|
|
||||||
|
unfocused_hollow: false
|
||||||
|
blink_interval: 550
|
||||||
|
|
||||||
|
live_config_reload: true
|
76
config/bspwm/bspwmrc
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
|
## Fix java applications
|
||||||
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
|
|
||||||
|
# Workspaces
|
||||||
|
|
||||||
|
# Default 1 monitor with 6 workspaces
|
||||||
|
for monitor in "$(xrandr -q | grep -w 'connected' | cut -d' ' -f1)"; do
|
||||||
|
bspc monitor "$monitor" -d '1' '2' '3' '4' '5' '6'
|
||||||
|
done
|
||||||
|
|
||||||
|
# Bspwm Config
|
||||||
|
|
||||||
|
bspc config external_rules_command "$HOME"/.local/bin/externalrules
|
||||||
|
bspc config window_gap -1
|
||||||
|
bspc config split_ratio 0.51
|
||||||
|
bspc config single_monocle true
|
||||||
|
bspc config borderless_monocle false
|
||||||
|
bspc config gapless_monocle false
|
||||||
|
bspc config focus_follows_pointer true
|
||||||
|
bspc config pointer_follows_focus false
|
||||||
|
bspc config pointer_motion_interval 5
|
||||||
|
bspc config pointer_modifier mod4
|
||||||
|
bspc config pointer_action1 move
|
||||||
|
bspc config pointer_action2 resize_side
|
||||||
|
bspc config pointer_action3 resize_corner
|
||||||
|
bspc config border_width 2
|
||||||
|
bspc config top_padding 48
|
||||||
|
bspc config bottom_padding 48
|
||||||
|
bspc config left_padding 2
|
||||||
|
bspc config right_padding 2
|
||||||
|
bspc config normal_border_color "#252533"
|
||||||
|
bspc config active_border_color "#252533"
|
||||||
|
bspc config focused_border_color "#61C766"
|
||||||
|
bspc config presel_feedback_color "#61C766"
|
||||||
|
bspc rule -a scratch sticky=on state=floating focus=on
|
||||||
|
|
||||||
|
# Autostart
|
||||||
|
|
||||||
|
# Set system vars for polybar
|
||||||
|
. setsysvars
|
||||||
|
|
||||||
|
# Terminate already running polybar, sxhkd, dunst, and mpd instances
|
||||||
|
processes=("polybar" "sxhkd" "dunst" "mpd")
|
||||||
|
|
||||||
|
for process in "${processes[@]}"; do
|
||||||
|
if pgrep -f "$process"; then
|
||||||
|
pkill -9 -f "$process" > /dev/null; sleep 0.1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Load bspwm conf, colors, dunst, and bars
|
||||||
|
. "$HOME"/.config/polybar/bar.sh
|
||||||
|
|
||||||
|
pidof -q picom || { picom --config "$HOME"/.config/picom/picom.conf & }
|
||||||
|
|
||||||
|
# Set random wallpaper for actual rice
|
||||||
|
feh -z --no-fehbg --bg-fill "$HOME"/pics/wallpapers
|
||||||
|
|
||||||
|
# Reload sxhkd daemon
|
||||||
|
sxhkd -c "$HOME"/.config/sxhkd/sxhkdrc &
|
||||||
|
|
||||||
|
# Launch dunst notification daemon
|
||||||
|
dunst -config "$HOME"/.config/dunst/dunstrc &
|
||||||
|
|
||||||
|
# Launch polkit
|
||||||
|
pidof -q polkit-gnome-authentication-agent-1 || { /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & }
|
||||||
|
|
||||||
|
# Launch mpd
|
||||||
|
mpd
|
||||||
|
|
||||||
|
# Fix cursor
|
||||||
|
xsetroot -cursor_name left_ptr
|
64
config/dunst/dunstrc
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
[global]
|
||||||
|
title = Dunst
|
||||||
|
class = Dunst
|
||||||
|
monitor = 0
|
||||||
|
follow = mouse
|
||||||
|
width = 300
|
||||||
|
height = 300
|
||||||
|
origin = top-right
|
||||||
|
offset = 10x92
|
||||||
|
indicate_hidden = yes
|
||||||
|
shrink = yes
|
||||||
|
|
||||||
|
transparency = 4
|
||||||
|
separator_height = 2
|
||||||
|
padding = 8
|
||||||
|
horizontal_padding = 11
|
||||||
|
frame_width = 6
|
||||||
|
frame_color = "#1f2329"
|
||||||
|
separator_color = "#3f5273"
|
||||||
|
|
||||||
|
font = JetBrainsMono Nerd Font Medium 9
|
||||||
|
|
||||||
|
line_height = 0
|
||||||
|
markup = full
|
||||||
|
format = "<span size='x-large' font_desc='Cantarell 9' weight='bold' foreground='#f9f9f9'>%s</span>\n%b"
|
||||||
|
alignment = center
|
||||||
|
|
||||||
|
idle_threshold = 120
|
||||||
|
show_age_threshold = 60
|
||||||
|
sort = no
|
||||||
|
word_wrap = yes
|
||||||
|
ignore_newline = no
|
||||||
|
stack_duplicates = false
|
||||||
|
hide_duplicate_count = yes
|
||||||
|
show_indicators = no
|
||||||
|
sticky_history = no
|
||||||
|
history_length = 20
|
||||||
|
always_run_script = true
|
||||||
|
corner_radius = 4
|
||||||
|
icon_position = left
|
||||||
|
max_icon_size = 80
|
||||||
|
|
||||||
|
icon_path = /usr/share/icons/Papirus-Dark/48x48/actions/:/usr/share/icons/Papirus-Dark/48x48/apps/:/usr/share/icons/Papirus-Dark/48x48/devices/:/usr/share/icons/Papirus-Dark/48x48/emblems/:/usr/share/icons/Papirus-Dark/48x48/emotes/:/usr/share/icons/Papirus-Dark/48x48/mimetypes/:/usr/share/icons/Papirus-Dark/48x48/places/:/usr/share/icons/Papirus-Dark/48x48/status/
|
||||||
|
|
||||||
|
browser = brave
|
||||||
|
|
||||||
|
mouse_left_click = close_current
|
||||||
|
mouse_middle_click = do_action
|
||||||
|
mouse_right_click = close_all
|
||||||
|
|
||||||
|
[urgency_low]
|
||||||
|
timeout = 3
|
||||||
|
background = "#1f2329"
|
||||||
|
foreground = "#b3b3b3"
|
||||||
|
|
||||||
|
[urgency_normal]
|
||||||
|
timeout = 6
|
||||||
|
background = "#1f2329"
|
||||||
|
foreground = "#b3b3b3"
|
||||||
|
|
||||||
|
[urgency_critical]
|
||||||
|
timeout = 0
|
||||||
|
background = "#1f2329"
|
||||||
|
foreground = "#b3b3b3"
|
31
config/jgmenu/jgmenurc
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
position_mode = pointer
|
||||||
|
stay_alive = 0
|
||||||
|
tint2_look = 0
|
||||||
|
terminal_exec = alacritty
|
||||||
|
terminal_args = -e
|
||||||
|
menu_width = 160
|
||||||
|
menu_padding_top = 5
|
||||||
|
menu_padding_right = 5
|
||||||
|
menu_padding_bottom = 5
|
||||||
|
menu_padding_left = 5
|
||||||
|
menu_radius = 8
|
||||||
|
menu_border = 0
|
||||||
|
menu_halign = left
|
||||||
|
sub_hover_action = 1
|
||||||
|
item_margin_y = 5
|
||||||
|
item_height = 30
|
||||||
|
item_padding_x = 8
|
||||||
|
item_radius = 6
|
||||||
|
item_border = 0
|
||||||
|
sep_height = 2
|
||||||
|
font = Clarity City Bold 12px
|
||||||
|
icon_size = 16
|
||||||
|
icon_theme = Papirus-Dark
|
||||||
|
arrow_string =
|
||||||
|
color_menu_border = #ffffff 0
|
||||||
|
color_menu_bg = #1f2329
|
||||||
|
color_norm_bg = #ffffff 0
|
||||||
|
color_norm_fg = #b8bfe5
|
||||||
|
color_sel_bg = #23272e
|
||||||
|
color_sel_fg = #b8bfe5
|
||||||
|
color_sep_fg = #b3b3b3
|
25
config/jgmenu/menu.csv
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Terminal ,openapp --floating ,/usr/share/icons/Papirus/32x32/apps/terminal.svg
|
||||||
|
Web Browser ,openapp --browser ,/usr/share/icons/Papirus/32x32/apps/brave-browser.svg
|
||||||
|
File Manager ,openapp --filemanager ,/usr/share/icons/Papirus/32x32/apps/org.xfce.filemanager.svg
|
||||||
|
|
||||||
|
^sep()
|
||||||
|
|
||||||
|
Widgets ,^checkout(wg) ,/usr/share/icons/Papirus/32x32/apps/kmenuedit.svg
|
||||||
|
BSPWM ,^checkout(wm) ,/usr/share/icons/Papirus/32x32/apps/gnome-windows.svg
|
||||||
|
Exit ,^checkout(exit) ,/usr/share/icons/Papirus/32x32/apps/system-shutdown.svg
|
||||||
|
|
||||||
|
^tag(wg)
|
||||||
|
User Card ,openapp --usercard ,/usr/share/icons/Papirus/32x32/apps/system-users.svg
|
||||||
|
Power Menu ,openapp --powermenu ,/usr/share/icons/Papirus/32x32/status/changes-allow.svg
|
||||||
|
Calendar ,openapp --calendar ,/usr/share/icons/Papirus/32x32/apps/office-calendar.svg
|
||||||
|
|
||||||
|
^tag(wm)
|
||||||
|
Change Theme ,openapp --rice ,/usr/share/icons/Papirus/32x32/apps/colors.svg
|
||||||
|
Keybinds ,keybindingshelp ,/usr/share/icons/Papirus/32x32/apps/preferences-desktop-keyboard-shortcuts.svg
|
||||||
|
Restart WM ,bspc wm -r ,/usr/share/icons/Papirus/32x32/apps/system-reboot.svg
|
||||||
|
Quit ,bspc quit ,/usr/share/icons/Papirus/32x32/apps/system-log-out.svg
|
||||||
|
|
||||||
|
^tag(exit)
|
||||||
|
Block computer ,physlock -d ,/usr/share/icons/Papirus/32x32/status/changes-prevent.svg
|
||||||
|
Reboot ,systemctl reboot ,/usr/share/icons/Papirus/32x32/apps/system-reboot.svg
|
||||||
|
Shutdown ,systemctl poweroff ,/usr/share/icons/Papirus/32x32/apps/system-shutdown.svg
|
|
0
config/mpd/log
Normal file
20
config/mpd/mpd.conf
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
music_directory "~/music"
|
||||||
|
playlist_directory "~/.config/mpd/playlists"
|
||||||
|
db_file "~/.config/mpd/mpd.db"
|
||||||
|
state_file "~/.config/mpd/mpdstate"
|
||||||
|
auto_update "yes"
|
||||||
|
|
||||||
|
bind_to_address "127.0.0.1"
|
||||||
|
bind_to_address "~/.config/mpd/socket"
|
||||||
|
|
||||||
|
audio_output {
|
||||||
|
type "pulse"
|
||||||
|
name "pulse audio"
|
||||||
|
}
|
||||||
|
|
||||||
|
audio_output {
|
||||||
|
type "fifo"
|
||||||
|
name "my_fifo"
|
||||||
|
path "/tmp/mpd.fifo"
|
||||||
|
format "44100:16:2"
|
||||||
|
}
|
0
config/mpd/mpd.db
Normal file
0
config/mpd/mpdstate
Normal file
0
config/mpd/playlist/.nomedia
Normal file
73
config/ncmpcpp/config
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
mpd_host = "127.0.0.1"
|
||||||
|
mpd_port = 6600
|
||||||
|
mpd_connection_timeout = "5"
|
||||||
|
mpd_crossfade_time = "5"
|
||||||
|
mpd_music_dir = ~/music
|
||||||
|
lyrics_directory = ~/.config/ncmpcpp/lyrics
|
||||||
|
execute_on_song_change = "mediacontrol nccover ; dunstify --replace=27072 -i /tmp/cover.png "Playing.." "$(mpc --format '%title% \n%artist%' current)""
|
||||||
|
|
||||||
|
visualizer_data_source = /tmp/mpd.fifo
|
||||||
|
visualizer_output_name = my_fifo
|
||||||
|
|
||||||
|
visualizer_in_stereo = "yes"
|
||||||
|
visualizer_fps = "60"
|
||||||
|
visualizer_type = "spectrum"
|
||||||
|
visualizer_look = ●●
|
||||||
|
visualizer_color = "13"
|
||||||
|
visualizer_spectrum_smooth_look = "yes"
|
||||||
|
|
||||||
|
# GENERAL
|
||||||
|
# ---
|
||||||
|
connected_message_on_startup = "yes"
|
||||||
|
cyclic_scrolling = "yes"
|
||||||
|
mouse_support = "no"
|
||||||
|
mouse_list_scroll_whole_page = "yes"
|
||||||
|
lines_scrolled = "1"
|
||||||
|
message_delay_time = "1"
|
||||||
|
playlist_shorten_total_times = "yes"
|
||||||
|
playlist_display_mode = "columns"
|
||||||
|
browser_display_mode = "columns"
|
||||||
|
search_engine_display_mode = "columns"
|
||||||
|
playlist_editor_display_mode = "columns"
|
||||||
|
autocenter_mode = "yes"
|
||||||
|
centered_cursor = "yes"
|
||||||
|
user_interface = "classic"
|
||||||
|
follow_now_playing_lyrics = "yes"
|
||||||
|
locked_screen_width_part = "50"
|
||||||
|
ask_for_locked_screen_width_part = "yes"
|
||||||
|
display_bitrate = "no"
|
||||||
|
external_editor = "nano"
|
||||||
|
main_window_color = "default"
|
||||||
|
startup_screen = "playlist"
|
||||||
|
|
||||||
|
# PROGRESS BAR
|
||||||
|
# ---
|
||||||
|
progressbar_look = "▪▪▪"
|
||||||
|
#progressbar_look = "▃▃▃"
|
||||||
|
progressbar_elapsed_color = "magenta"
|
||||||
|
progressbar_color = "black"
|
||||||
|
|
||||||
|
# UI VISIBILITY
|
||||||
|
# ---
|
||||||
|
header_visibility = "no"
|
||||||
|
statusbar_visibility = "yes"
|
||||||
|
titles_visibility = "yes"
|
||||||
|
enable_window_title = "yes"
|
||||||
|
|
||||||
|
# COLORS
|
||||||
|
# ---
|
||||||
|
statusbar_color = "white"
|
||||||
|
color1 = "white"
|
||||||
|
color2 = "blue"
|
||||||
|
|
||||||
|
# UI APPEARANCE
|
||||||
|
# ---
|
||||||
|
now_playing_prefix = "$b$2$7 "
|
||||||
|
now_playing_suffix = " $/b$8"
|
||||||
|
current_item_prefix = "$b$7$/b$3 "
|
||||||
|
current_item_suffix = " $8"
|
||||||
|
|
||||||
|
song_columns_list_format = "(50)[]{t|fr:Title} (0)[magenta]{a}"
|
||||||
|
song_list_format = " {%t $R $8%a$8}|{%f $R $8%l$8} $8"
|
||||||
|
song_status_format = "$b$2 $7 {$b$6$8 %t $6} $7 $8"
|
||||||
|
song_window_title_format = "Now Playing .."
|
0
config/ncmpcpp/error.log
Normal file
7
config/nvim/init.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
require("config.plugins-setup")
|
||||||
|
require("config.core.options")
|
||||||
|
require("config.core.keymaps")
|
||||||
|
require("config.core.colorscheme")
|
||||||
|
require("config.plugins.nvim-tree")
|
||||||
|
require("config.plugins.lualine")
|
||||||
|
require("config.plugins.colorizer")
|
11
config/nvim/lua/config/core/colorscheme.lua
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
local status, _ = pcall(vim.cmd, "colorscheme onedark")
|
||||||
|
if not status then
|
||||||
|
print("Colorscheme not found!") -- print error if colorscheme not installed
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
require('onedark').setup {
|
||||||
|
style = 'darker',
|
||||||
|
transparent = true
|
||||||
|
}
|
||||||
|
require('onedark').load()
|
19
config/nvim/lua/config/core/keymaps.lua
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
local keymap = vim.keymap -- haz las cosas facil..
|
||||||
|
|
||||||
|
-- General Keymaps
|
||||||
|
|
||||||
|
-- window management
|
||||||
|
keymap.set("n", "<leader>sv", "<C-w>v") -- split window vertically
|
||||||
|
keymap.set("n", "<leader>sh", "<C-w>s") -- split window horizontally
|
||||||
|
keymap.set("n", "<leader>se", "<C-w>=") -- make split windows equal width & height
|
||||||
|
keymap.set("n", "<leader>sx", ":close<CR>") -- close current split window
|
||||||
|
|
||||||
|
keymap.set("n", "<leader>to", ":tabnew<CR>") -- open new tab
|
||||||
|
keymap.set("n", "<leader>tx", ":tabclose<CR>") -- close current tab
|
||||||
|
keymap.set("n", "<leader>tn", ":tabn<CR>") -- go to next tab
|
||||||
|
keymap.set("n", "<leader>tp", ":tabp<CR>") -- go to previous tab
|
||||||
|
|
||||||
|
-- nvim-tree
|
||||||
|
keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>") -- toggle file explorer
|
38
config/nvim/lua/config/core/options.lua
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
local opt = vim.opt -- for conciseness
|
||||||
|
|
||||||
|
-- Numeracion de las lineas
|
||||||
|
opt.relativenumber = true
|
||||||
|
opt.number = true
|
||||||
|
|
||||||
|
-- tabs & indentation
|
||||||
|
opt.tabstop = 4
|
||||||
|
opt.shiftwidth = 4
|
||||||
|
opt.expandtab = true
|
||||||
|
opt.autoindent = true
|
||||||
|
|
||||||
|
-- Line wrapping
|
||||||
|
opt.wrap = false
|
||||||
|
|
||||||
|
-- Search setting
|
||||||
|
opt.ignorecase = true
|
||||||
|
opt.smartcase = true
|
||||||
|
|
||||||
|
-- Cursor line
|
||||||
|
opt.cursorline = true
|
||||||
|
|
||||||
|
-- appearance
|
||||||
|
opt.termguicolors = true
|
||||||
|
opt.background = "dark"
|
||||||
|
opt.signcolumn = "yes"
|
||||||
|
|
||||||
|
-- Backspace
|
||||||
|
opt.backspace = "indent,eol,start"
|
||||||
|
|
||||||
|
-- Clipboard
|
||||||
|
opt.clipboard:append("unnamedplus")
|
||||||
|
|
||||||
|
-- Splitt Windows
|
||||||
|
opt.splitright = true
|
||||||
|
opt.splitbelow = true
|
||||||
|
|
||||||
|
opt.iskeyword:append("-")
|
52
config/nvim/lua/config/plugins-setup.lua
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
-- auto install packer if not installed
|
||||||
|
local ensure_packer = function()
|
||||||
|
local fn = vim.fn
|
||||||
|
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||||
|
if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
|
fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
|
||||||
|
vim.cmd([[packadd packer.nvim]])
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local packer_bootstrap = ensure_packer() -- true if packer was just installed
|
||||||
|
|
||||||
|
-- autocommand that reloads neovim and installs/updates/removes plugins
|
||||||
|
-- when file is saved
|
||||||
|
vim.cmd([[
|
||||||
|
augroup packer_user_config
|
||||||
|
autocmd!
|
||||||
|
autocmd BufWritePost plugins-setup.lua source <afile> | PackerSync
|
||||||
|
augroup end
|
||||||
|
]])
|
||||||
|
|
||||||
|
-- import packer safely
|
||||||
|
local status, packer = pcall(require, "packer")
|
||||||
|
if not status then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- add list of plugins to install
|
||||||
|
return packer.startup(function(use)
|
||||||
|
-- packer can manage itself
|
||||||
|
use("wbthomason/packer.nvim")
|
||||||
|
|
||||||
|
use("navarasu/onedark.nvim")
|
||||||
|
|
||||||
|
-- file explorer
|
||||||
|
use("nvim-tree/nvim-tree.lua")
|
||||||
|
|
||||||
|
-- vs-code like icons
|
||||||
|
use("nvim-tree/nvim-web-devicons")
|
||||||
|
|
||||||
|
-- statusline
|
||||||
|
use("nvim-lualine/lualine.nvim")
|
||||||
|
|
||||||
|
-- Colorizer
|
||||||
|
use("norcalli/nvim-colorizer.lua")
|
||||||
|
|
||||||
|
|
||||||
|
if packer_bootstrap then
|
||||||
|
require("packer").sync()
|
||||||
|
end
|
||||||
|
end)
|
12
config/nvim/lua/config/plugins/colorizer.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
require'colorizer'.setup(
|
||||||
|
{'*';},
|
||||||
|
{
|
||||||
|
RGB = true; -- #RGB hex codes
|
||||||
|
RRGGBB = true; -- #RRGGBB hex codes
|
||||||
|
names = true; -- "Name" codes like Blue
|
||||||
|
RRGGBBAA = true; -- #RRGGBBAA hex codes
|
||||||
|
rgb_fn = true; -- CSS rgb() and rgba() functions
|
||||||
|
hsl_fn = true; -- CSS hsl() and hsla() functions
|
||||||
|
css = true; -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||||
|
css_fn = true; -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||||
|
})
|
36
config/nvim/lua/config/plugins/lualine.lua
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
-- import lualine plugin safely
|
||||||
|
local status, lualine = pcall(require, "lualine")
|
||||||
|
if not status then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- get lualine nightfly theme
|
||||||
|
local lualine_onedark = require("lualine.themes.onedark")
|
||||||
|
|
||||||
|
-- new colors for theme
|
||||||
|
local new_colors = {
|
||||||
|
blue = "#65D1FF",
|
||||||
|
green = "#3EFFDC",
|
||||||
|
violet = "#FF61EF",
|
||||||
|
yellow = "#FFDA7B",
|
||||||
|
black = "#000000",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- change nightlfy theme colors
|
||||||
|
lualine_onedark.normal.a.bg = new_colors.blue
|
||||||
|
lualine_onedark.insert.a.bg = new_colors.green
|
||||||
|
lualine_onedark.visual.a.bg = new_colors.violet
|
||||||
|
lualine_onedark.command = {
|
||||||
|
a = {
|
||||||
|
gui = "bold",
|
||||||
|
bg = new_colors.yellow,
|
||||||
|
fg = new_colors.black, -- black
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- configure lualine with modified theme
|
||||||
|
lualine.setup({
|
||||||
|
options = {
|
||||||
|
theme = lualine_onedark,
|
||||||
|
},
|
||||||
|
})
|
40
config/nvim/lua/config/plugins/nvim-tree.lua
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
-- import nvim-tree plugin safely
|
||||||
|
local setup, nvimtree = pcall(require, "nvim-tree")
|
||||||
|
if not setup then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- recommended settings from nvim-tree documentation
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
|
-- change color for arrows in tree to light blue
|
||||||
|
vim.cmd([[ highlight NvimTreeIndentMarker guifg=#3FC5FF ]])
|
||||||
|
|
||||||
|
-- configure nvim-tree
|
||||||
|
nvimtree.setup({
|
||||||
|
-- change folder arrow icons
|
||||||
|
renderer = {
|
||||||
|
icons = {
|
||||||
|
glyphs = {
|
||||||
|
folder = {
|
||||||
|
arrow_closed = "", -- arrow when folder is closed
|
||||||
|
arrow_open = "", -- arrow when folder is open
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- disable window_picker for
|
||||||
|
-- explorer to work well with
|
||||||
|
-- window splits
|
||||||
|
actions = {
|
||||||
|
open_file = {
|
||||||
|
window_picker = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- git = {
|
||||||
|
-- ignore = false,
|
||||||
|
-- },
|
||||||
|
})
|
23
config/picom/picom.conf
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Available backends "xrender" "glx" "egl" "xr_glx_hybrid"
|
||||||
|
backend = "glx";
|
||||||
|
|
||||||
|
dithered-present = false;
|
||||||
|
vsync = false;
|
||||||
|
mark-wmwin-focused = true;
|
||||||
|
mark-ovredir-focused = true;
|
||||||
|
|
||||||
|
detect-rounded-corners = true;
|
||||||
|
detect-client-opacity = true;
|
||||||
|
detect-transient = true;
|
||||||
|
glx-no-stencil = true;
|
||||||
|
use-damage = true;
|
||||||
|
|
||||||
|
log-level = "warn";
|
||||||
|
|
||||||
|
wintypes:
|
||||||
|
{
|
||||||
|
normal = { fade = false; shadow = false; }
|
||||||
|
tooltip = { fade = false; shadow = false; focus = true; full-shadow = false; }
|
||||||
|
dock = { shadow = false; clip-shadow-above = false; }
|
||||||
|
dnd = { shadow = false; }
|
||||||
|
};
|
6
config/polybar/bar.sh
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
for mon in $(polybar --list-monitors | cut -d":" -f1); do
|
||||||
|
(MONITOR=$mon polybar -q bar1 -c "$HOME"/.config/polybar/config.ini)&
|
||||||
|
(MONITOR=$mon polybar -q bar2 -c "$HOME"/.config/polybar/config.ini)&
|
||||||
|
done
|
23
config/polybar/colors.ini
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
[bar]
|
||||||
|
bg = #0b0910
|
||||||
|
bg-alt = #708491
|
||||||
|
fg = #8C8C8C
|
||||||
|
mb = #252533
|
||||||
|
trans = #00000000
|
||||||
|
white = #FFFFFF
|
||||||
|
black = #000000
|
||||||
|
red = #EC7875
|
||||||
|
pink = #EC407A
|
||||||
|
purple = #BA68C8
|
||||||
|
blue = #42A5F5
|
||||||
|
cyan = #4DD0E1
|
||||||
|
teal = #00B19F
|
||||||
|
green = #61C766
|
||||||
|
lime = #B9C244
|
||||||
|
yellow = #FDD835
|
||||||
|
amber = #FBC02D
|
||||||
|
orange = #E57C46
|
||||||
|
brown = #AC8476
|
||||||
|
grey = #8C8C8C
|
||||||
|
indigo = #6C77BB
|
||||||
|
blue-gray = #6D8895
|
118
config/polybar/config.ini
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
[global/wm]
|
||||||
|
|
||||||
|
margin-bottom = 0
|
||||||
|
margin-top = 0
|
||||||
|
|
||||||
|
include-file = system.ini
|
||||||
|
include-file = colors.ini
|
||||||
|
include-file = modules.ini
|
||||||
|
|
||||||
|
[bar/bar1]
|
||||||
|
monitor = ${env:MONITOR:}
|
||||||
|
monitor-strict = false
|
||||||
|
override-redirect = false
|
||||||
|
|
||||||
|
bottom = false
|
||||||
|
fixed-center = true
|
||||||
|
|
||||||
|
width = 100%
|
||||||
|
height = 30
|
||||||
|
|
||||||
|
offset-x = 0
|
||||||
|
offset-y = 0
|
||||||
|
|
||||||
|
background = ${bar.bg}
|
||||||
|
foreground = ${bar.fg}
|
||||||
|
|
||||||
|
radius = 0
|
||||||
|
|
||||||
|
line-size = 2
|
||||||
|
line-color = ${bar.blue}
|
||||||
|
|
||||||
|
border-size = 8
|
||||||
|
border-color = ${bar.bg}
|
||||||
|
|
||||||
|
padding-left = 1
|
||||||
|
padding-right = 1
|
||||||
|
|
||||||
|
module-margin-left = 0
|
||||||
|
module-margin-right = 0
|
||||||
|
|
||||||
|
font-0 = "JetBrainsMono:style=Regular:size=9;2"
|
||||||
|
font-1 = "Material Design Icons Desktop:size=13;3"
|
||||||
|
font-2 = "Material Design Icons Desktop:size=16;4"
|
||||||
|
font-3 = "MesloLGS NF:style=Regular:size=17;4"
|
||||||
|
|
||||||
|
modules-left = sep date sep
|
||||||
|
modules-center = bspwm
|
||||||
|
modules-right = sep filesystem cpu_bar memory_bar sep network sep battery sep
|
||||||
|
|
||||||
|
separator =
|
||||||
|
dim-value = 1.0
|
||||||
|
|
||||||
|
wm-restack = bspwm
|
||||||
|
enable-ipc = true
|
||||||
|
|
||||||
|
cursor-click = pointer
|
||||||
|
cursor-scroll =
|
||||||
|
|
||||||
|
[bar/bar2]
|
||||||
|
monitor = ${env:MONITOR:}
|
||||||
|
monitor-strict = false
|
||||||
|
override-redirect = false
|
||||||
|
|
||||||
|
bottom = true
|
||||||
|
fixed-center = true
|
||||||
|
|
||||||
|
width = 100%
|
||||||
|
height = 30
|
||||||
|
|
||||||
|
offset-x = 0
|
||||||
|
offset-y = 0
|
||||||
|
|
||||||
|
background = ${bar.bg}
|
||||||
|
foreground = ${bar.fg}
|
||||||
|
|
||||||
|
radius = 0
|
||||||
|
|
||||||
|
line-size = 2
|
||||||
|
line-color = ${bar.blue}
|
||||||
|
|
||||||
|
border-size = 8
|
||||||
|
border-color = ${bar.bg}
|
||||||
|
|
||||||
|
padding-left = 1
|
||||||
|
padding-right = 1
|
||||||
|
|
||||||
|
module-margin-left = 0
|
||||||
|
module-margin-right = 0
|
||||||
|
|
||||||
|
font-0 = "JetBrainsMono:style=Regular:size=9;3"
|
||||||
|
font-1 = "Material Design Icons Desktop:size=13;4"
|
||||||
|
font-2 = "Font Awesome 6 Free Solid:size=10;3"
|
||||||
|
font-3 = "MesloLGS NF:style=Regular:size=17;4"
|
||||||
|
|
||||||
|
modules-left = title
|
||||||
|
modules-center = mpd_control sep mpd
|
||||||
|
modules-right = mod sep weather sep pulseaudio sep sep updates sep
|
||||||
|
|
||||||
|
separator =
|
||||||
|
dim-value = 1.0
|
||||||
|
|
||||||
|
wm-restack = bspwm
|
||||||
|
enable-ipc = true
|
||||||
|
|
||||||
|
cursor-click = pointer
|
||||||
|
cursor-scroll =
|
||||||
|
|
||||||
|
[settings]
|
||||||
|
|
||||||
|
screenchange-reload = false
|
||||||
|
|
||||||
|
compositing-background = source
|
||||||
|
compositing-foreground = over
|
||||||
|
compositing-overline = over
|
||||||
|
compositing-underline = over
|
||||||
|
compositing-border = over
|
||||||
|
|
||||||
|
pseudo-transparency = true
|
276
config/polybar/modules.ini
Normal file
@ -0,0 +1,276 @@
|
|||||||
|
[module/date]
|
||||||
|
type = internal/date
|
||||||
|
|
||||||
|
interval = 1.0
|
||||||
|
|
||||||
|
time = %I:%M %P
|
||||||
|
format-foreground = ${bar.fg}
|
||||||
|
date-alt = " %A, %d %B %Y"
|
||||||
|
|
||||||
|
format = <label>
|
||||||
|
label = "%date% %time%"
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/filesystem]
|
||||||
|
type = internal/fs
|
||||||
|
mount-0 = /
|
||||||
|
|
||||||
|
interval = 60
|
||||||
|
fixed-values = false
|
||||||
|
|
||||||
|
format-mounted = <label-mounted>
|
||||||
|
format-mounted-prefix = "disk: "
|
||||||
|
format-mounted-prefix-foreground = ${bar.green}
|
||||||
|
|
||||||
|
format-unmounted = <label-unmounted>
|
||||||
|
format-unmounted-prefix = "disk: "
|
||||||
|
|
||||||
|
label-mounted = "%used% "
|
||||||
|
|
||||||
|
label-unmounted = %mountpoint%: not mounted
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/network]
|
||||||
|
type = internal/network
|
||||||
|
interface = ${system.sys_network_interface}
|
||||||
|
|
||||||
|
interval = 3.0
|
||||||
|
accumulate-stats = true
|
||||||
|
unknown-as-up = true
|
||||||
|
|
||||||
|
format-connected = <label-connected>
|
||||||
|
format-connected-prefix = "net: "
|
||||||
|
format-connected-foreground = ${bar.green}
|
||||||
|
|
||||||
|
speed-unit = ""
|
||||||
|
label-connected = "%netspeed%"
|
||||||
|
label-connected-foreground = ${bar.blue}
|
||||||
|
|
||||||
|
format-disconnected = <label-disconnected>
|
||||||
|
format-disconnected-prefix = "net: "
|
||||||
|
format-disconnected-foreground = ${bar.red}
|
||||||
|
|
||||||
|
label-disconnected = offline
|
||||||
|
label-disconnected-foreground = ${bar.red}
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/pulseaudio]
|
||||||
|
type = internal/pulseaudio
|
||||||
|
use-ui-max = true
|
||||||
|
interval = 5
|
||||||
|
|
||||||
|
;;<bar-volume>
|
||||||
|
format-volume = <label-volume>
|
||||||
|
format-volume-prefix = "vol: "
|
||||||
|
format-volume-foreground = ${bar.green}
|
||||||
|
|
||||||
|
label-volume = "%percentage%"
|
||||||
|
label-volume-foreground = ${bar.fg}
|
||||||
|
|
||||||
|
format-muted = <label-muted>
|
||||||
|
format-muted-prefix =
|
||||||
|
label-muted = " Muted"
|
||||||
|
label-muted-foreground = ${bar.red}
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/battery]
|
||||||
|
type = internal/battery
|
||||||
|
full-at = 99
|
||||||
|
battery = ${system.sys_battery}
|
||||||
|
adapter = ${system.sys_adapter}
|
||||||
|
poll-interval = 2
|
||||||
|
time-format = %H:%M
|
||||||
|
|
||||||
|
format-charging = <label-charging>
|
||||||
|
format-charging-prefix = " bat: "
|
||||||
|
format-charging-prefix-font = 5
|
||||||
|
format-charging-prefix-foreground = ${bar.green}
|
||||||
|
label-charging = "%percentage%%"
|
||||||
|
|
||||||
|
format-discharging = <label-discharging>
|
||||||
|
format-discharging-prefix = " bat: "
|
||||||
|
format-discharging-prefix-font = 5
|
||||||
|
format-discharging-prefix-foreground = ${bar.green}
|
||||||
|
label-discharging = "%percentage%%"
|
||||||
|
|
||||||
|
format-full = <label-full>
|
||||||
|
format-full-prefix = " bat: "
|
||||||
|
format-full-prefix-font = 5
|
||||||
|
format-full-prefix-foreground = ${bar.green}
|
||||||
|
label-full = "%percentage%%"
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/weather]
|
||||||
|
type = custom/script
|
||||||
|
exec = weather wmodule
|
||||||
|
interval = 900
|
||||||
|
format = <label>
|
||||||
|
label = " %output% "
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/bspwm]
|
||||||
|
type = internal/bspwm
|
||||||
|
|
||||||
|
enable-click = true
|
||||||
|
enable-scroll = true
|
||||||
|
reverse-scroll = true
|
||||||
|
pin-workspaces = true
|
||||||
|
occupied-scroll = false
|
||||||
|
|
||||||
|
ws-icon-0 = 1;
|
||||||
|
ws-icon-1 = 2;
|
||||||
|
ws-icon-2 = 3;
|
||||||
|
ws-icon-3 = 4;
|
||||||
|
ws-icon-4 = 5;
|
||||||
|
ws-icon-5 = 6;
|
||||||
|
ws-icon-default = "♟ "
|
||||||
|
|
||||||
|
|
||||||
|
format = <label-state>
|
||||||
|
format-font = 3
|
||||||
|
|
||||||
|
label-focused = %icon%
|
||||||
|
label-focused-background = ${bar.mb}
|
||||||
|
label-focused-padding = 1
|
||||||
|
label-focused-foreground = ${bar.fg}
|
||||||
|
|
||||||
|
label-occupied = %icon%
|
||||||
|
label-occupied-padding = 1
|
||||||
|
label-occupied-foreground= ${bar.fg}
|
||||||
|
|
||||||
|
label-urgent = %icon%
|
||||||
|
label-urgent-padding = 1
|
||||||
|
|
||||||
|
label-empty = %icon%
|
||||||
|
label-empty-foreground = ${bar.fg}
|
||||||
|
label-empty-padding = 1
|
||||||
|
|
||||||
|
label-separator = ""
|
||||||
|
label-separator-padding = 0
|
||||||
|
label-separator-foreground = ${bar.bg-alt}
|
||||||
|
|
||||||
|
[module/mod]
|
||||||
|
type = internal/bspwm
|
||||||
|
|
||||||
|
format = <label-mode>
|
||||||
|
format-background = ${bar.bg}
|
||||||
|
format-foreground = ${bar.green}
|
||||||
|
format-padding = 1
|
||||||
|
format-font = 1
|
||||||
|
|
||||||
|
label-monocle = "monocle"
|
||||||
|
label-tiled = "tiled"
|
||||||
|
|
||||||
|
label-floating = " | float"
|
||||||
|
label-pseudotiled = " | pseudo"
|
||||||
|
label-fullscreen = " | full"
|
||||||
|
|
||||||
|
label-locked = " | locked"
|
||||||
|
label-sticky = " | sticky"
|
||||||
|
label-private = " | private"
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/title]
|
||||||
|
type = internal/xwindow
|
||||||
|
|
||||||
|
format = <label>
|
||||||
|
|
||||||
|
label = %title%
|
||||||
|
label-maxlen = 45
|
||||||
|
|
||||||
|
label-empty = "bspwm"
|
||||||
|
label-empty-foreground = ${bar.grey}
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/updates]
|
||||||
|
type = custom/script
|
||||||
|
exec = updates --get-updates
|
||||||
|
interval = 120
|
||||||
|
label = "%output%"
|
||||||
|
format-prefix = "upd: "
|
||||||
|
format-prefix-foreground = ${bar.green}
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/sep]
|
||||||
|
type = custom/text
|
||||||
|
label = " "
|
||||||
|
label-foreground = ${bar.bg-alt}
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/cpu_bar]
|
||||||
|
type = internal/cpu
|
||||||
|
|
||||||
|
interval = 0.5
|
||||||
|
format = <label>
|
||||||
|
format-prefix = "cpu: "
|
||||||
|
format-prefix-foreground = ${bar.green}
|
||||||
|
|
||||||
|
label = "%percentage%% "
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/memory_bar]
|
||||||
|
type = internal/memory
|
||||||
|
|
||||||
|
interval = 3
|
||||||
|
|
||||||
|
format = <label>
|
||||||
|
format-prefix = "mem: "
|
||||||
|
format-prefix-foreground = ${bar.green}
|
||||||
|
|
||||||
|
label = "%used% "
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/mpd_control]
|
||||||
|
type = internal/mpd
|
||||||
|
host = 127.0.0.1
|
||||||
|
port = 6600
|
||||||
|
interval = 2
|
||||||
|
format-online = <icon-prev><toggle><icon-next>
|
||||||
|
format-offline = <label-offline>
|
||||||
|
label-offline = " No Music"
|
||||||
|
icon-play = " %{T2}"
|
||||||
|
icon-pause = " %{T2}"
|
||||||
|
icon-stop = " %{T2}"
|
||||||
|
icon-prev = "%{T2}"
|
||||||
|
icon-next = " %{T2}"
|
||||||
|
|
||||||
|
format-offline-foreground = ${bar.grey}
|
||||||
|
|
||||||
|
icon-play-foreground = ${bar.lime}
|
||||||
|
icon-pause-foreground = ${bar.lime}
|
||||||
|
icon-stop-foreground = ${bar.lime}
|
||||||
|
icon-prev-foreground = ${bar.blue}
|
||||||
|
icon-next-foreground = ${bar.blue}
|
||||||
|
toggle-on-foreground = ${bar.green}
|
||||||
|
toggle-off-foreground = ${bar.red}
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
[module/mpd]
|
||||||
|
type = internal/mpd
|
||||||
|
host = 127.0.0.1
|
||||||
|
port = 6600
|
||||||
|
interval = 2
|
||||||
|
format-online = "%{F#9ece6a}[%{F-} %{A1:openapp --music:}<label-song>%{A} %{F#9ece6a}]%{F-}"
|
||||||
|
format-offline = ""
|
||||||
|
label-song = "%title%"
|
||||||
|
label-song-maxlen = 40
|
||||||
|
icon-repeat = ""
|
||||||
|
|
||||||
|
icon-repeat-background = ${bar.bg}
|
||||||
|
toggle-on-foreground = ${bar.green}
|
||||||
|
toggle-off-foreground = ${bar.red}
|
||||||
|
|
||||||
|
#####################################################
|
11
config/polybar/system.ini
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
;; The variables for the polybar modules are taken from this file.
|
||||||
|
;; Edit according to your system
|
||||||
|
;; Run `ls -1 /sys/class/power_supply/` to list list batteries and adapters.
|
||||||
|
;; Run `ls -1 /sys/class/backlight/` to list available graphics cards.
|
||||||
|
;; Run `ip link | awk '/state UP/ {print $2}' | tr -d :` to get active network interface.
|
||||||
|
|
||||||
|
[system]
|
||||||
|
sys_adapter = AC
|
||||||
|
sys_battery = BAT1
|
||||||
|
sys_graphics_card = intel_backlight
|
||||||
|
sys_network_interface = wlan0
|
239
config/ranger/rc.conf
Normal file
@ -0,0 +1,239 @@
|
|||||||
|
set preview_script ~/.config/ranger/scope.sh
|
||||||
|
|
||||||
|
# Use the external preview script or display simple plain text or image previews?
|
||||||
|
set use_preview_script true
|
||||||
|
|
||||||
|
# Use one of the supported image preview protocols
|
||||||
|
set preview_images true
|
||||||
|
|
||||||
|
# Set the preview image method.
|
||||||
|
set preview_images_method ueberzug
|
||||||
|
|
||||||
|
# Which colorscheme to use? These colorschemes are available by default:
|
||||||
|
# default, jungle, snow, solarized
|
||||||
|
set colorscheme default
|
||||||
|
|
||||||
|
# Preview files on the rightmost column?
|
||||||
|
# And collapse (shrink) the last column if there is nothing to preview?
|
||||||
|
set preview_files true
|
||||||
|
set preview_directories true
|
||||||
|
set collapse_preview true
|
||||||
|
|
||||||
|
# Use a unicode "..." character to mark cut-off filenames?
|
||||||
|
set unicode_ellipsis true
|
||||||
|
|
||||||
|
# Which viewmode should be used? Possible values are:
|
||||||
|
# miller: Use miller columns which show multiple levels of the hierarchy
|
||||||
|
# multipane: Midnight-commander like multipane view showing all tabs next
|
||||||
|
# to each other
|
||||||
|
set viewmode miller
|
||||||
|
|
||||||
|
# How many columns are there, and what are their relative widths?
|
||||||
|
set column_ratios 1,3,3
|
||||||
|
|
||||||
|
# Which files should be hidden? (regular expression)
|
||||||
|
set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
|
||||||
|
|
||||||
|
# Show hidden files? You can toggle this by typing 'zh'
|
||||||
|
set show_hidden false
|
||||||
|
|
||||||
|
# Ask for a confirmation when running the "delete" command?
|
||||||
|
# Valid values are "always", "never", "multiple" (default)
|
||||||
|
# With "multiple", ranger will ask only if you delete multiple files at once.
|
||||||
|
set confirm_on_delete multiple
|
||||||
|
|
||||||
|
# Automatically count files in the directory, even before entering them?
|
||||||
|
set automatically_count_files true
|
||||||
|
|
||||||
|
# Open all images in this directory when running certain image viewers
|
||||||
|
# like feh or sxiv? You can still open selected files by marking them.
|
||||||
|
set open_all_images true
|
||||||
|
|
||||||
|
# Be aware of version control systems and display information.
|
||||||
|
set vcs_aware true
|
||||||
|
|
||||||
|
# State of the four backends git, hg, bzr, svn. The possible states are
|
||||||
|
# disabled, local (only show local info), enabled (show local and remote
|
||||||
|
# information).
|
||||||
|
set vcs_backend_git enabled
|
||||||
|
set vcs_backend_hg disabled
|
||||||
|
set vcs_backend_bzr disabled
|
||||||
|
set vcs_backend_svn disabled
|
||||||
|
|
||||||
|
# Truncate the long commit messages to this length when shown in the statusbar.
|
||||||
|
set vcs_msg_length 50
|
||||||
|
|
||||||
|
# Show dotfiles in the bookmark preview box?
|
||||||
|
set show_hidden_bookmarks true
|
||||||
|
|
||||||
|
# Wrap long lines in plain text previews?
|
||||||
|
set wrap_plaintext_previews true
|
||||||
|
|
||||||
|
# Save the console history on exit?
|
||||||
|
set save_console_history false
|
||||||
|
|
||||||
|
# Draw the status bar on top of the browser window (default: bottom)
|
||||||
|
set status_bar_on_top false
|
||||||
|
|
||||||
|
# Draw a progress bar in the status bar which displays the average state of all
|
||||||
|
# currently running tasks which support progress bars?
|
||||||
|
set draw_progress_bar_in_status_bar true
|
||||||
|
|
||||||
|
# Draw borders around columns?
|
||||||
|
set draw_borders both
|
||||||
|
|
||||||
|
# Display the directory name in tabs?
|
||||||
|
set dirname_in_tabs true
|
||||||
|
|
||||||
|
# Enable the mouse support?
|
||||||
|
set mouse_enabled true
|
||||||
|
|
||||||
|
# Display the file size in the main column or status bar?
|
||||||
|
set display_size_in_main_column false
|
||||||
|
set display_size_in_status_bar true
|
||||||
|
|
||||||
|
# Display the free disk space in the status bar?
|
||||||
|
set display_free_space_in_status_bar false
|
||||||
|
|
||||||
|
# Display files tags in all columns or only in main column?
|
||||||
|
set display_tags_in_all_columns false
|
||||||
|
|
||||||
|
# Set a title for the window? Updates both `WM_NAME` and `WM_ICON_NAME`
|
||||||
|
set update_title true
|
||||||
|
|
||||||
|
# Set the tmux/screen window-name to "ranger"?
|
||||||
|
set update_tmux_title true
|
||||||
|
|
||||||
|
# Shorten the title if it gets long? The number defines how many
|
||||||
|
# directories are displayed at once, 0 turns off this feature.
|
||||||
|
set shorten_title 3
|
||||||
|
|
||||||
|
# Show hostname in titlebar?
|
||||||
|
set hostname_in_titlebar true
|
||||||
|
|
||||||
|
# Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
|
||||||
|
set tilde_in_titlebar true
|
||||||
|
|
||||||
|
# How many directory-changes or console-commands should be kept in history?
|
||||||
|
set max_history_size 20
|
||||||
|
set max_console_history_size 50
|
||||||
|
|
||||||
|
# Try to keep so much space between the top/bottom border when scrolling:
|
||||||
|
set scroll_offset 8
|
||||||
|
|
||||||
|
# Flush the input after each key hit? (Noticeable when ranger lags)
|
||||||
|
set flushinput true
|
||||||
|
|
||||||
|
# Padding on the right when there's no preview?
|
||||||
|
# This allows you to click into the space to run the file.
|
||||||
|
set padding_right true
|
||||||
|
|
||||||
|
# Save bookmarks (used with mX and `X) instantly?
|
||||||
|
# This helps to synchronize bookmarks between multiple ranger
|
||||||
|
# instances but leads to *slight* performance loss.
|
||||||
|
# When false, bookmarks are saved when ranger is exited.
|
||||||
|
set autosave_bookmarks false
|
||||||
|
|
||||||
|
# Save the "`" bookmark to disk. This can be used to switch to the last
|
||||||
|
# directory by typing "``".
|
||||||
|
set save_backtick_bookmark true
|
||||||
|
|
||||||
|
# You can display the "real" cumulative size of directories by using the
|
||||||
|
# command :get_cumulative_size or typing "dc". The size is expensive to
|
||||||
|
# calculate and will not be updated automatically. You can choose
|
||||||
|
# to update it automatically though by turning on this option:
|
||||||
|
set autoupdate_cumulative_size false
|
||||||
|
|
||||||
|
# Turning this on makes sense for screen readers:
|
||||||
|
set show_cursor false
|
||||||
|
|
||||||
|
# One of: size, natural, basename, atime, ctime, mtime, type, random
|
||||||
|
set sort natural
|
||||||
|
|
||||||
|
# Additional sorting options
|
||||||
|
set sort_reverse false
|
||||||
|
set sort_case_insensitive true
|
||||||
|
set sort_directories_first true
|
||||||
|
set sort_unicode false
|
||||||
|
|
||||||
|
# Enable this if key combinations with the Alt Key don't work for you.
|
||||||
|
# (Especially on xterm)
|
||||||
|
set xterm_alt_key false
|
||||||
|
|
||||||
|
# Whether to include bookmarks in cd command
|
||||||
|
set cd_bookmarks true
|
||||||
|
|
||||||
|
# Changes case sensitivity for the cd command tab completion
|
||||||
|
set cd_tab_case sensitive
|
||||||
|
|
||||||
|
# Use fuzzy tab completion with the "cd" command. For example,
|
||||||
|
# ":cd /u/lo/b<tab>" expands to ":cd /usr/local/bin".
|
||||||
|
set cd_tab_fuzzy true
|
||||||
|
|
||||||
|
# Avoid previewing files larger than this size, in bytes. Use a value of 0 to
|
||||||
|
# disable this feature.
|
||||||
|
set preview_max_size 0
|
||||||
|
|
||||||
|
# The key hint lists up to this size have their sublists expanded.
|
||||||
|
# Otherwise the submaps are replaced with "...".
|
||||||
|
set hint_collapse_threshold 10
|
||||||
|
|
||||||
|
# Add the highlighted file to the path in the titlebar
|
||||||
|
set show_selection_in_titlebar true
|
||||||
|
|
||||||
|
# The delay that ranger idly waits for user input, in milliseconds, with a
|
||||||
|
# resolution of 100ms. Lower delay reduces lag between directory updates but
|
||||||
|
# increases CPU load.
|
||||||
|
set idle_delay 2000
|
||||||
|
|
||||||
|
# When the metadata manager module looks for metadata, should it only look for
|
||||||
|
# a ".metadata.json" file in the current directory, or do a deep search and
|
||||||
|
# check all directories above the current one as well?
|
||||||
|
set metadata_deep_search false
|
||||||
|
|
||||||
|
# Clear all existing filters when leaving a directory
|
||||||
|
set clear_filters_on_dir_change false
|
||||||
|
|
||||||
|
# Disable displaying line numbers in main column.
|
||||||
|
# Possible values: false, absolute, relative.
|
||||||
|
set line_numbers false
|
||||||
|
|
||||||
|
# When line_numbers=relative show the absolute line number in the
|
||||||
|
# current line.
|
||||||
|
set relative_current_zero false
|
||||||
|
|
||||||
|
# Start line numbers from 1 instead of 0
|
||||||
|
set one_indexed false
|
||||||
|
|
||||||
|
# Save tabs on exit
|
||||||
|
set save_tabs_on_exit false
|
||||||
|
|
||||||
|
# Enable scroll wrapping - moving down while on the last item will wrap around to
|
||||||
|
# the top and vice versa.
|
||||||
|
set wrap_scroll false
|
||||||
|
|
||||||
|
# Set the global_inode_type_filter to nothing. Possible options: d, f and l for
|
||||||
|
# directories, files and symlinks respectively.
|
||||||
|
set global_inode_type_filter
|
||||||
|
|
||||||
|
# This setting allows to freeze the list of files to save I/O bandwidth. It
|
||||||
|
# should be 'false' during start-up, but you can toggle it by pressing F.
|
||||||
|
set freeze_files false
|
||||||
|
|
||||||
|
# Print file sizes in bytes instead of the default human-readable format.
|
||||||
|
set size_in_bytes false
|
||||||
|
|
||||||
|
# Warn at startup if RANGER_LEVEL env var is greater than 0, in other words
|
||||||
|
# give a warning when you nest ranger in a subshell started by ranger.
|
||||||
|
# Special value "error" makes the warning more visible.
|
||||||
|
set nested_ranger_warning true
|
||||||
|
|
||||||
|
# ===================================================================
|
||||||
|
# == Local Options
|
||||||
|
# ===================================================================
|
||||||
|
# You can set local options that only affect a single directory.
|
||||||
|
|
||||||
|
# Examples:
|
||||||
|
# setlocal path=~/downloads sort mtime
|
||||||
|
|
||||||
|
default_linemode devicons
|
98
config/ranger/rifle.conf
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
# Websites
|
||||||
|
ext x?html?, has brave, X, flag f = brave -- "$@"
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
mime ^text, label editor = nvim -- "$@"
|
||||||
|
mime ^text, label pager = "$PAGER" -- "$@"
|
||||||
|
!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = nvim -- "$@"
|
||||||
|
!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
|
||||||
|
|
||||||
|
ext 1 = man "$1"
|
||||||
|
ext s[wmf]c, has zsnes, X = zsnes "$1"
|
||||||
|
ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
|
||||||
|
ext nes, has fceux, X = fceux "$1"
|
||||||
|
ext exe = wine "$1"
|
||||||
|
name ^[mM]akefile$ = make
|
||||||
|
|
||||||
|
# Code
|
||||||
|
ext py = python -- "$1"
|
||||||
|
ext pl = perl -- "$1"
|
||||||
|
ext rb = ruby -- "$1"
|
||||||
|
ext js = node -- "$1"
|
||||||
|
ext sh = sh -- "$1"
|
||||||
|
ext php = php -- "$1"
|
||||||
|
|
||||||
|
# Audio without X
|
||||||
|
mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
|
||||||
|
|
||||||
|
# Video/Audio with a GUI
|
||||||
|
mime ^video, has mpv, X, flag f = mpv -- "$@"
|
||||||
|
mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
|
||||||
|
|
||||||
|
# Video without X:
|
||||||
|
mime ^video, terminal, !X, has mpv = mpv -- "$@"
|
||||||
|
|
||||||
|
# Documents
|
||||||
|
ext pdf, has zathura, X, flag f = zathura -- "$@"
|
||||||
|
ext pdf, has mupdf, X, flag f = mupdf "$@"
|
||||||
|
ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@"
|
||||||
|
ext pdf, has apvlv, X, flag f = apvlv -- "$@"
|
||||||
|
ext pdf, has xpdf, X, flag f = xpdf -- "$@"
|
||||||
|
ext pdf, has evince, X, flag f = evince -- "$@"
|
||||||
|
ext pdf, has atril, X, flag f = atril -- "$@"
|
||||||
|
ext pdf, has okular, X, flag f = okular -- "$@"
|
||||||
|
ext pdf, has epdfview, X, flag f = epdfview -- "$@"
|
||||||
|
ext pdf, has qpdfview, X, flag f = qpdfview "$@"
|
||||||
|
ext pdf, has open, X, flag f = open "$@"
|
||||||
|
ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER"
|
||||||
|
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@"
|
||||||
|
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@"
|
||||||
|
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
|
||||||
|
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@"
|
||||||
|
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@"
|
||||||
|
ext djvu, has zathura,X, flag f = zathura -- "$@"
|
||||||
|
ext djvu, has evince, X, flag f = evince -- "$@"
|
||||||
|
ext djvu, has atril, X, flag f = atril -- "$@"
|
||||||
|
ext djvu, has djview, X, flag f = djview -- "$@"
|
||||||
|
ext epub, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
|
||||||
|
ext mobi, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
|
||||||
|
|
||||||
|
# Image Viewing:
|
||||||
|
mime ^image, has feh, X, flag f = feh -- "$@"
|
||||||
|
ext xcf, X, flag f = gimp -- "$@"
|
||||||
|
|
||||||
|
# Archives
|
||||||
|
# avoid password prompt by providing empty password
|
||||||
|
ext 7z, has 7z = 7z -p l "$@" | "$PAGER"
|
||||||
|
ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --list --each -- "$@" | "$PAGER"
|
||||||
|
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --list --each -- "$@" | "$PAGER"
|
||||||
|
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --extract --each -- "$@"
|
||||||
|
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --extract --each -- "$@"
|
||||||
|
|
||||||
|
# Listing and extracting archives without atool:
|
||||||
|
ext tar|gz|bz2|xz, has tar = tar vvtf "$1" | "$PAGER"
|
||||||
|
ext tar|gz|bz2|xz, has tar = for file in "$@"; do tar vvxf "$file"; done
|
||||||
|
ext bz2, has bzip2 = for file in "$@"; do bzip2 -dk "$file"; done
|
||||||
|
ext zip, has unzip = unzip -l "$1" | less
|
||||||
|
ext zip, has unzip = for file in "$@"; do unzip -d "${file%.*}" "$file"; done
|
||||||
|
ext ace, has unace = unace l "$1" | less
|
||||||
|
ext ace, has unace = for file in "$@"; do unace e "$file"; done
|
||||||
|
ext rar, has unrar = unrar l "$1" | less
|
||||||
|
ext rar, has unrar = for file in "$@"; do unrar x "$file"; done
|
||||||
|
|
||||||
|
# Flag t fallback terminals
|
||||||
|
mime ^ranger/x-terminal-emulator, has alacritty = alacritty -e "$@"
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1"
|
||||||
|
label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1"
|
||||||
|
label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1"
|
||||||
|
label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
|
||||||
|
|
||||||
|
# Define the editor for non-text files + pager as last action
|
||||||
|
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
|
||||||
|
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
|
||||||
|
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
|
||||||
|
|
||||||
|
# The very last action, so that it's never triggered accidentally, is to execute a program:
|
||||||
|
mime application/x-executable = "$1"
|
179
config/ranger/scope.sh
Normal file
@ -0,0 +1,179 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -o noclobber -o noglob -o nounset -o pipefail
|
||||||
|
IFS=$'\n'
|
||||||
|
|
||||||
|
# If the option `use_preview_script` is set to `true`,
|
||||||
|
# then this script will be called and its output will be displayed in ranger.
|
||||||
|
# ANSI color codes are supported.
|
||||||
|
# STDIN is disabled, so interactive scripts won't work properly
|
||||||
|
|
||||||
|
# This script is considered a configuration file and must be updated manually.
|
||||||
|
# It will be left untouched if you upgrade ranger.
|
||||||
|
|
||||||
|
# Meanings of exit codes:
|
||||||
|
# code | meaning | action of ranger
|
||||||
|
# -----+------------+-------------------------------------------
|
||||||
|
# 0 | success | Display stdout as preview
|
||||||
|
# 1 | no preview | Display no preview at all
|
||||||
|
# 2 | plain text | Display the plain content of the file
|
||||||
|
# 3 | fix width | Don't reload when width changes
|
||||||
|
# 4 | fix height | Don't reload when height changes
|
||||||
|
# 5 | fix both | Don't ever reload
|
||||||
|
# 6 | image | Display the image `$IMAGE_CACHE_PATH` points to as an image preview
|
||||||
|
# 7 | image | Display the file directly as an image
|
||||||
|
|
||||||
|
# Script arguments
|
||||||
|
FILE_PATH="${1}" # Full path of the highlighted file
|
||||||
|
PV_WIDTH="${2}" # Width of the preview pane (number of fitting characters)
|
||||||
|
PV_HEIGHT="${3}" # Height of the preview pane (number of fitting characters)
|
||||||
|
IMAGE_CACHE_PATH="${4}" # Full path that should be used to cache image preview
|
||||||
|
PV_IMAGE_ENABLED="${5}" # 'True' if image previews are enabled, 'False' otherwise.
|
||||||
|
|
||||||
|
FILE_EXTENSION="${FILE_PATH##*.}"
|
||||||
|
FILE_EXTENSION_LOWER=$(echo ${FILE_EXTENSION} | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
|
# Settings
|
||||||
|
HIGHLIGHT_SIZE_MAX=262143 # 256KiB
|
||||||
|
HIGHLIGHT_TABWIDTH=8
|
||||||
|
HIGHLIGHT_STYLE='pablo'
|
||||||
|
PYGMENTIZE_STYLE='autumn'
|
||||||
|
|
||||||
|
|
||||||
|
handle_extension() {
|
||||||
|
case "${FILE_EXTENSION_LOWER}" in
|
||||||
|
# Archive
|
||||||
|
a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
|
||||||
|
rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
|
||||||
|
atool --list -- "${FILE_PATH}" && exit 5
|
||||||
|
bsdtar --list --file "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
rar)
|
||||||
|
# Avoid password prompt by providing empty password
|
||||||
|
unrar lt -p- -- "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
7z)
|
||||||
|
# Avoid password prompt by providing empty password
|
||||||
|
7z l -p -- "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
# PDF
|
||||||
|
pdf)
|
||||||
|
# Preview as text conversion
|
||||||
|
pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - && exit 5
|
||||||
|
exiftool "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
# BitTorrent
|
||||||
|
torrent)
|
||||||
|
transmission-show -- "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
# OpenDocument
|
||||||
|
odt|ods|odp|sxw)
|
||||||
|
# Preview as text conversion
|
||||||
|
odt2txt "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
# HTML
|
||||||
|
htm|html|xhtml)
|
||||||
|
# Preview as text conversion
|
||||||
|
w3m -dump "${FILE_PATH}" && exit 5
|
||||||
|
lynx -dump -- "${FILE_PATH}" && exit 5
|
||||||
|
elinks -dump "${FILE_PATH}" && exit 5
|
||||||
|
;; # Continue with next handler on failure
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_image() {
|
||||||
|
local mimetype="${1}"
|
||||||
|
case "${mimetype}" in
|
||||||
|
# SVG
|
||||||
|
image/svg+xml)
|
||||||
|
convert "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
# Image
|
||||||
|
image/*)
|
||||||
|
local orientation
|
||||||
|
orientation="$( identify -format '%[EXIF:Orientation]\n' -- "${FILE_PATH}" )"
|
||||||
|
# If orientation data is present and the image actually
|
||||||
|
# needs rotating ("1" means no rotation)...
|
||||||
|
if [[ -n "$orientation" && "$orientation" != 1 ]]; then
|
||||||
|
# ...auto-rotate the image according to the EXIF data.
|
||||||
|
convert -- "${FILE_PATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6
|
||||||
|
fi
|
||||||
|
|
||||||
|
# `w3mimgdisplay` will be called for all images (unless overriden as above),
|
||||||
|
# but might fail for unsupported types.
|
||||||
|
exit 7;;
|
||||||
|
|
||||||
|
# Video
|
||||||
|
video/*)
|
||||||
|
# Thumbnail
|
||||||
|
ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
# PDF
|
||||||
|
application/pdf)
|
||||||
|
pdftoppm -f 1 -l 1 \
|
||||||
|
-scale-to-x 1920 \
|
||||||
|
-scale-to-y -1 \
|
||||||
|
-singlefile \
|
||||||
|
-jpeg -tiffcompression jpeg \
|
||||||
|
-- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \
|
||||||
|
&& exit 6 || exit 1;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_mime() {
|
||||||
|
local mimetype="${1}"
|
||||||
|
case "${mimetype}" in
|
||||||
|
# Text
|
||||||
|
text/* | */xml)
|
||||||
|
# Syntax highlight
|
||||||
|
if [[ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
if [[ "$( tput colors )" -ge 256 ]]; then
|
||||||
|
local pygmentize_format='terminal256'
|
||||||
|
local highlight_format='xterm256'
|
||||||
|
else
|
||||||
|
local pygmentize_format='terminal'
|
||||||
|
local highlight_format='ansi'
|
||||||
|
fi
|
||||||
|
highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \
|
||||||
|
--style="${HIGHLIGHT_STYLE}" --force -- "${FILE_PATH}" && exit 5
|
||||||
|
# pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}" -- "${FILE_PATH}" && exit 5
|
||||||
|
exit 2;;
|
||||||
|
|
||||||
|
# Image
|
||||||
|
image/*)
|
||||||
|
# Preview as text conversion
|
||||||
|
# img2txt --gamma=0.6 --width="${PV_WIDTH}" -- "${FILE_PATH}" && exit 4
|
||||||
|
exiftool "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
# Video and audio
|
||||||
|
video/* | audio/*)
|
||||||
|
mediainfo "${FILE_PATH}" && exit 5
|
||||||
|
exiftool "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_fallback() {
|
||||||
|
echo '----- File Type Classification -----' && file --dereference --brief -- "${FILE_PATH}" && exit 5
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
|
||||||
|
if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
|
||||||
|
handle_image "${MIMETYPE}"
|
||||||
|
fi
|
||||||
|
handle_extension
|
||||||
|
handle_mime "${MIMETYPE}"
|
||||||
|
handle_fallback
|
||||||
|
|
||||||
|
exit 1
|
164
config/rofi/launcher.rasi
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
configuration {
|
||||||
|
modi: "drun";
|
||||||
|
icon-theme: "Papirus-Dark";
|
||||||
|
application-fallback-icon: "Adwaita";
|
||||||
|
show-icons: true;
|
||||||
|
drun-display-format: "{name}";
|
||||||
|
disable-history: true;
|
||||||
|
sidebar-mode: false;
|
||||||
|
hover-select: true;
|
||||||
|
me-select-entry: "";
|
||||||
|
me-accept-entry: "MousePrimary";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Global Properties -----*****/
|
||||||
|
* {
|
||||||
|
font: "JetBrainsMono Nerd Font Bold 9";
|
||||||
|
background: #1f2329;
|
||||||
|
background-alt: #1f2329E0;
|
||||||
|
foreground: #b8bfe5;
|
||||||
|
selected: #3f5273;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Window -----*****/
|
||||||
|
window {
|
||||||
|
/* properties for window widget */
|
||||||
|
transparency: "real";
|
||||||
|
location: center;
|
||||||
|
anchor: center;
|
||||||
|
border: 2px;
|
||||||
|
border-color: #465b80;
|
||||||
|
fullscreen: false;
|
||||||
|
width: 550px;
|
||||||
|
x-offset: 0px;
|
||||||
|
y-offset: 0px;
|
||||||
|
|
||||||
|
/* properties for all widgets */
|
||||||
|
enabled: true;
|
||||||
|
border-radius: 0px;
|
||||||
|
cursor: "default";
|
||||||
|
background-color: @background;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Main Box -----*****/
|
||||||
|
mainbox {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 0px;
|
||||||
|
background-color: transparent;
|
||||||
|
orientation: vertical;
|
||||||
|
children: [ "inputbar", "listbox" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
listbox {
|
||||||
|
spacing: 10px;
|
||||||
|
padding: 10px 5px 10px 5px;
|
||||||
|
background-color: transparent;
|
||||||
|
orientation: vertical;
|
||||||
|
children: [ "message", "listview" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Inputbar -----*****/
|
||||||
|
inputbar {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 10px;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
orientation: horizontal;
|
||||||
|
children: [ "textbox-prompt-colon", "entry" ];
|
||||||
|
}
|
||||||
|
textbox-prompt-colon {
|
||||||
|
enabled: true;
|
||||||
|
expand: false;
|
||||||
|
str: "";
|
||||||
|
padding: 12px 15px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
|
entry {
|
||||||
|
enabled: true;
|
||||||
|
expand: true;
|
||||||
|
padding: 12px 16px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: text;
|
||||||
|
placeholder: "Search";
|
||||||
|
placeholder-color: inherit;
|
||||||
|
}
|
||||||
|
dummy {
|
||||||
|
expand: true;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*****----- Listview -----*****/
|
||||||
|
listview {
|
||||||
|
enabled: true;
|
||||||
|
columns: 3;
|
||||||
|
lines: 5;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
scrollbar: false;
|
||||||
|
layout: vertical;
|
||||||
|
reverse: false;
|
||||||
|
fixed-height: true;
|
||||||
|
fixed-columns: true;
|
||||||
|
|
||||||
|
spacing: 1px;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: "default";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Elements -----*****/
|
||||||
|
element {
|
||||||
|
enabled: true;
|
||||||
|
spacing: 10px;
|
||||||
|
padding: 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: @foreground;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
element normal.normal {
|
||||||
|
background-color: inherit;
|
||||||
|
text-color: inherit;
|
||||||
|
}
|
||||||
|
element selected.normal {
|
||||||
|
background-color: @selected;
|
||||||
|
text-color: @background;
|
||||||
|
}
|
||||||
|
element-icon {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
size: 24px;
|
||||||
|
cursor: inherit;
|
||||||
|
}
|
||||||
|
element-text {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
cursor: inherit;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****----- Message -----*****/
|
||||||
|
message {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
textbox {
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: @background-alt;
|
||||||
|
text-color: @foreground;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
horizontal-align: 0.0;
|
||||||
|
}
|
||||||
|
error-message {
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: @background;
|
||||||
|
text-color: @foreground;
|
||||||
|
}
|
173
config/sxhkd/sxhkdrc
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
#|||----- Applications -----|||#
|
||||||
|
|
||||||
|
# Open Terminal (alacritty)
|
||||||
|
super + Return
|
||||||
|
openapp --terminal
|
||||||
|
|
||||||
|
# Open floating Terminal
|
||||||
|
super + alt + Return
|
||||||
|
openapp --floating
|
||||||
|
|
||||||
|
# Menu applications
|
||||||
|
super + F1
|
||||||
|
openapp --menu
|
||||||
|
|
||||||
|
#####
|
||||||
|
|
||||||
|
# Apps (browser, editor, filemanager, music, and updater)
|
||||||
|
shift + alt + {b,v,f,k,u}
|
||||||
|
openapp {--browser,--nvim,--ranger, --music, --update}
|
||||||
|
|
||||||
|
|
||||||
|
#|||----- System Keybindings -----|||#
|
||||||
|
|
||||||
|
# Show keybindings help
|
||||||
|
alt + F1
|
||||||
|
keybindingshelp
|
||||||
|
|
||||||
|
# jgmenu
|
||||||
|
~button3
|
||||||
|
xqp 0 $(xdo id -N Bspwm -n root) && jgmenu --csv-file=~/.config/jgmenu/menu.csv --config-file=~/.config/jgmenu/jgmenurc
|
||||||
|
|
||||||
|
# Scratchpad
|
||||||
|
super + alt + o
|
||||||
|
tdrop -a -w 70% -h 35% -y 0 -x 15% --class scratch alacritty --class=scratch
|
||||||
|
|
||||||
|
# Power off, Reboot, Log out, Lockscreen, kill an app
|
||||||
|
ctrl + super + alt + {p,r,q,l,k}
|
||||||
|
{systemctl poweroff, systemctl reboot,bspc quit,physlock -d,xkill}
|
||||||
|
|
||||||
|
# Hide/Show Bar
|
||||||
|
super + {h,u}
|
||||||
|
hidebar {-h,-u}
|
||||||
|
|
||||||
|
# Change transparency on focused window
|
||||||
|
ctrl + alt + {plus,minus,t}
|
||||||
|
picom-trans {-c -o +3,-c -o -1,-c -d}
|
||||||
|
|
||||||
|
# Random wallpaper
|
||||||
|
super + alt + w
|
||||||
|
feh -z --no-fehbg --bg-fill ~/pics/wallpapers/
|
||||||
|
|
||||||
|
# Screenshot Now
|
||||||
|
Print
|
||||||
|
screenshoter --now
|
||||||
|
|
||||||
|
# Screenshot Select
|
||||||
|
ctrl + Print
|
||||||
|
screenshoter --sel
|
||||||
|
|
||||||
|
# Screenshot in 10s
|
||||||
|
alt + Print
|
||||||
|
screenshoter --in10
|
||||||
|
|
||||||
|
# Screenshot active window
|
||||||
|
shift + Print
|
||||||
|
screenshoter --active
|
||||||
|
|
||||||
|
# Manage brightness
|
||||||
|
XF86MonBrightness{Up,Down}
|
||||||
|
sh brightness {up,down}
|
||||||
|
|
||||||
|
# Volume control
|
||||||
|
XF86Audio{RaiseVolume,LowerVolume,Mute}
|
||||||
|
volume{ --inc, --dec, --toggle}
|
||||||
|
|
||||||
|
# Music Control
|
||||||
|
XF86Audio{Next,Prev,Play,Stop}
|
||||||
|
mediacontrol {--next,--previous,--toggle,--stop}
|
||||||
|
|
||||||
|
|
||||||
|
#|||----- Bspwm hotkeys -----|||#
|
||||||
|
|
||||||
|
# Reload BSPWM
|
||||||
|
super + alt + r
|
||||||
|
bspc wm -r
|
||||||
|
|
||||||
|
# close and kill
|
||||||
|
super + {_,shift + }q
|
||||||
|
bspc node -{c,k}
|
||||||
|
|
||||||
|
# Reload Keybindings
|
||||||
|
super + Escape
|
||||||
|
pkill -USR1 -x sxhkd; dunstify -u low -i ~/.local/share/assets/reload.svg 'sxhkd' 'The configuration file has been reloaded successfully!'
|
||||||
|
|
||||||
|
#####
|
||||||
|
|
||||||
|
# alternate between the tiled and monocle layout
|
||||||
|
super + m
|
||||||
|
bspc desktop -l next
|
||||||
|
|
||||||
|
# set the window state
|
||||||
|
super + {t,shift + t,s,f}
|
||||||
|
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
|
||||||
|
|
||||||
|
# set the node flags
|
||||||
|
ctrl + alt {m,x,s,p}
|
||||||
|
bspc node -g {marked,locked,sticky,private}
|
||||||
|
|
||||||
|
# Hide/Unhide Window
|
||||||
|
ctrl + alt + h
|
||||||
|
bsphidenode
|
||||||
|
|
||||||
|
#####
|
||||||
|
|
||||||
|
# rotate desktop
|
||||||
|
super + r
|
||||||
|
bspc node @/ --rotate {90,-90}
|
||||||
|
|
||||||
|
# Circulate the leaves of the tree
|
||||||
|
super + c
|
||||||
|
bspc node @/ --circulate {backward,forward}
|
||||||
|
|
||||||
|
# Change focus of the Node or Swap Nodes
|
||||||
|
super + {_,shift + }{Left,Down,Up,Right}
|
||||||
|
bspc node -{f,s} {west,south,north,east}
|
||||||
|
|
||||||
|
# Switch workspace
|
||||||
|
super + ctrl + {Left,Right}
|
||||||
|
bspc desktop -f {prev,next}.local
|
||||||
|
|
||||||
|
# focus the last node/desktop
|
||||||
|
super + {grave,Tab}
|
||||||
|
bspc {node,desktop} -f last
|
||||||
|
|
||||||
|
# focus or send to the given desktop
|
||||||
|
super + ctrl + {1-9,0}
|
||||||
|
bspc {node -d} '^{1-9,10}' '--follow'
|
||||||
|
|
||||||
|
# Send focused Node to workspace directionally
|
||||||
|
super + ctrl + shift + {Left,Right}
|
||||||
|
bspc node -d {prev,next} '--follow'
|
||||||
|
|
||||||
|
#####
|
||||||
|
|
||||||
|
# preselect the direction
|
||||||
|
super + ctrl + {h,j,k,l}
|
||||||
|
bspc node -p {west,south,north,east}
|
||||||
|
|
||||||
|
# preselect the ratio
|
||||||
|
super + ctrl + alt + {1-9}
|
||||||
|
bspc node -o 0.{1-9}
|
||||||
|
|
||||||
|
# cancel the preselection for the focused node
|
||||||
|
super + ctrl + space
|
||||||
|
bspc node -p cancel
|
||||||
|
|
||||||
|
# cancel the preselection for the focused desktop
|
||||||
|
super + ctrl + shift + space
|
||||||
|
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
|
||||||
|
|
||||||
|
#####
|
||||||
|
|
||||||
|
# expand a window
|
||||||
|
super + alt + {Left,Down,Up,Right}
|
||||||
|
bspc node -z {left -10 0,bottom 0 10,top 0 -10,right 10 0}
|
||||||
|
|
||||||
|
# contract a window
|
||||||
|
super + alt + shift + {Left,Down,Up,Right}
|
||||||
|
bspc node -z {right -10 0,top 0 10,bottom 0 -10,left 10 0}
|
||||||
|
|
||||||
|
# move a floating window
|
||||||
|
alt + shift {Left,Down,Up,Right}
|
||||||
|
bspc node -v {-10 0,0 10,0 -10,10 0}
|
9
config/user-dirs.dirs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
XDG_DESKTOP_DIR="$HOME/desk"
|
||||||
|
XDG_DOWNLOAD_DIR="$HOME/down"
|
||||||
|
XDG_TEMPLATES_DIR="$HOME/"
|
||||||
|
XDG_PUBLICSHARE_DIR="$HOME/"
|
||||||
|
XDG_DOCUMENTS_DIR="$HOME/docs"
|
||||||
|
XDG_MUSIC_DIR="$HOME/music"
|
||||||
|
XDG_PICTURES_DIR="$HOME/pics"
|
||||||
|
XDG_VIDEOS_DIR="$HOME/vids"
|
||||||
|
XDG_GAMES_DIR="$HOME/games"
|
1840
config/zsh/zcompdump
Normal file
3
config/zsh/zhistory
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
curl -L https://is.gd/lkarch -o $HOME/setup.sh
|
||||||
|
chmod +x setup.sh
|
||||||
|
./setup.sh
|
103
home/.zshrc
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
# Variables
|
||||||
|
export VISUAL="${EDITOR}"
|
||||||
|
export EDITOR='nvim'
|
||||||
|
export TERMINAL='alacritty'
|
||||||
|
export BROWSER='brave'
|
||||||
|
export HISTORY_IGNORE="(ls|dir|cd|pwd|exit|sudo reboot|history|cd -|cd ..)"
|
||||||
|
|
||||||
|
if [ -d "$HOME/.local/bin" ] ;
|
||||||
|
then PATH="$HOME/.local/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Load Engine
|
||||||
|
autoload -Uz compinit
|
||||||
|
|
||||||
|
for dump in ~/.config/zsh/zcompdump(N.mh+24); do
|
||||||
|
compinit -d ~/.config/zsh/zcompdump
|
||||||
|
done
|
||||||
|
|
||||||
|
compinit -C -d ~/.config/zsh/zcompdump
|
||||||
|
|
||||||
|
autoload -Uz add-zsh-hook
|
||||||
|
autoload -Uz vcs_info
|
||||||
|
precmd () { vcs_info }
|
||||||
|
_comp_options+=(globdots)
|
||||||
|
|
||||||
|
zstyle ':completion:*' verbose true
|
||||||
|
zstyle ':completion:*:*:*:*:*' menu select
|
||||||
|
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} 'ma=48;5;197;1'
|
||||||
|
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
||||||
|
zstyle ':completion:*:warnings' format "%B%F{red}No matches for:%f %F{magenta}%d%b"
|
||||||
|
zstyle ':completion:*:descriptions' format '%F{yellow}[-- %d --]%f'
|
||||||
|
zstyle ':vcs_info:*' formats ' %B%s-[%F{magenta}%f %F{yellow}%b%f]-'
|
||||||
|
|
||||||
|
# Waiting Dots
|
||||||
|
expand-or-complete-with-dots() {
|
||||||
|
echo -n "\e[31m…\e[0m"
|
||||||
|
zle expand-or-complete
|
||||||
|
zle redisplay
|
||||||
|
}
|
||||||
|
zle -N expand-or-complete-with-dots
|
||||||
|
bindkey "^I" expand-or-complete-with-dots
|
||||||
|
|
||||||
|
# History
|
||||||
|
HISTFILE=~/.config/zsh/zhistory
|
||||||
|
HISTSIZE=5000
|
||||||
|
SAVEHIST=5000
|
||||||
|
|
||||||
|
# Zsh Cool Options
|
||||||
|
setopt AUTOCD # change directory just by typing its name
|
||||||
|
setopt PROMPT_SUBST # enable command substitution in prompt
|
||||||
|
setopt MENU_COMPLETE # Automatically highlight first element of completion menu
|
||||||
|
setopt LIST_PACKED # The completion menu takes less space.
|
||||||
|
setopt AUTO_LIST # Automatically list choices on ambiguous completion.
|
||||||
|
setopt HIST_IGNORE_DUPS # Do not write events to history that are duplicates of previous events
|
||||||
|
setopt HIST_FIND_NO_DUPS # When searching history don't display results already cycled through twice
|
||||||
|
setopt COMPLETE_IN_WORD # Complete from both ends of a word.
|
||||||
|
|
||||||
|
# The Prompt
|
||||||
|
PS1='%B%F{magenta}%n%f%b %B%F{red}%~%f%b${vcs_info_msg_0_}'$'\n''%(?.%B%F{green}$.%F{red}$)%f%b '
|
||||||
|
|
||||||
|
# Plugins
|
||||||
|
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||||
|
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||||
|
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
|
||||||
|
|
||||||
|
bindkey '^[[A' history-substring-search-up
|
||||||
|
bindkey '^[[B' history-substring-search-down
|
||||||
|
|
||||||
|
# Change Terminal Titles
|
||||||
|
function xterm_title_precmd () {
|
||||||
|
print -Pn -- '\e]2;%n@%m %~\a'
|
||||||
|
[[ "$TERM" == 'screen'* ]] && print -Pn -- '\e_\005{g}%n\005{-}@\005{m}%m\005{-} \005{B}%~\005{-}\e\\'
|
||||||
|
}
|
||||||
|
|
||||||
|
function xterm_title_preexec () {
|
||||||
|
print -Pn -- '\e]2;%n@%m %~ %# ' && print -n -- "${(q)1}\a"
|
||||||
|
[[ "$TERM" == 'screen'* ]] && { print -Pn -- '\e_\005{g}%n\005{-}@\005{m}%m\005{-} \005{B}%~\005{-} %# ' && print -n -- "${(q)1}\e\\"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ "$TERM" == (kitty*|alacritty*|termite*|gnome*|konsole*|kterm*|putty*|rxvt*|screen*|tmux*|xterm*) ]]; then
|
||||||
|
add-zsh-hook -Uz precmd xterm_title_precmd
|
||||||
|
add-zsh-hook -Uz preexec xterm_title_preexec
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Alias
|
||||||
|
alias mirrors="sudo reflector --verbose --latest 5 --country 'United States' --age 6 --sort rate --save /etc/pacman.d/mirrorlist"
|
||||||
|
|
||||||
|
alias grub-update="sudo grub-mkconfig -o /boot/grub/grub.cfg"
|
||||||
|
alias maintenance="yay -Sc && sudo pacman -Scc"
|
||||||
|
alias purge="sudo pacman -Rns $(pacman -Qtdq) ; sudo fstrim -av"
|
||||||
|
alias update="yay -Syu --nocombinedupgrade"
|
||||||
|
|
||||||
|
alias vm-on="sudo systemctl start libvirtd.service"
|
||||||
|
alias vm-off="sudo systemctl stop libvirtd.service"
|
||||||
|
|
||||||
|
alias music="ncmpcpp"
|
||||||
|
|
||||||
|
alias ls='lsd -a --group-directories-first'
|
||||||
|
alias dir='lsd -a --group-directories-first'
|
||||||
|
alias ll='lsd -la --group-directories-first'
|
||||||
|
|
||||||
|
# Autostart
|
||||||
|
$HOME/.local/bin/colorscript -r
|
BIN
home/pics/wallpapers/wall-01.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
home/pics/wallpapers/wall-02.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
home/pics/wallpapers/wall-03.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
home/pics/wallpapers/wall-04.png
Normal file
After Width: | Height: | Size: 89 KiB |
BIN
home/pics/wallpapers/wall-05.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
home/pics/wallpapers/wall-06.png
Normal file
After Width: | Height: | Size: 53 KiB |
BIN
home/pics/wallpapers/wall-07.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
home/pics/wallpapers/wall-08.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
home/pics/wallpapers/wall-09.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
home/pics/wallpapers/wall-10.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
home/pics/wallpapers/wall-11.png
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
home/pics/wallpapers/wall-12.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
home/pics/wallpapers/wall-13.png
Normal file
After Width: | Height: | Size: 68 KiB |
4
misc/asciiart/blocks1
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
pcs() { for i in {0..7}; do echo -en "\e[${1}$((30+$i))m \u2588\u2588 \e[0m"; done; }
|
||||||
|
pcsbright() { for i in {0..7}; do echo -en "\e[${1}$((90+$i))m \u2588\u2588 \e[0m"; done; }
|
||||||
|
printf "\n%s\n%s\n\n" "$(pcs)" "$(pcsbright '1;')"
|
145
misc/asciiart/fetch
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#colors
|
||||||
|
#bold="(tput bold)"
|
||||||
|
magenta="\033[1;35m"
|
||||||
|
green="\033[1;32m"
|
||||||
|
white="\033[1;37m"
|
||||||
|
blue="\033[1;34m"
|
||||||
|
red="\033[1;31m"
|
||||||
|
black="\033[1;40;30m"
|
||||||
|
yellow="\033[1;33m"
|
||||||
|
cyan="\033[1;36m"
|
||||||
|
reset="\033[0m"
|
||||||
|
bgyellow="\033[1;43;33m"
|
||||||
|
bgwhite="\033[1;47;37m"
|
||||||
|
c0=${reset}
|
||||||
|
c1=${magenta}
|
||||||
|
c2=${green}
|
||||||
|
c3=${white}
|
||||||
|
c4=${blue}
|
||||||
|
c5=${red}
|
||||||
|
c6=${yellow}
|
||||||
|
c7=${cyan}
|
||||||
|
c8=${black}
|
||||||
|
c9=${bgyellow}
|
||||||
|
c10=${bgwhite}
|
||||||
|
|
||||||
|
# Get the kernel
|
||||||
|
# This will decide the further actionsvand command usages as bsd and gnu tools even with same name are DIFFERENT.
|
||||||
|
kernel=$(uname -o)
|
||||||
|
|
||||||
|
# Get the init
|
||||||
|
get_init() {
|
||||||
|
if pidof -q systemd; then
|
||||||
|
echo 'systemd'
|
||||||
|
elif [ -f '/sbin/openrc' ]; then
|
||||||
|
echo 'openrc'
|
||||||
|
elif [ -f '/sbin/dinit' ]; then
|
||||||
|
echo 'dinit'
|
||||||
|
else
|
||||||
|
cut -d ' ' -f 1 /proc/1/comm
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get count of packages installed
|
||||||
|
get_pkg_count() {
|
||||||
|
package_managers=('xbps-install' 'apk' 'port' 'apt' 'pacman' 'nix' 'dnf' 'rpm' 'emerge' 'eopkg')
|
||||||
|
for package_manager in "${package_managers[@]}"; do
|
||||||
|
if command -v "$package_manager" 2>/dev/null >&2; then
|
||||||
|
case "$package_manager" in
|
||||||
|
xbps-install) xbps-query -l | wc -l ;;
|
||||||
|
apk) apk search | wc -l ;;
|
||||||
|
apt) if [ "$kernel" != "Darwin" ]; then
|
||||||
|
echo $(($(apt list --installed 2>/dev/null | wc -l) - 1))
|
||||||
|
else
|
||||||
|
echo 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
pacman) pacman -Q | wc -l ;;
|
||||||
|
nix) nix-env -qa --installed '*' | wc -l ;;
|
||||||
|
dnf) dnf list installed | wc -l ;;
|
||||||
|
rpm) rpm -qa | wc -l ;;
|
||||||
|
emerge) qlist -I | wc -l ;;
|
||||||
|
port) port installed 2>/dev/null | wc -l | awk 'NR==1{print $1}' ;;
|
||||||
|
eopkg) eopkg li | wc -l ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# if a package manager is found return from the function
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get package information formatted
|
||||||
|
get_package_info() {
|
||||||
|
pkg_count=$(get_pkg_count)
|
||||||
|
|
||||||
|
if [ "$pkg_count" -ne 0 ]; then
|
||||||
|
echo -n "$pkg_count"
|
||||||
|
else
|
||||||
|
echo "Unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get distro name
|
||||||
|
distro() {
|
||||||
|
awk -F '"' '/PRETTY_NAME/ { print $2 }' /etc/os-release
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get root partition space used
|
||||||
|
storage() {
|
||||||
|
df -h --output=used,size / | awk 'NR == 2 { print $1" / "$2 }'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get Memory usage
|
||||||
|
mem() {
|
||||||
|
free --mega | awk 'NR == 2 { print $3" / "$2" MB" }'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get uptime
|
||||||
|
get_uptime() {
|
||||||
|
uptime -p | sed 's/up//'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get DE/WM
|
||||||
|
# Reference: https://github.com/unixporn/robbb/blob/master/fetcher.sh
|
||||||
|
get_de_wm() {
|
||||||
|
wm="${XDG_CURRENT_DESKTOP#*:}"
|
||||||
|
[ "$wm" ] || wm="$DESKTOP_SESSION"
|
||||||
|
|
||||||
|
# for most WMs
|
||||||
|
[ ! "$wm" ] && [ "$DISPLAY" ] && command -v xprop >/dev/null && {
|
||||||
|
id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK 2>/dev/null)
|
||||||
|
id=${id##* }
|
||||||
|
wm=$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t 2>/dev/null | grep '^_NET_WM_NAME' | cut -d\" -f 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
# for non-EWMH WMs
|
||||||
|
[ ! "$wm" ] || [ "$wm" = "LG3D" ] && {
|
||||||
|
wms=('sway' 'kiwmi' 'wayfire' 'sowm' 'catwm' 'fvwm' 'dwm' '2bwm' 'monsterwm' 'tinywm' 'xmonad')
|
||||||
|
for current_wm in "${wms[@]}"; do
|
||||||
|
if pgrep -x "$current_wm" 2>/dev/null >&2; then
|
||||||
|
wm="${current_wm}";
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "${wm:-unknown}"
|
||||||
|
}
|
||||||
|
|
||||||
|
echo -e " ┏━━━━━━━━━━━━━━━━━━━━━━┓"
|
||||||
|
echo -e " ┃ ${c7}f${c4}e${c5}t${c6}${c7}c${c1}h${c0} ${c6}${c0} ${c7}${c0} ${c5}${c0} ┃"
|
||||||
|
echo -e " ┣━━━━━━━━━━━━━━━━━━━━━━┫ ${c1}━━━${c2}━━━${c3}━━━${c4}━━━${c5}━━━${c6}━━━${c7}━━━"
|
||||||
|
echo -e " ${c0} ┃ ┃ ${c1}os${c3} $(distro)"
|
||||||
|
echo -e " ┃ ${c3}•${c8}_${c3}•${c0} ┃ ${c2}ker${c3} $(uname -r)"
|
||||||
|
echo -e " ┃ ${c8}${c0}${c9}oo${c0}${c8}|${c0} ┃ ${c7}pkgs${c3} $(get_package_info)"
|
||||||
|
echo -e " ┃ ${c8}/${c0}${c10} ${c0}${c8}'\'${c0} ┃ ${c5}sh${c3} ${SHELL##*/} ${c6} ${c6}${c2} ${c2}${c4} ${c4}${c5} ${c5}${c7} ${c7}"
|
||||||
|
echo -e " ${c0} ┃ ${c9}(${c0}${c8}\_;/${c0}${c9})${c0} ┃ ${c1}ram${c3} $(mem)"
|
||||||
|
echo -e " ┃ ${c0}┃ ${c2}init${c3} $(get_init)"
|
||||||
|
echo -e " ┃ I ${c1}${c0} Arch ┃ ${c7}de/wm${c3} $(get_de_wm)"
|
||||||
|
echo -e " ┃ ┃ ${c5}up${c3} $(get_uptime)"
|
||||||
|
echo -e " ┃ ┃ ${c1}disk${c3} $(storage)"
|
||||||
|
echo -e " ┗━━━━━━━━━━━━━━━━━━━━━━┛ ${c1}━━━${c2}━━━${c3}━━━${c4}━━━${c5}━━━${c6}━━━${c7}━━━"
|
||||||
|
echo -e " "
|
21
misc/asciiart/zwaves
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Source: http://crunchbang.org/forums/viewtopic.php?pid=141044#p141044
|
||||||
|
f=3 b=4
|
||||||
|
for j in f b; do
|
||||||
|
for i in {0..7}; do
|
||||||
|
printf -v $j$i %b "\e[${!j}${i}m"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
for i in {0..7}; do
|
||||||
|
printf -v fbright$i %b "\e[9${i}m"
|
||||||
|
done
|
||||||
|
bld=$'\e[1m'
|
||||||
|
rst=$'\e[0m'
|
||||||
|
inv=$'\e[7m'
|
||||||
|
|
||||||
|
cat << EOF
|
||||||
|
|
||||||
|
$f1▀■▄ $f2▀■▄ $f3▀■▄ $f4▀■▄ $f5▀■▄ $f6▀■▄
|
||||||
|
$bld$fbright1▀■▄ $fbright2▀■▄ $fbright3▀■▄ $fbright4▀■▄ $fbright5▀■▄ $fbright6▀■▄$rst
|
||||||
|
|
||||||
|
EOF
|
1
misc/assets/brightness.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Layer_1" width="800" height="800" version="1.1" viewBox="0 0 512 512" xml:space="preserve"><g><path style="fill:#f2d23d" d="M256.007,423.724c-0.004,0-0.004,0-0.007,0c-14.626,0-26.483,11.857-26.483,26.483v35.31 C229.517,500.143,241.374,512,256,512c0.004,0,0.004,0,0.007,0c14.622-0.004,26.476-11.859,26.476-26.483v-35.31 C282.483,435.583,270.629,423.728,256.007,423.724z"/><path style="fill:#f2d23d" d="M256.007,0c-0.004,0-0.004,0-0.007,0c-14.626,0-26.483,11.857-26.483,26.483v35.31 c0,14.626,11.857,26.483,26.483,26.483c0.004,0,0.004,0,0.007,0c14.622-0.004,26.476-11.859,26.476-26.483v-35.31 C282.483,11.859,270.629,0.004,256.007,0z"/><path style="fill:#f2d23d" d="M256.007,141.241h-0.004c-63.276,0-114.755,51.481-114.755,114.759s51.479,114.759,114.755,114.759 h0.004c63.278-0.002,114.759-51.481,114.759-114.759C370.766,192.724,319.285,141.243,256.007,141.241z"/></g><g><path style="fill:#eebf00" d="M256.004,141.241c-63.276,0-114.755,51.481-114.755,114.76c0,63.278,51.479,114.757,114.755,114.757 h0.004V141.241H256.004z"/><path style="fill:#eebf00" d="M256.007,88.276V0c-0.004,0-0.004,0-0.007,0c-14.626,0-26.483,11.857-26.483,26.483v35.31 c0,14.626,11.857,26.483,26.483,26.483C256.004,88.276,256.004,88.276,256.007,88.276z"/><path style="fill:#eebf00" d="M256,423.724c-14.626,0-26.483,11.857-26.483,26.483v35.31C229.517,500.143,241.374,512,256,512 c0.004,0,0.004,0,0.007,0v-88.276C256.004,423.724,256.004,423.724,256,423.724z"/></g><path style="fill:#f2d23d" d="M423.724,256c0,14.626,11.857,26.483,26.483,26.483h35.31C500.143,282.483,512,270.626,512,256 c0-14.626-11.857-26.483-26.483-26.483h-35.31C435.581,229.517,423.724,241.374,423.724,256z"/><path style="fill:#eebf00" d="M26.483,282.483h35.31c14.626,0,26.483-11.857,26.483-26.483c0-14.626-11.857-26.483-26.483-26.483 h-35.31C11.857,229.517,0,241.374,0,256C0,270.626,11.857,282.483,26.483,282.483z"/><path style="fill:#f2d23d" d="M399.567,74.98l-24.97,24.968c-10.342,10.342-10.342,27.11,0,37.452 c5.171,5.171,11.949,7.758,18.725,7.758s13.556-2.586,18.725-7.756l24.97-24.968c10.342-10.342,10.342-27.11,0-37.452 C426.68,64.637,409.911,64.637,399.567,74.98z"/><path style="fill:#eebf00" d="M99.949,374.597l-24.968,24.968c-10.342,10.342-10.342,27.109,0,37.452 c5.171,5.171,11.949,7.756,18.725,7.756s13.556-2.586,18.725-7.756l24.97-24.968c10.342-10.342,10.342-27.11,0-37.452 C127.061,364.256,110.292,364.254,99.949,374.597z"/><path style="fill:#f2d23d" d="M399.567,437.018c5.171,5.171,11.949,7.756,18.725,7.756c6.778,0,13.556-2.585,18.727-7.756 c10.342-10.342,10.342-27.11,0-37.452l-24.97-24.968c-10.341-10.341-27.11-10.341-37.452,0.002 c-10.342,10.342-10.342,27.109,0,37.452L399.567,437.018z"/><path style="fill:#eebf00" d="M99.949,137.401c5.171,5.171,11.949,7.756,18.727,7.756c6.778,0,13.556-2.586,18.725-7.758 c10.342-10.342,10.342-27.11,0-37.452L112.433,74.98c-10.341-10.341-27.11-10.341-37.452,0c-10.342,10.342-10.342,27.11,0,37.452 L99.949,137.401z"/></svg>
|
After Width: | Height: | Size: 2.9 KiB |
BIN
misc/assets/fallback.webp
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
misc/assets/mute.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
misc/assets/readme-preview.png
Normal file
After Width: | Height: | Size: 32 KiB |
1
misc/assets/reload.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Layer_1" width="800" height="800" version="1.1" viewBox="0 0 512 512" xml:space="preserve"><circle style="fill:#a5eb78" cx="256.005" cy="256.005" r="247.556"/><path style="opacity:.1;enable-background:new" d="M53.508,289.795c0-136.719,110.832-247.551,247.551-247.551 c45.567,0,88.25,12.325,124.92,33.802C381.637,34.146,321.823,8.449,256,8.449C119.281,8.449,8.449,119.281,8.449,256 c0,91.152,49.273,170.784,122.631,213.748C83.318,424.618,53.508,360.691,53.508,289.795z"/><g><path style="fill:#fff" d="M391.375,234.761L366.4,94.714l-35.529,35.529c-22.076-13.136-47.765-20.559-74.872-20.559 c-36.924,0-72.186,13.795-99.289,38.842c-26.941,24.899-43.46,58.683-46.514,95.13l67.354,5.644 c1.64-19.572,10.53-37.733,25.035-51.137c14.577-13.473,33.547-20.892,53.414-20.892c8.352,0,16.447,1.322,24.075,3.767 l-28.749,28.749L391.375,234.761z"/><path style="fill:#fff" d="M110.197,277.238l24.975,140.049l35.529-35.529c22.076,13.136,47.765,20.559,74.872,20.559 c36.924,0,72.186-13.795,99.289-38.842c26.941-24.899,43.46-58.683,46.514-95.13l-67.354-5.644 c-1.64,19.572-10.53,37.733-25.035,51.137c-14.577,13.473-33.547,20.892-53.414,20.892c-8.352,0-16.447-1.323-24.075-3.767 l28.749-28.749L110.197,277.238z"/></g><path d="M256,512c-68.38,0-132.667-26.629-181.019-74.981C26.629,388.667,0,324.38,0,256c0-75.008,32.755-145.994,89.866-194.758 c3.548-3.029,8.881-2.61,11.911,0.938c3.03,3.548,2.609,8.881-0.938,11.911C47.493,119.642,16.897,185.943,16.897,256 c0,131.841,107.261,239.103,239.103,239.103c55.438,0,109.469-19.406,152.142-54.641c3.597-2.972,8.923-2.463,11.895,1.135 c2.971,3.598,2.462,8.923-1.135,11.895C373.208,491.221,315.356,512,256,512z"/><path d="M438.06,432.164c-2.047,0-4.099-0.739-5.724-2.236c-3.431-3.163-3.649-8.507-0.487-11.938 c40.789-44.256,63.252-101.784,63.252-161.989C495.103,124.159,387.841,16.897,256,16.897c-45.761,0-90.232,12.968-128.607,37.501 c-3.929,2.513-9.155,1.364-11.668-2.567s-1.364-9.155,2.567-11.668C159.389,13.887,207.008,0,256,0 c68.38,0,132.667,26.629,181.019,74.981S512,187.62,512,256c0,64.461-24.053,126.056-67.725,173.441 C442.61,431.248,440.338,432.164,438.06,432.164z"/><path d="M177.56,257.748c-0.237,0-0.474-0.01-0.714-0.03l-67.354-5.644c-4.65-0.39-8.104-4.474-7.714-9.125 c3.231-38.557,20.703-74.295,49.198-100.63c28.669-26.496,65.968-41.087,105.023-41.087c25.686,0,50.937,6.375,73.441,18.491 l30.985-30.985c2.226-2.225,5.502-3.028,8.507-2.086c3.003,0.944,5.232,3.479,5.784,6.576l24.975,140.049 c0.486,2.719-0.39,5.504-2.343,7.457c-1.952,1.953-4.737,2.831-7.457,2.343l-140.049-24.975c-3.098-0.552-5.632-2.781-6.576-5.784 c-0.943-3.003-0.14-6.281,2.086-8.507l17.735-17.735c-2.351-0.238-4.717-0.357-7.088-0.357c-17.736,0-34.67,6.623-47.681,18.648 c-12.949,11.967-20.886,28.174-22.349,45.637C185.599,254.415,181.906,257.748,177.56,257.748z M119.58,235.963l50.667,4.246 c3.373-18.447,12.638-35.343,26.605-48.251c16.143-14.919,37.149-23.136,59.149-23.136c9.049,0,18.016,1.402,26.653,4.169 c2.805,0.899,4.94,3.194,5.634,6.056s-0.154,5.88-2.237,7.963l-17.299,17.299l112.181,20.005l-20.006-112.18l-24.08,24.08 c-2.732,2.734-6.971,3.263-10.295,1.286c-21.296-12.673-45.692-19.371-70.55-19.371c-34.791,0-68.017,12.997-93.554,36.598 C139.142,176.268,124.114,204.857,119.58,235.963z"/><path d="M135.171,425.735c-0.846,0-1.7-0.127-2.532-0.389c-3.003-0.944-5.233-3.479-5.785-6.576L101.88,278.721 c-0.486-2.719,0.39-5.504,2.343-7.457c1.952-1.953,4.736-2.832,7.457-2.343l140.049,24.975c3.098,0.552,5.632,2.781,6.576,5.784 c0.943,3.003,0.14,6.281-2.086,8.507l-17.735,17.735c2.351,0.238,4.717,0.357,7.088,0.357c17.736,0,34.67-6.623,47.681-18.648 c12.949-11.967,20.886-28.174,22.349-45.637c0.39-4.649,4.477-8.101,9.125-7.713l67.354,5.644c4.65,0.39,8.104,4.474,7.714,9.125 c-3.231,38.557-20.702,74.295-49.198,100.63c-28.669,26.496-65.968,41.087-105.023,41.087c-25.686,0-50.937-6.375-73.441-18.491 l-30.985,30.985C139.537,424.87,137.379,425.735,135.171,425.735z M120.642,287.682l20.005,112.181l24.08-24.08 c2.733-2.734,6.972-3.261,10.295-1.286c21.296,12.673,45.692,19.371,70.551,19.371c34.791,0,68.017-12.997,93.554-36.598 c23.305-21.537,38.332-50.127,42.866-81.234l-50.667-4.246c-3.373,18.447-12.638,35.343-26.605,48.251 c-16.142,14.919-37.149,23.136-59.149,23.136c-9.049,0-18.016-1.402-26.653-4.169c-2.805-0.899-4.94-3.194-5.634-6.056 c-0.694-2.862,0.154-5.88,2.237-7.963l17.299-17.299L120.642,287.682z"/></svg>
|
After Width: | Height: | Size: 4.3 KiB |
1
misc/assets/screenshot.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="800" fill="none" viewBox="-4.8 -4.8 57.6 57.6"><g id="SVGRepo_iconCarrier"><path stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M16 6H8C6.89543 6 6 6.89543 6 8V16"/><path stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M16 42H8C6.89543 42 6 41.1046 6 40V32"/><path stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M32 42H40C41.1046 42 42 41.1046 42 40V32"/><path stroke="#f6f5f4" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M32 6H40C41.1046 6 42 6.89543 42 8V16"/><rect width="20" height="20" x="14" y="14" fill="#e01b24" stroke="#f6f5f4" stroke-width="4" rx="2"/></g></svg>
|
After Width: | Height: | Size: 765 B |
BIN
misc/assets/vol.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
27
misc/bin/brightness
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Originally created by - https://github.com/rxyhn
|
||||||
|
|
||||||
|
DIR="$HOME/.local/share/assets"
|
||||||
|
BRIGHTNESS_STEPS=5
|
||||||
|
|
||||||
|
function get_brightness {
|
||||||
|
brightnessctl i | grep -oP '\(\K[^%\)]+'
|
||||||
|
}
|
||||||
|
|
||||||
|
function send_notification {
|
||||||
|
icon="$DIR/brightness.svg"
|
||||||
|
brightness=$(get_brightness)
|
||||||
|
bar=$(seq -s "─" 0 $((brightness / 5)) | sed 's/[0-9]//g')
|
||||||
|
dunstify "Brightness $brightness%" -i $icon -r 5555 -u normal -h int:value:$(($brightness))
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
up)
|
||||||
|
brightnessctl set "${BRIGHTNESS_STEPS:-5}%+" -q
|
||||||
|
send_notification
|
||||||
|
;;
|
||||||
|
down)
|
||||||
|
brightnessctl set "${BRIGHTNESS_STEPS:-5}%-" -q
|
||||||
|
send_notification
|
||||||
|
;;
|
||||||
|
esac
|
9
misc/bin/bsphidenode
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
NHidden=$(bspc query -N -n .hidden -d focused)
|
||||||
|
|
||||||
|
if [ -z "$NHidden" ]; then
|
||||||
|
bspc node focused -g hidden=on
|
||||||
|
else
|
||||||
|
bspc node "$NHidden" -g hidden=off
|
||||||
|
fi
|
160
misc/bin/colorscript
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Simple CLI for shell-color-scripts
|
||||||
|
|
||||||
|
if [[ "$DEV" -gt 0 ]]; then
|
||||||
|
DIR_COLORSCRIPTS="./colorscripts"
|
||||||
|
else
|
||||||
|
DIR_COLORSCRIPTS="$HOME/.local/share/asciiart"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v find &>/dev/null; then
|
||||||
|
LS_CMD="$(command -v find) ${DIR_COLORSCRIPTS} -maxdepth 1 -type f"
|
||||||
|
LS_CMD_B="$(command -v find) ${DIR_COLORSCRIPTS}/blacklisted -maxdepth 1 -type f"
|
||||||
|
else
|
||||||
|
LS_CMD="$(command -v ls) ${DIR_COLORSCRIPTS}"
|
||||||
|
LS_CMD_B="$(command -v ls) ${DIR_COLORSCRIPTS}/blacklisted"
|
||||||
|
fi
|
||||||
|
|
||||||
|
list_colorscripts="$($LS_CMD | xargs -I $ basename $ | cut -d ' ' -f 1 | nl)"
|
||||||
|
length_colorscripts="$($LS_CMD | wc -l)"
|
||||||
|
list_blacklist="$($LS_CMD_B 2>/dev/null | xargs -I $ basename $ | cut -d ' ' -f 1 | nl || "")"
|
||||||
|
length_blacklist="$($LS_CMD_B 2>/dev/null | wc -l || 0)"
|
||||||
|
|
||||||
|
fmt_help=" %-20s\t%-54s\n"
|
||||||
|
function _help() {
|
||||||
|
echo "Description: A collection of terminal color scripts."
|
||||||
|
echo ""
|
||||||
|
echo "Usage: colorscript [OPTION] [SCRIPT NAME/INDEX]"
|
||||||
|
printf "${fmt_help}" \
|
||||||
|
"-h, --help, help" "Print this help." \
|
||||||
|
"-l, --list, list" "List all installed color scripts." \
|
||||||
|
"-r, --random, random" "Run a random color script." \
|
||||||
|
"-e, --exec, exec" "Run a specified color script by SCRIPT NAME or INDEX."\
|
||||||
|
"-b, --blacklist, blacklist" "Blacklist a color script by SCRIPT NAME or INDEX." \
|
||||||
|
"-u, --unblacklist, unblacklist" "Unblacklist a color script by SCRIPT NAME or INDEX." \
|
||||||
|
"-a, --all, all" "List the outputs of all colorscripts with their SCRIPT NAME"
|
||||||
|
}
|
||||||
|
|
||||||
|
function _list() {
|
||||||
|
echo "There are "$($LS_CMD | wc -l)" installed color scripts:"
|
||||||
|
echo "${list_colorscripts}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function _list_blacklist() {
|
||||||
|
echo "There are $length_blacklist blacklisted color scripts:"
|
||||||
|
echo "${list_blacklist}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function _random() {
|
||||||
|
declare -i random_index=$RANDOM%$length_colorscripts
|
||||||
|
[[ $random_index -eq 0 ]] && random_index=1
|
||||||
|
|
||||||
|
random_colorscript="$(echo "${list_colorscripts}" | sed -n ${random_index}p \
|
||||||
|
| tr -d ' ' | tr '\t' ' ' | cut -d ' ' -f 2)"
|
||||||
|
# echo "${random_colorscript}"
|
||||||
|
exec "${DIR_COLORSCRIPTS}/${random_colorscript}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function ifhascolorscipt() {
|
||||||
|
[[ -e "${DIR_COLORSCRIPTS}/$1" ]] && echo "Has this color script."
|
||||||
|
}
|
||||||
|
|
||||||
|
function _run_by_name() {
|
||||||
|
if [[ "$1" == "random" ]]; then
|
||||||
|
_random
|
||||||
|
elif [[ -n "$(ifhascolorscipt "$1")" ]]; then
|
||||||
|
exec "${DIR_COLORSCRIPTS}/$1"
|
||||||
|
else
|
||||||
|
echo "Input error, Don't have color script named $1."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function _run_by_index() {
|
||||||
|
if [[ "$1" -gt 0 && "$1" -le "${length_colorscripts}" ]]; then
|
||||||
|
|
||||||
|
colorscript="$(echo "${list_colorscripts}" | sed -n ${1}p \
|
||||||
|
| tr -d ' ' | tr '\t' ' ' | cut -d ' ' -f 2)"
|
||||||
|
exec "${DIR_COLORSCRIPTS}/${colorscript}"
|
||||||
|
else
|
||||||
|
echo "Input error, Don't have color script indexed $1."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function _run_colorscript() {
|
||||||
|
if [[ "$1" =~ ^[0-9]+$ ]]; then
|
||||||
|
_run_by_index "$1"
|
||||||
|
else
|
||||||
|
_run_by_name "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function _run_all() {
|
||||||
|
for s in $DIR_COLORSCRIPTS/*
|
||||||
|
do
|
||||||
|
echo "$(echo $s | awk -F '/' '{print $NF}'):"
|
||||||
|
echo "$($s)"
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function _blacklist_colorscript() { # by name only
|
||||||
|
if [ ! -d "${DIR_COLORSCRIPTS}/blacklisted" ]; then
|
||||||
|
sudo mkdir "${DIR_COLORSCRIPTS}/blacklisted"
|
||||||
|
fi
|
||||||
|
sudo mv "${DIR_COLORSCRIPTS}/$1" "${DIR_COLORSCRIPTS}/blacklisted"
|
||||||
|
}
|
||||||
|
|
||||||
|
function _unblacklist_colorscript() { # by name only
|
||||||
|
if [ -f "${DIR_COLORSCRIPTS}/blacklisted/$1" ]; then
|
||||||
|
sudo mv "${DIR_COLORSCRIPTS}/blacklisted/$1" "${DIR_COLORSCRIPTS}"
|
||||||
|
else
|
||||||
|
echo "Input error. Script $1 is not blacklisted!"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$#" in
|
||||||
|
0)
|
||||||
|
_help
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
case "$1" in
|
||||||
|
-h | --help | help)
|
||||||
|
_help
|
||||||
|
;;
|
||||||
|
-l | --list | list)
|
||||||
|
_list
|
||||||
|
;;
|
||||||
|
-b | --blacklist | blacklist)
|
||||||
|
_list_blacklist
|
||||||
|
;;
|
||||||
|
-r | --random | random)
|
||||||
|
_random
|
||||||
|
;;
|
||||||
|
-a | --all | all)
|
||||||
|
_run_all
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Input error."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
if [[ "$1" == "-e" || "$1" == "--exec" || "$1" == "exec" ]]; then
|
||||||
|
_run_colorscript "$2"
|
||||||
|
elif [[ "$1" == "-b" || "$1" == "--blacklist" || "$1" == "blacklist" ]]; then
|
||||||
|
_blacklist_colorscript "$2"
|
||||||
|
elif [[ "$1" == "-u" || "$1" == "--unblacklist" || "$1" == "unblacklist" ]]; then
|
||||||
|
_unblacklist_colorscript "$2"
|
||||||
|
else
|
||||||
|
echo "Input error."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Input error, too many arguments."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
32
misc/bin/externalrules
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
wid=$1
|
||||||
|
class=$2
|
||||||
|
instance=$3
|
||||||
|
consequences=$4
|
||||||
|
|
||||||
|
case "$class" in
|
||||||
|
floaterm)
|
||||||
|
eval "$consequences"
|
||||||
|
[ "$state" ] || echo "state=floating center=on"
|
||||||
|
;;
|
||||||
|
updating)
|
||||||
|
eval "$consequences"
|
||||||
|
[ "$state" ] || echo "state=floating sticky=on center=on"
|
||||||
|
;;
|
||||||
|
mpv)
|
||||||
|
eval "$consequences"
|
||||||
|
[ "$state" ] || echo "state=pseudo_tiled focus=on rectangle=849x477+0+0 center=on"
|
||||||
|
;;
|
||||||
|
virt-manager)
|
||||||
|
eval "$consequences"
|
||||||
|
[ "$state" ] || echo "state=floating desktop=^5 follow=on center=on"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$instance" in
|
||||||
|
Toolkit)
|
||||||
|
eval "$consequences"
|
||||||
|
[ "$state" ] || echo "state=floating sticky=on rectangle=500x290+1054+593"
|
||||||
|
;;
|
||||||
|
esac
|
21
misc/bin/hidebar
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
function hide() {
|
||||||
|
polybar-msg cmd hide | bspc config top_padding 2 | bspc config bottom_padding 2
|
||||||
|
}
|
||||||
|
|
||||||
|
function unhide() {
|
||||||
|
polybar-msg cmd show | bspc config top_padding 48 | bspc config bottom_padding 48
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
-h | --hide | hide)
|
||||||
|
hide
|
||||||
|
exit;;
|
||||||
|
-u | --unhide | unhide)
|
||||||
|
unhide
|
||||||
|
exit;;
|
||||||
|
*)
|
||||||
|
echo "Error: Invalid option"
|
||||||
|
exit;;
|
||||||
|
esac
|
4
misc/bin/keybindingshelp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
awk '/^[a-z]/ && last {print $0,"\t",last} {last=""} /^#/{last=$0}' ~/.config/sxhkd/sxhkdrc | \
|
||||||
|
column -t -s $'\t' | rofi -dmenu -i -markup-rows -no-show-icons -width 1000 -lines 15 -yoffset 40
|
132
misc/bin/mediacontrol
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Set the player
|
||||||
|
[ -n "$(pgrep spotify)" ] && Control="spotify" || Control="MPD"
|
||||||
|
|
||||||
|
Cover=/tmp/cover.png
|
||||||
|
bkpCover=~/.local/share/assets/fallback.webp
|
||||||
|
mpddir=~/music
|
||||||
|
|
||||||
|
case $Control in
|
||||||
|
MPD)
|
||||||
|
case $1 in
|
||||||
|
--next)
|
||||||
|
mpc -q next
|
||||||
|
;;
|
||||||
|
--previous)
|
||||||
|
mpc -q prev
|
||||||
|
;;
|
||||||
|
--toggle)
|
||||||
|
mpc -q toggle
|
||||||
|
;;
|
||||||
|
--stop)
|
||||||
|
mpc -q stop
|
||||||
|
;;
|
||||||
|
--title)
|
||||||
|
title=$(mpc -f %title% current)
|
||||||
|
echo "${title:-Play Something}"
|
||||||
|
;;
|
||||||
|
--artist)
|
||||||
|
artist=$(mpc -f %artist% current)
|
||||||
|
echo "${artist:-No Artist}"
|
||||||
|
;;
|
||||||
|
--status)
|
||||||
|
status=$(mpc status | head -2 | tail -1 | cut -c2-8 | sed 's/]//g' | sed 's/./\U&/')
|
||||||
|
echo "${status:-Stopped}"
|
||||||
|
;;
|
||||||
|
--player)
|
||||||
|
echo "$Control"
|
||||||
|
;;
|
||||||
|
--cover)
|
||||||
|
ffmpeg -i "$mpddir"/"$(mpc current -f %file%)" "${Cover}" -y &> /dev/null || cp $bkpCover $Cover
|
||||||
|
echo "$Cover"
|
||||||
|
;;
|
||||||
|
nccover)
|
||||||
|
ffmpeg -i "$mpddir"/"$(mpc current -f %file%)" "${Cover}" -y &> /dev/null || cp $bkpCover $Cover
|
||||||
|
;;
|
||||||
|
--position)
|
||||||
|
position=$(mpc status %currenttime%)
|
||||||
|
echo "${position:-0:00}"
|
||||||
|
;;
|
||||||
|
--positions)
|
||||||
|
positions=$(mpc status %currenttime% | awk -F: '{print ($1 * 60) + $2}')
|
||||||
|
echo "${positions:-0}"
|
||||||
|
;;
|
||||||
|
--length)
|
||||||
|
length=$(mpc status %totaltime%)
|
||||||
|
echo "${length:-0:00}"
|
||||||
|
;;
|
||||||
|
--lengths)
|
||||||
|
lengths=$(mpc status %totaltime% | awk -F: '{print ($1 * 60) + $2}')
|
||||||
|
echo "${lengths:-0}"
|
||||||
|
;;
|
||||||
|
--shuffle)
|
||||||
|
shuffle=$(mpc status | sed -n '3s/.*random: \([^ ]*\).*/\1/p' | sed 's/.*/\u&/')
|
||||||
|
echo "${shuffle:-Off}"
|
||||||
|
;;
|
||||||
|
--loop)
|
||||||
|
loop=$(mpc status | sed -n '3s/.*repeat: \([^ ]*\).*/\1/p' | sed 's/.*/\u&/')
|
||||||
|
echo "${loop:-Off}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
case $1 in
|
||||||
|
--next)
|
||||||
|
playerctl --player=$Control next
|
||||||
|
;;
|
||||||
|
--previous)
|
||||||
|
playerctl --player=$Control previous
|
||||||
|
;;
|
||||||
|
--toggle)
|
||||||
|
playerctl --player=$Control play-pause
|
||||||
|
;;
|
||||||
|
--stop)
|
||||||
|
playerctl --player=$Control stop
|
||||||
|
;;
|
||||||
|
--title)
|
||||||
|
title=$(playerctl --player=$Control metadata --format {{title}})
|
||||||
|
echo "${title:-Play Something}"
|
||||||
|
;;
|
||||||
|
--artist)
|
||||||
|
artist=$(playerctl --player=$Control metadata --format {{artist}})
|
||||||
|
echo "${artist:-No Artist}"
|
||||||
|
;;
|
||||||
|
--status)
|
||||||
|
status=$(playerctl --player=$Control status)
|
||||||
|
echo "${status:-Stopped}"
|
||||||
|
;;
|
||||||
|
--player)
|
||||||
|
echo "$Control"
|
||||||
|
;;
|
||||||
|
--cover)
|
||||||
|
albumart="$(playerctl --player=$Control metadata mpris:artUrl | sed -e 's/open.spotify.com/i.scdn.co/g')"
|
||||||
|
[ $(playerctl --player=$Control metadata mpris:artUrl) ] && curl -s "$albumart" --output $Cover || cp $bkpCover $Cover
|
||||||
|
echo "$Cover"
|
||||||
|
;;
|
||||||
|
--position)
|
||||||
|
position=$(playerctl --player=$Control position --format "{{ duration(position) }}")
|
||||||
|
echo "${position:-0:00}"
|
||||||
|
;;
|
||||||
|
--positions)
|
||||||
|
positions=$(playerctl --player=$Control position | sed 's/..\{6\}$//')
|
||||||
|
echo "${positions:-0}"
|
||||||
|
;;
|
||||||
|
--length)
|
||||||
|
length=$(playerctl --player=$Control metadata --format "{{ duration(mpris:length) }}")
|
||||||
|
echo "${length:-0:00}"
|
||||||
|
;;
|
||||||
|
--lengths)
|
||||||
|
lengths=$(playerctl --player=$Control metadata mpris:length | sed 's/.\{6\}$//')
|
||||||
|
echo "${lengths:-0}"
|
||||||
|
;;
|
||||||
|
--shuffle)
|
||||||
|
shuffle=$(playerctl --player=$Control shuffle)
|
||||||
|
echo "${shuffle:-Off}"
|
||||||
|
;;
|
||||||
|
--loop)
|
||||||
|
loop=$(playerctl --player=$Control loop)
|
||||||
|
echo "${loop:-None}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
esac 2>/dev/null
|
37
misc/bin/openapp
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
--menu)
|
||||||
|
rofi -show drun -theme $HOME/.config/rofi/launcher.rasi
|
||||||
|
;;
|
||||||
|
--terminal)
|
||||||
|
alacritty
|
||||||
|
;;
|
||||||
|
--floating)
|
||||||
|
alacritty --class floaterm,alacritty -o window.dimensions.lines=22 window.dimensions.columns=90
|
||||||
|
;;
|
||||||
|
--update)
|
||||||
|
alacritty --hold --class floaterm,alacritty -o window.dimensions.lines=22 window.dimensions.columns=90 -e updates --update-system
|
||||||
|
;;
|
||||||
|
--checkupdates)
|
||||||
|
alacritty --hold --class updating,alacritty -o window.dimensions.lines=22 window.dimensions.columns=47 -e updates --print-updates
|
||||||
|
;;
|
||||||
|
--ranger)
|
||||||
|
alacritty --class alacritty -e ranger
|
||||||
|
;;
|
||||||
|
--nvim)
|
||||||
|
alacritty -e nvim
|
||||||
|
;;
|
||||||
|
--music)
|
||||||
|
alacritty --class floaterm,alacritty -o window.dimensions.lines=18 window.dimensions.columns=67 -e ncmpcpp
|
||||||
|
;;
|
||||||
|
--fetch)
|
||||||
|
alacritty --hold --class floaterm,alacritty -o window.dimensions.lines=21 window.dimensions.columns=90 -e neofetch
|
||||||
|
;;
|
||||||
|
--browser)
|
||||||
|
brave
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Not a Valid Option"
|
||||||
|
;;
|
||||||
|
esac
|
42
misc/bin/screenshoter
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
timestamp=$(date +%d_%m_%Y-%I-%M-%S)
|
||||||
|
dir="$(xdg-user-dir PICTURES)/screenshots"
|
||||||
|
filename="$dir/screenshot-${timestamp}.png"
|
||||||
|
|
||||||
|
[ -d "$dir" ] || mkdir -p "$dir"
|
||||||
|
|
||||||
|
show_notification() {
|
||||||
|
dunstify --replace=699 -i "$1" "Screenshot" "$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
countdown() {
|
||||||
|
for sec in $(seq "$1" -1 1); do
|
||||||
|
dunstify -t 1000 --replace=699 -i ~/.local/misc/share/assets/screenshot.svg "Taking shot in : $sec"
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
take_screenshot() {
|
||||||
|
maim -u "$filename"
|
||||||
|
xclip -selection clipboard -t image/png -i "$filename"
|
||||||
|
show_notification "$filename" "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
--now)
|
||||||
|
take_screenshot "Screensot saved and copied to clipboard";;
|
||||||
|
--in10)
|
||||||
|
countdown 10
|
||||||
|
take_screenshot "Scheduled capture taken after 10 seconds and copied to clipboard";;
|
||||||
|
--sel)
|
||||||
|
maim -u -s "$filename"
|
||||||
|
xclip -selection clipboard -t image/png -i "$filename"
|
||||||
|
show_notification "$filename" "Screenshot of selected area saved and copied to clipboard";;
|
||||||
|
--active)
|
||||||
|
maim -u -i "$(xdotool getactivewindow)" "$filename"
|
||||||
|
xclip -selection clipboard -t image/png -i "$filename"
|
||||||
|
show_notification "$filename" "Screenshot of active window saved and copied to clipboard";;
|
||||||
|
*)
|
||||||
|
take_screenshot "Screensot saved and copied to clipboard";;
|
||||||
|
esac
|
48
misc/bin/setsysvars
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
SFILE="$HOME/.local/bin/.sys"
|
||||||
|
|
||||||
|
function get_values() {
|
||||||
|
|
||||||
|
DEFNETWORK=$(ip route | grep '^default' | awk '{print $5}' | head -n1)
|
||||||
|
CARD=$(ls -1 /sys/class/backlight/)
|
||||||
|
power_supply_files=$(ls /sys/class/power_supply/)
|
||||||
|
|
||||||
|
for file in $power_supply_files
|
||||||
|
do
|
||||||
|
if [ -e "/sys/class/power_supply/$file/capacity" ]; then
|
||||||
|
battery_file=$file
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e "/sys/class/power_supply/$file/online" ]; then
|
||||||
|
adapter_file=$file
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
BATTERY="$battery_file"
|
||||||
|
ADAPTER="$adapter_file"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_values() {
|
||||||
|
|
||||||
|
if [[ "$DEFNETWORK" ]]; then
|
||||||
|
sed -i -e "s/sys_network_interface = .*/sys_network_interface = $DEFNETWORK/g" $HOME/.config/polybar/system.ini
|
||||||
|
fi
|
||||||
|
if [[ "$ADAPTER" ]]; then
|
||||||
|
sed -i -e "s/sys_adapter = .*/sys_adapter = $ADAPTER/g" $HOME/.config/polybar/system.ini
|
||||||
|
fi
|
||||||
|
if [[ "$BATTERY" ]]; then
|
||||||
|
sed -i -e "s/sys_battery = .*/sys_battery = $BATTERY/g" $HOME/.config/polybar/system.ini
|
||||||
|
fi
|
||||||
|
if [[ "$CARD" ]]; then
|
||||||
|
sed -i -e "s/sys_graphics_card = .*/sys_graphics_card = $CARD/g" $HOME/.config/polybar/system.ini
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ ! -f "$SFILE" ]]; then
|
||||||
|
get_values
|
||||||
|
set_values
|
||||||
|
touch "$SFILE"
|
||||||
|
fi
|
45
misc/bin/updates
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
get_total_updates() {
|
||||||
|
local total_updates=$(($(checkupdates 2> /dev/null | wc -l || echo 0) + $(yay -Qua 2> /dev/null | wc -l || echo 0)))
|
||||||
|
echo "${total_updates:-0}"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_list_updates() {
|
||||||
|
echo -e "\033[1m\033[34mRegular updates:\033[0m"
|
||||||
|
checkupdates | sed 's/->/\x1b[32;1m\x1b[0m/g'
|
||||||
|
}
|
||||||
|
|
||||||
|
get_list_aur_updates() {
|
||||||
|
echo -e "\n\033[1m\033[34mAur updates available:\033[0m"
|
||||||
|
yay -Qua | sed 's/->/\x1b[32;1m\x1b[0m/g'
|
||||||
|
}
|
||||||
|
|
||||||
|
print_updates() {
|
||||||
|
local print_updates=$(get_total_updates)
|
||||||
|
|
||||||
|
if [[ "$print_updates" -gt 0 ]]; then
|
||||||
|
echo -e "\033[1m\033[33mThere are $print_updates updates available:\033[0m\n"
|
||||||
|
get_list_updates
|
||||||
|
get_list_aur_updates
|
||||||
|
else
|
||||||
|
echo -e "\033[1m\033[32mYour system is already updated!\033[0m"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
update_system() {
|
||||||
|
yay -Syu --nocombinedupgrade --noconfirm
|
||||||
|
echo -e "\033[1m\033[32mFinished!\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
--get-updates)get_total_updates;;
|
||||||
|
--print-updates)print_updates;;
|
||||||
|
--update-system)update_system;;
|
||||||
|
--help|*)echo -e "Updates [options]
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--get-updates Get the numer of updates available.
|
||||||
|
--print-updates Print the available package to updates.
|
||||||
|
--update-system Update your system including AUR.\n"
|
||||||
|
esac
|
58
misc/bin/volume
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Icons
|
||||||
|
vol_dir="$HOME/.local/share/assets"
|
||||||
|
notify_cmd='dunstify -u low -h string:x-dunst-stack-tag:cvolum'
|
||||||
|
|
||||||
|
# Get Volume
|
||||||
|
get_volume() {
|
||||||
|
pamixer --get-volume-human | sed 's/%//'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get icons
|
||||||
|
get_icon() {
|
||||||
|
current="$(get_volume)"
|
||||||
|
if [[ "$current" -eq "0" || "$current" == "muted" ]]; then
|
||||||
|
icon="$vol_dir/mute.png"
|
||||||
|
else
|
||||||
|
icon="$vol_dir/vol.png"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Notify
|
||||||
|
notify_user() {
|
||||||
|
${notify_cmd} -i "$icon" "Volume : $(get_volume)%"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Adjust Volume
|
||||||
|
adjust_volume() {
|
||||||
|
[[ $(pamixer --get-mute) == true ]] && pamixer -u
|
||||||
|
pamixer --allow-boost --set-limit 150 "$1" "$2" && get_icon && notify_user
|
||||||
|
}
|
||||||
|
|
||||||
|
# Toggle Mute
|
||||||
|
toggle_mute() {
|
||||||
|
if [[ $(pamixer --get-mute) == false ]]; then
|
||||||
|
pamixer --toggle-mute
|
||||||
|
get_icon
|
||||||
|
message="Mute"
|
||||||
|
else
|
||||||
|
pamixer --toggle-mute
|
||||||
|
get_icon
|
||||||
|
message="Unmute"
|
||||||
|
fi
|
||||||
|
${notify_cmd} -i "$icon" "$message"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Execute accordingly
|
||||||
|
if command -v pamixer &>/dev/null; then
|
||||||
|
case "$1" in
|
||||||
|
--get) get_volume ;;
|
||||||
|
--inc) adjust_volume -i 5 ;;
|
||||||
|
--dec) adjust_volume -d 5 ;;
|
||||||
|
--toggle) toggle_mute ;;
|
||||||
|
*) echo "$(get_volume)%" ;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
${notify_cmd} "'pamixer' is not installed."
|
||||||
|
fi
|
132
misc/bin/weather
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
encode_to_url_format() {
|
||||||
|
echo "$1" | sed 's/ /%20/g'
|
||||||
|
}
|
||||||
|
|
||||||
|
check_if_empty() {
|
||||||
|
[[ -z "$1" ]] && echo "0" || echo "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
KEY="699a48531cdd445784916ed7a7ca80e6"
|
||||||
|
CITY="Virginia Beach"
|
||||||
|
CITYN=$(encode_to_url_format "$CITY")
|
||||||
|
UNITS="imperial" # Available "metric" "imperial"
|
||||||
|
WEATHER=$(curl -sf "api.openweathermap.org/data/2.5/weather?q=$CITYN&appid=$KEY&units=$UNITS")
|
||||||
|
|
||||||
|
WEATHER_DESC=$(echo "$WEATHER" | jq -r ".weather[0].main")
|
||||||
|
WEATHER_TEMP=$(echo "$WEATHER" | jq ".main.temp" | cut -d "." -f 1)
|
||||||
|
WEATHER_ICON_CODE=$(echo "$WEATHER" | jq -r ".weather[].icon" | head -1)
|
||||||
|
WEATHER_FEELS_LIKE=$(echo "$WEATHER" | jq ".main.feels_like" | cut -d "." -f 1)
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX=""
|
||||||
|
|
||||||
|
case $WEATHER_ICON_CODE in
|
||||||
|
"01d")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#ffd86b"
|
||||||
|
;;
|
||||||
|
"01n")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#fcdcf6"
|
||||||
|
;;
|
||||||
|
"02d")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#adadff"
|
||||||
|
;;
|
||||||
|
"02n")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#adadff"
|
||||||
|
;;
|
||||||
|
"03d")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#adadff"
|
||||||
|
;;
|
||||||
|
"03n")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#adadff"
|
||||||
|
;;
|
||||||
|
"04d")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#adadff"
|
||||||
|
;;
|
||||||
|
"04n")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#acb0d0"
|
||||||
|
;;
|
||||||
|
"09d")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#6b95ff"
|
||||||
|
;;
|
||||||
|
"09n")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#6b95ff"
|
||||||
|
;;
|
||||||
|
"10d")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#6b95ff"
|
||||||
|
;;
|
||||||
|
"10n")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#6b95ff"
|
||||||
|
;;
|
||||||
|
"11d")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#ffeb57"
|
||||||
|
;;
|
||||||
|
"11n")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#ffeb57"
|
||||||
|
;;
|
||||||
|
"13d")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#e3e6fc"
|
||||||
|
;;
|
||||||
|
"13n")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#e3e6fc"
|
||||||
|
;;
|
||||||
|
"40d")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#84afdb"
|
||||||
|
;;
|
||||||
|
"40n")
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#84afdb"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
WEATHER_ICON=""
|
||||||
|
WEATHER_HEX="#adadff"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
"current_temp")
|
||||||
|
check_if_empty "$WEATHER_TEMP"
|
||||||
|
;;
|
||||||
|
"current_temp_fahrenheit")
|
||||||
|
WEATHER_TEMP=$("$WEATHER_TEMP" 9 / 5 + 32)
|
||||||
|
check_if_empty "$WEATHER_TEMP"
|
||||||
|
;;
|
||||||
|
"feels_like")
|
||||||
|
check_if_empty "$WEATHER_FEELS_LIKE"
|
||||||
|
;;
|
||||||
|
"weather_desc")
|
||||||
|
[[ -z $WEATHER_DESC ]] && echo "Not Available." || echo "$WEATHER_DESC"
|
||||||
|
;;
|
||||||
|
"icon")
|
||||||
|
echo $WEATHER_ICON
|
||||||
|
;;
|
||||||
|
"hex")
|
||||||
|
echo $WEATHER_HEX
|
||||||
|
;;
|
||||||
|
"full")
|
||||||
|
echo "$WEATHER"
|
||||||
|
;;
|
||||||
|
"city")
|
||||||
|
echo "$CITY"
|
||||||
|
;;
|
||||||
|
"wmodule")
|
||||||
|
echo $WEATHER_ICON "$WEATHER_TEMP"°
|
||||||
|
;;
|
||||||
|
esac
|
BIN
misc/fonts/FontAwesome6-Free-Solid.otf
Normal file
BIN
misc/fonts/MaterialDesignIconsDesktop.ttf
Normal file
BIN
misc/fonts/MesloLGS_NF_Regular.ttf
Normal file
BIN
misc/fonts/clarity-city/ClarityCity-Bold.ttf
Normal file
BIN
misc/fonts/clarity-city/ClarityCity-ExtraBold.ttf
Normal file
BIN
misc/fonts/clarity-city/ClarityCity-Medium.ttf
Normal file
BIN
misc/fonts/clarity-city/ClarityCity-Regular.ttf
Normal file
BIN
misc/fonts/clarity-city/ClarityCity-RegularItalic.ttf
Normal file
BIN
misc/fonts/clarity-city/ClarityCity-SemiBold.ttf
Normal file
316
setup.sh
Normal file
@ -0,0 +1,316 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CRE=$(tput setaf 1)
|
||||||
|
CYE=$(tput setaf 3)
|
||||||
|
CGR=$(tput setaf 2)
|
||||||
|
CBL=$(tput setaf 4)
|
||||||
|
BLD=$(tput bold)
|
||||||
|
CNC=$(tput sgr0)
|
||||||
|
|
||||||
|
backup_folder=~/.ricebackup
|
||||||
|
date=$(date +%Y%m%d-%H%M%S)
|
||||||
|
|
||||||
|
logo () {
|
||||||
|
|
||||||
|
local text="${1:?}"
|
||||||
|
echo -en " ____________
|
||||||
|
< Arch Linux >
|
||||||
|
------------
|
||||||
|
\ ^__^
|
||||||
|
\ (oo)\_______
|
||||||
|
(__)\ )\/\*
|
||||||
|
||----w |
|
||||||
|
|| ||
|
||||||
|
edwark43 dotfiles\n\n"
|
||||||
|
printf ' %s [%s%s %s%s %s]%s\n\n' "${CRE}" "${CNC}" "${CYE}" "${text}" "${CNC}" "${CRE}" "${CNC}"
|
||||||
|
}
|
||||||
|
|
||||||
|
########## ---------- You must not run this as root ---------- ##########
|
||||||
|
|
||||||
|
if [ "$(id -u)" = 0 ]; then
|
||||||
|
echo "This script MUST NOT be run as root user."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
########## ---------- Welcome ---------- ##########
|
||||||
|
|
||||||
|
logo "Welcome!"
|
||||||
|
printf '%s%sThis script will check if you have the necessary dependencies, and if not, it will install them. Then, it will clone the RICE to your HOME directory.\nAfter that, it will create a local backup of your files, and then copy my dotfiles to your computer.\n\nMy dotfiles DO NOT modify any of your system configurations.\nYou will be prompted for your root password to install any missing dependencies and/or to switch to the zsh shell if it is not your default.\n\nThis script does not have the potential to break your system, it only copies files from my repository to your HOME directory.%s\n\n' "${BLD}" "${CRE}" "${CNC}"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
read -rp " Do you wish to continue? [y/N]: " yn
|
||||||
|
case $yn in
|
||||||
|
[Yy]* ) break;;
|
||||||
|
[Nn]* ) exit;;
|
||||||
|
* ) printf " Error: just write 'y' or 'n'\n\n";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
clear
|
||||||
|
|
||||||
|
########## ---------- Install packages ---------- ##########
|
||||||
|
|
||||||
|
logo "Installing needed packages.."
|
||||||
|
|
||||||
|
dependencies=(alacritty base-devel brightnessctl bspwm dunst feh git jgmenu \
|
||||||
|
jq libnotify libwebp lsd maim mpc mpd ncmpcpp neofetch neovim \
|
||||||
|
pacman-contrib pamixer papirus-icon-theme physlock picom playerctl \
|
||||||
|
polkit-gnome polybar ranger rofi rustup sxhkd \
|
||||||
|
ttf-inconsolata ttf-jetbrains-mono ttf-jetbrains-mono-nerd ttf-joypixels \
|
||||||
|
ttf-terminus-nerd ueberzug webp-pixbuf-loader xclip xdg-user-dirs xdo xdotool \
|
||||||
|
xorg-xkill xorg-xprop xorg-xrandr xorg-xsetroot xorg-xwininfo \
|
||||||
|
zsh zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting)
|
||||||
|
|
||||||
|
is_installed() {
|
||||||
|
pacman -Qi "$1" &> /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
printf "%s%sChecking for required packages...%s\n" "${BLD}" "${CBL}" "${CNC}"
|
||||||
|
for package in "${dependencies[@]}"
|
||||||
|
do
|
||||||
|
if ! is_installed "$package"; then
|
||||||
|
sudo pacman -S "$package" --noconfirm
|
||||||
|
printf "\n"
|
||||||
|
else
|
||||||
|
printf '%s%s is already installed on your system!%s\n' "${CGR}" "$package" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
sleep 3
|
||||||
|
clear
|
||||||
|
|
||||||
|
########## ---------- Preparing Folders ---------- ##########
|
||||||
|
|
||||||
|
# Checks if the file user-dirs.dirs does not exist in ~/.config
|
||||||
|
if [ ! -e "$HOME/.config/user-dirs.dirs" ]; then
|
||||||
|
xdg-user-dirs-update
|
||||||
|
echo "Creating xdg-user-dirs"
|
||||||
|
fi
|
||||||
|
sleep 2
|
||||||
|
clear
|
||||||
|
|
||||||
|
########## ---------- Cloning the Rice! ---------- ##########
|
||||||
|
|
||||||
|
logo "Downloading dotfiles"
|
||||||
|
|
||||||
|
repo_url="https://github.com/edwark43/dotfiles"
|
||||||
|
repo_dir="$HOME/dotfiles"
|
||||||
|
|
||||||
|
# Checks if the repository folder exists, and deletes it if it does.
|
||||||
|
if [ -d "$repo_dir" ]; then
|
||||||
|
printf "Removing existing dotfiles repository\n"
|
||||||
|
rm -rf "$repo_dir"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Cloning the repository
|
||||||
|
printf "Cloning dotfiles from %s\n" "$repo_url"
|
||||||
|
git clone --depth=1 "$repo_url" "$repo_dir"
|
||||||
|
|
||||||
|
sleep 2
|
||||||
|
clear
|
||||||
|
|
||||||
|
########## ---------- Backup files ---------- ##########
|
||||||
|
|
||||||
|
logo "Backup files"
|
||||||
|
printf "Backup files will be stored in %s%s%s/.ricebackup%s \n\n" "${BLD}" "${CRE}" "$HOME" "${CNC}"
|
||||||
|
sleep 10
|
||||||
|
|
||||||
|
if [ ! -d "$backup_folder" ]; then
|
||||||
|
mkdir -p "$backup_folder"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for folder in alacritty bspwm dunst jgmenu mpd ncmpcpp nvim picom polybar ranger rofi sxhkd zsh; do
|
||||||
|
if [ -d "$HOME/.config/$folder" ]; then
|
||||||
|
mv "$HOME/.config/$folder" "$backup_folder/${folder}_$date"
|
||||||
|
echo "$folder folder backed up successfully at $backup_folder/${folder}_$date"
|
||||||
|
else
|
||||||
|
echo "The folder $folder does not exist in $HOME/.config/"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
[ -f ~/.zshrc ] && mv ~/.zshrc ~/.ricebackup/.zshrc-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
|
||||||
|
|
||||||
|
printf "%s%sDone!!%s\n\n" "${BLD}" "${CGR}" "${CNC}"
|
||||||
|
sleep 5
|
||||||
|
clear
|
||||||
|
|
||||||
|
########## ---------- Copy the Rice! ---------- ##########
|
||||||
|
|
||||||
|
logo "Installing dotfiles.."
|
||||||
|
printf "Copying files to respective directories..\n"
|
||||||
|
|
||||||
|
[ ! -d ~/.config ] && mkdir -p ~/.config
|
||||||
|
[ ! -d ~/.local/bin ] && mkdir -p ~/.local/bin
|
||||||
|
[ ! -d ~/.local/share/fonts ] && mkdir -p ~/.local/share/fonts
|
||||||
|
[ ! -d ~/.local/share/asciiart ] && mkdir -p ~/.local/share/asciiart
|
||||||
|
[ ! -d ~/.local/share/assets ] && mkdir -p ~/.local/share/assets
|
||||||
|
|
||||||
|
for files in ~/dotfiles/config/*; do
|
||||||
|
cp -R "${files}" ~/.config/
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
printf "%s%s%s folder copied successfully!%s\n" "${BLD}" "${CGR}" "${files}" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
printf "%s%s%s failed to been copied, you must copy it manually%s\n" "${BLD}" "${CRE}" "${files}" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for files in ~/dotfiles/misc/bin/*; do
|
||||||
|
cp -R "${files}" ~/.local/bin/
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
printf "%s%s%s file copied successfully!%s\n" "${BLD}" "${CGR}" "${files}" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
printf "%s%s%s failed to been copied, you must copy them manually%s\n" "${BLD}" "${CRE}" "${files}" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for files in ~/dotfiles/misc/fonts/*; do
|
||||||
|
cp -R "${files}" ~/.local/share/fonts/
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
printf "%s%s%s copied succesfully!%s\n" "${BLD}" "${CGR}" "${files}" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
printf "%s%s%s failed to been copied, you must copy it manually%s\n" "${BLD}" "${CRE}" "${files}" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for files in ~/dotfiles/misc/asciiart/*; do
|
||||||
|
cp -R "${files}" ~/.local/share/asciiart/
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
printf "%s%s%s file copied successfully!%s\n" "${BLD}" "${CGR}" "${files}" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
printf "%s%s%s failed to been copied, you must copy it manually%s\n" "${BLD}" "${CRE}" "${files}" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for files in ~/dotfiles/misc/assets/*; do
|
||||||
|
cp -R "${files}" ~/.local/share/assets/
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
printf "%s%s%s file copied successfully!%s\n" "${BLD}" "${CGR}" "${files}" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
printf "%s%s%s failed to been copied, you must copy it manually%s\n" "${BLD}" "${CRE}" "${files}" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for files in ~/dotfiles/home/pics/*; do
|
||||||
|
cp -R "${files}" ~/pics/
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
printf "%s%s%s file copied successfully!%s\n" "${BLD}" "${CGR}" "${files}" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
else
|
||||||
|
printf "%s%s%s failed to been copied, you must copy it manually%s\n" "${BLD}" "${CRE}" "${files}" "${CNC}"
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
cp -f "$HOME"/dotfiles/home/.zshrc "$HOME"
|
||||||
|
fc-cache -rv >/dev/null 2>&1
|
||||||
|
printf "%s%sFile copied succesfully!!%s\n" "${BLD}" "${CGR}" "${CNC}"
|
||||||
|
|
||||||
|
sleep 3
|
||||||
|
clear
|
||||||
|
|
||||||
|
########## ---------- Installing Yay & other aur packages ---------- ##########
|
||||||
|
|
||||||
|
logo "Installing Yay, Tdrop, xqp, and Brave."
|
||||||
|
sleep 2
|
||||||
|
clear
|
||||||
|
|
||||||
|
# Installing yay
|
||||||
|
logo "Installing Yay"
|
||||||
|
if command -v yay >/dev/null 2>&1; then
|
||||||
|
printf "%s%sYay is already installed%s\n" "${BLD}" "${CGR}" "${CNC}"
|
||||||
|
else
|
||||||
|
printf "%s%sInstalling yay%s\n" "${BLD}" "${CBL}" "${CNC}"
|
||||||
|
{
|
||||||
|
cd "$HOME" || exit
|
||||||
|
git clone https://aur.archlinux.org/yay.git
|
||||||
|
cd yay || exit
|
||||||
|
makepkg -si --noconfirm
|
||||||
|
} || {
|
||||||
|
printf "\n%s%sFailed to install Yay.%s\n" "${BLD}" "${CRE}" "${CNC}"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
clear
|
||||||
|
|
||||||
|
# Intalling tdrop for scratchpads
|
||||||
|
logo "Installing Tdrop"
|
||||||
|
if command -v tdrop >/dev/null 2>&1; then
|
||||||
|
printf "\n%s%sTdrop is already installed%s\n" "${BLD}" "${CGR}" "${CNC}"
|
||||||
|
else
|
||||||
|
printf "\n%s%sInstalling tdrop%s\n" "${BLD}" "${CBL}" "${CNC}"
|
||||||
|
yay -S tdrop-git --noconfirm
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
clear
|
||||||
|
|
||||||
|
# Intalling xqp
|
||||||
|
logo "Installing xqp"
|
||||||
|
if command -v xqp >/dev/null 2>&1; then
|
||||||
|
printf "\n%s%sxqp is already installed%s\n" "${BLD}" "${CGR}" "${CNC}"
|
||||||
|
else
|
||||||
|
printf "\n%s%sInstalling xqp%s\n" "${BLD}" "${CBL}" "${CNC}"
|
||||||
|
yay -S xqp --noconfirm
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
clear
|
||||||
|
|
||||||
|
# Installing Brave
|
||||||
|
logo "Installing Brave"
|
||||||
|
if command -v brave >/dev/null 2>&1; then
|
||||||
|
printf "\n%s%sBrave is already installed%s\n" "${BLD}" "${CGR}" "${CNC}"
|
||||||
|
else
|
||||||
|
printf "\n%s%sInstalling Brave%s\n" "${BLD}" "${CBL}" "${CNC}"
|
||||||
|
yay -S brave-bin --noconfirm
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
clear
|
||||||
|
|
||||||
|
########## --------- Enabling MPD service --------- ##########
|
||||||
|
|
||||||
|
logo "Enabling mpd service"
|
||||||
|
|
||||||
|
# Checking if the mpd service is enabled globally
|
||||||
|
if systemctl is-enabled --quiet mpd.service; then
|
||||||
|
printf "\n%s%sDisabling and stopping the global mpd service%s\n" "${BLD}" "${CBL}" "${CNC}"
|
||||||
|
sudo systemctl stop mpd.service
|
||||||
|
sudo systemctl disable mpd.service
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "\n%s%sEnabling and starting the user-level mpd service%s\n" "${BLD}" "${CYE}" "${CNC}"
|
||||||
|
systemctl --user enable --now mpd.service
|
||||||
|
|
||||||
|
printf "%s%sDone!!%s\n\n" "${BLD}" "${CGR}" "${CNC}"
|
||||||
|
sleep 2
|
||||||
|
clear
|
||||||
|
|
||||||
|
########## --------- Updating user-dirs.dirs --------- ##########
|
||||||
|
|
||||||
|
xdg-user-dirs-update
|
||||||
|
|
||||||
|
########## --------- Changing shell to zsh --------- ##########
|
||||||
|
|
||||||
|
logo "Changing default shell to zsh"
|
||||||
|
|
||||||
|
if [[ $SHELL != "/usr/bin/zsh" ]]; then
|
||||||
|
printf "\n%s%sChanging your shell to zsh. Your root password is needed.%s\n\n" "${BLD}" "${CYE}" "${CNC}"
|
||||||
|
# Changing the shell to zsh
|
||||||
|
chsh -s /usr/bin/zsh
|
||||||
|
printf "%s%sShell changed to zsh. Please reboot.%s\n\n" "${BLD}" "${CGR}" "${CNC}"
|
||||||
|
else
|
||||||
|
printf "%s%sYour shell is already zsh\nGood bye! installation finished, now reboot%s\n" "${BLD}" "${CGR}" "${CNC}"
|
||||||
|
fi
|
||||||
|
zsh
|