From d57b63183119f74f3d83c84582462c6625b303c0 Mon Sep 17 00:00:00 2001 From: Clay Manuel Gomera Arias Date: Wed, 2 Mar 2022 00:51:50 -0400 Subject: [PATCH] Absolute update made right here --- .bashrc | 50 +- .config/alacritty/alacritty.yml | 5 +- .../awesome/awesome-wm-widgets/.luacheckrc | 24 - .../battery-widget/battery.lua | 200 ----- .../battery-widget/spaceman.jpg | Bin 16738 -> 0 bytes .../brightness-widget/brightness.lua | 186 ----- .../brightness-widget/brightness.svg | 153 ---- .../logout-menu-widget/icons/lock.svg | 1 - .../logout-menu-widget/icons/log-out.svg | 1 - .../logout-menu-widget/icons/moon.svg | 1 - .../logout-menu-widget/icons/power.svg | 1 - .../logout-menu-widget/icons/power_w.svg | 1 - .../logout-menu-widget/icons/refresh-cw.svg | 1 - .../logout-menu-widget/logout-menu.lua | 136 ---- .../icons/audio-volume-high-symbolic.svg | 88 --- .../icons/audio-volume-low-symbolic.svg | 88 --- .../icons/audio-volume-medium-symbolic.svg | 88 --- .../icons/audio-volume-muted-symbolic.svg | 88 --- .../volume-widget/utils.lua | 105 --- .../volume-widget/volume-2.svg | 1 - .../volume-widget/volume.lua | 228 ------ .../volume-widget/widgets/arc-widget.lua | 46 -- .../widgets/horizontal-bar-widget.lua | 58 -- .../widgets/icon-and-text-widget.lua | 59 -- .../volume-widget/widgets/icon-widget.lua | 46 -- .../widgets/vertical-bar-widget.lua | 64 -- .config/awesome/rc.lua | 36 +- .config/awesome/themes/gruvbox-dark/theme.lua | 109 ++- .config/doom/config.el | 12 + .config/doom/config.org | 41 ++ .config/doom/packages.el | 8 + .config/fish/config.fish | 229 ------ .config/scripts/deploy.sh | 55 ++ .config/scripts/dmenu-wifi.sh | 5 +- .config/starship.toml | 2 - .moc/config | 690 ++++++++++++++++++ .moc/themes/black_theme | 34 + .moc/themes/darkdot_theme | 34 + .moc/themes/example_theme | 125 ++++ .moc/themes/green_theme | 35 + .moc/themes/moca_theme | 36 + .moc/themes/nightly_theme | 34 + .moc/themes/red_theme | 36 + .moc/themes/transparent-background | 34 + .moc/themes/yellow_red_theme | 35 + .newsboat/urls | 11 + .zshrc | 246 +++++++ 47 files changed, 1607 insertions(+), 1959 deletions(-) delete mode 100644 .config/awesome/awesome-wm-widgets/.luacheckrc delete mode 100644 .config/awesome/awesome-wm-widgets/battery-widget/battery.lua delete mode 100644 .config/awesome/awesome-wm-widgets/battery-widget/spaceman.jpg delete mode 100644 .config/awesome/awesome-wm-widgets/brightness-widget/brightness.lua delete mode 100644 .config/awesome/awesome-wm-widgets/brightness-widget/brightness.svg delete mode 100644 .config/awesome/awesome-wm-widgets/logout-menu-widget/icons/lock.svg delete mode 100644 .config/awesome/awesome-wm-widgets/logout-menu-widget/icons/log-out.svg delete mode 100644 .config/awesome/awesome-wm-widgets/logout-menu-widget/icons/moon.svg delete mode 100644 .config/awesome/awesome-wm-widgets/logout-menu-widget/icons/power.svg delete mode 100644 .config/awesome/awesome-wm-widgets/logout-menu-widget/icons/power_w.svg delete mode 100644 .config/awesome/awesome-wm-widgets/logout-menu-widget/icons/refresh-cw.svg delete mode 100644 .config/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.lua delete mode 100644 .config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-high-symbolic.svg delete mode 100644 .config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-low-symbolic.svg delete mode 100644 .config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-medium-symbolic.svg delete mode 100644 .config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-muted-symbolic.svg delete mode 100644 .config/awesome/awesome-wm-widgets/volume-widget/utils.lua delete mode 100644 .config/awesome/awesome-wm-widgets/volume-widget/volume-2.svg delete mode 100644 .config/awesome/awesome-wm-widgets/volume-widget/volume.lua delete mode 100644 .config/awesome/awesome-wm-widgets/volume-widget/widgets/arc-widget.lua delete mode 100644 .config/awesome/awesome-wm-widgets/volume-widget/widgets/horizontal-bar-widget.lua delete mode 100644 .config/awesome/awesome-wm-widgets/volume-widget/widgets/icon-and-text-widget.lua delete mode 100644 .config/awesome/awesome-wm-widgets/volume-widget/widgets/icon-widget.lua delete mode 100644 .config/awesome/awesome-wm-widgets/volume-widget/widgets/vertical-bar-widget.lua delete mode 100644 .config/fish/config.fish create mode 100755 .config/scripts/deploy.sh create mode 100644 .moc/config create mode 100644 .moc/themes/black_theme create mode 100644 .moc/themes/darkdot_theme create mode 100644 .moc/themes/example_theme create mode 100644 .moc/themes/green_theme create mode 100644 .moc/themes/moca_theme create mode 100644 .moc/themes/nightly_theme create mode 100644 .moc/themes/red_theme create mode 100644 .moc/themes/transparent-background create mode 100644 .moc/themes/yellow_red_theme create mode 100644 .newsboat/urls create mode 100644 .zshrc diff --git a/.bashrc b/.bashrc index c83f6c591..40c83654f 100644 --- a/.bashrc +++ b/.bashrc @@ -86,6 +86,8 @@ ex () fi } + +### ALIASES # navigation up () { local d="" @@ -105,9 +107,6 @@ up () { echo "Couldn't go up $limit dirs."; fi } - -### ALIASES -# navigation alias ..='cd ..' alias .2='cd ../..' alias .3='cd ../../..' @@ -119,13 +118,13 @@ alias cat='bat' # editors alias vim='nvim' -alias em="/usr/bin/emacs -nw" -alias emacs="emacsclient -c -a 'emacs'" -alias doomsync="~/.emacs.d/bin/doom sync" -alias doomdoctor="~/.emacs.d/bin/doom doctor" -alias doomupgrade="~/.emacs.d/bin/doom upgrade" -alias doompurge="~/.emacs.d/bin/doom purge" -alias doominstall="~/.emacs.d/bin/doom install" +alias em='/usr/bin/emacs -nw' +alias emacs='emacsclient -c -a emacs' +alias doomsync='~/.emacs.d/bin/doom sync' +alias doomdoctor='~/.emacs.d/bin/doom doctor' +alias doomupgrade='~/.emacs.d/bin/doom upgrade' +alias doompurge='~/.emacs.d/bin/doom purge' +alias doominstall='~/.emacs.d/bin/doom install' # Changing "ls" to "exa" alias ls='exa -al --color=always --group-directories-first' # my preferred listing @@ -153,7 +152,22 @@ alias mv='mv -i' alias cp='cp -i' # git -alias git-clone='git clone' +alias addup='git add -u' +alias addall='git add .' +alias branch='git branch' +alias checkout='git checkout' +alias clone='git clone' +alias commit='git commit -m' +alias fetch='git fetch' +alias pull='git pull origin' +alias push='git push origin' +alias stat='git status' # 'status' is protected name so using 'stat' instead +alias tag='git tag' +alias newtag='git tag -a' + +# adding flags +alias df='df -h' # human-readable sizes +alias free='free -m' # show sizes in MB # ani-cli alias ani='ani-cli' @@ -174,7 +188,7 @@ alias mx='pulsemixer' alias amx='alsamixer' # music player -alias mk='musikcube' +alias mk='mocp' # power management alias po='loginctl poweroff' @@ -182,13 +196,20 @@ alias sp='loginctl suspend' alias rb='loginctl reboot' # file manager -alias fm='/home/drk/.config/vifm/scripts/./vifmrun' +alias fm='./.config/vifm/scripts/vifmrun' +alias vifm='./.config/vifm/scripts/vifmrun' # system monitor alias tp='btop' alias top='btop' alias htop='btop' +# ps +alias psa="ps auxf" +alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e" +alias psmem='ps auxf | sort -nr -k 4' +alias pscpu='ps auxf | sort -nr -k 3' + # get error messages from journalctl alias jctl="journalctl -p 3 -xb" @@ -215,5 +236,8 @@ alias blt='bluetoothctl' # the terminal rickroll alias rr='curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash' +# Deploy script +alias deploynow='sh $HOME/.config/scripts/deploy.sh' + ### SETTING THE STARSHIP PROMPT ### eval "$(starship init bash)" diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index bb0924574..3f05fbd23 100755 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -616,8 +616,7 @@ colors: *gruvbox-dark # Window opacity as a floating point number from `0.0` to `1.0`. # The value `0.0` is completely transparent and `1.0` is opaque. window: - opacity: 0.95 - + opacity: 0.93 #selection: #semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" @@ -653,7 +652,7 @@ window: # - (Linux/BSD) user login shell # - (Windows) powershell shell: - program: /bin/fish + program: /bin/zsh # args: # - --login diff --git a/.config/awesome/awesome-wm-widgets/.luacheckrc b/.config/awesome/awesome-wm-widgets/.luacheckrc deleted file mode 100644 index e4f47fa64..000000000 --- a/.config/awesome/awesome-wm-widgets/.luacheckrc +++ /dev/null @@ -1,24 +0,0 @@ -self = false - -globals = { - "screen", - "mouse", - "root", - "client" -} - -read_globals = { - "awesome", - "button", - "dbus", - "drawable", - "drawin", - "key", - "keygrabber", - "mousegrabber", - "selection", - "tag", - "window", - "table.unpack", - "math.atan2", -} \ No newline at end of file diff --git a/.config/awesome/awesome-wm-widgets/battery-widget/battery.lua b/.config/awesome/awesome-wm-widgets/battery-widget/battery.lua deleted file mode 100644 index fc8c56f42..000000000 --- a/.config/awesome/awesome-wm-widgets/battery-widget/battery.lua +++ /dev/null @@ -1,200 +0,0 @@ -------------------------------------------------- --- Battery Widget for Awesome Window Manager --- Shows the battery status using the ACPI tool --- More details could be found here: --- https://github.com/streetturtle/awesome-wm-widgets/tree/master/battery-widget - --- @author Pavel Makhov --- @copyright 2017 Pavel Makhov -------------------------------------------------- - -local awful = require("awful") -local naughty = require("naughty") -local watch = require("awful.widget.watch") -local wibox = require("wibox") -local gfs = require("gears.filesystem") -local dpi = require('beautiful').xresources.apply_dpi - --- acpi sample outputs --- Battery 0: Discharging, 75%, 01:51:38 remaining --- Battery 0: Charging, 53%, 00:57:43 until charged - -local HOME = os.getenv("HOME") -local WIDGET_DIR = HOME .. '/.config/awesome/awesome-wm-widgets/battery-widget' - -local battery_widget = {} -local function worker(user_args) - local args = user_args or {} - - local font = args.font or 'Play 8' - local path_to_icons = args.path_to_icons or "/usr/share/icons/Arc/status/symbolic/" - local show_current_level = args.show_current_level or false - local margin_left = args.margin_left or 0 - local margin_right = args.margin_right or 0 - - local display_notification = args.display_notification or false - local display_notification_onClick = args.display_notification_onClick or true - local position = args.notification_position or "top_right" - local timeout = args.timeout or 10 - - local warning_msg_title = args.warning_msg_title or 'Huston, we have a problem' - local warning_msg_text = args.warning_msg_text or 'Battery is dying' - local warning_msg_position = args.warning_msg_position or 'bottom_right' - local warning_msg_icon = args.warning_msg_icon or WIDGET_DIR .. '/spaceman.jpg' - local enable_battery_warning = args.enable_battery_warning - if enable_battery_warning == nil then - enable_battery_warning = true - end - - if not gfs.dir_readable(path_to_icons) then - naughty.notify{ - title = "Battery Widget", - text = "Folder with icons doesn't exist: " .. path_to_icons, - preset = naughty.config.presets.critical - } - end - - local icon_widget = wibox.widget { - { - id = "icon", - widget = wibox.widget.imagebox, - resize = false - }, - valign = 'center', - layout = wibox.container.place, - } - local level_widget = wibox.widget { - font = font, - widget = wibox.widget.textbox - } - - battery_widget = wibox.widget { - icon_widget, - level_widget, - layout = wibox.layout.fixed.horizontal, - } - -- Popup with battery info - -- One way of creating a pop-up notification - naughty.notify - local notification - local function show_battery_status(batteryType) - awful.spawn.easy_async([[bash -c 'acpi']], - function(stdout, _, _, _) - naughty.destroy(notification) - notification = naughty.notify{ - text = stdout, - title = "Battery status", - icon = path_to_icons .. batteryType .. ".svg", - icon_size = dpi(16), - position = position, - timeout = 5, hover_timeout = 0.5, - width = 200, - screen = mouse.screen - } - end - ) - end - - -- Alternative to naughty.notify - tooltip. You can compare both and choose the preferred one - --battery_popup = awful.tooltip({objects = {battery_widget}}) - - -- To use colors from beautiful theme put - -- following lines in rc.lua before require("battery"): - -- beautiful.tooltip_fg = beautiful.fg_normal - -- beautiful.tooltip_bg = beautiful.bg_normal - - local function show_battery_warning() - naughty.notify { - icon = warning_msg_icon, - icon_size = 100, - text = warning_msg_text, - title = warning_msg_title, - timeout = 25, -- show the warning for a longer time - hover_timeout = 0.5, - position = warning_msg_position, - bg = "#F06060", - fg = "#EEE9EF", - width = 300, - screen = mouse.screen - } - end - local last_battery_check = os.time() - local batteryType = "battery-good-symbolic" - - watch("acpi -i", timeout, - function(widget, stdout) - local battery_info = {} - local capacities = {} - for s in stdout:gmatch("[^\r\n]+") do - local status, charge_str, _ = string.match(s, '.+: (%a+), (%d?%d?%d)%%,?(.*)') - if status ~= nil then - table.insert(battery_info, {status = status, charge = tonumber(charge_str)}) - else - local cap_str = string.match(s, '.+:.+last full capacity (%d+)') - table.insert(capacities, tonumber(cap_str)) - end - end - - local capacity = 0 - for _, cap in ipairs(capacities) do - capacity = capacity + cap - end - - local charge = 0 - local status - for i, batt in ipairs(battery_info) do - if capacities[i] ~= nil then - if batt.charge >= charge then - status = batt.status -- use most charged battery status - -- this is arbitrary, and maybe another metric should be used - end - - charge = charge + batt.charge * capacities[i] - end - end - charge = charge / capacity - - if show_current_level then - level_widget.text = string.format('%d%%', charge) - end - - if (charge >= 0 and charge < 15) then - batteryType = "battery-empty%s-symbolic" - if enable_battery_warning and status ~= 'Charging' and os.difftime(os.time(), last_battery_check) > 300 then - -- if 5 minutes have elapsed since the last warning - last_battery_check = os.time() - - show_battery_warning() - end - elseif (charge >= 15 and charge < 40) then batteryType = "battery-caution%s-symbolic" - elseif (charge >= 40 and charge < 60) then batteryType = "battery-low%s-symbolic" - elseif (charge >= 60 and charge < 80) then batteryType = "battery-good%s-symbolic" - elseif (charge >= 80 and charge <= 100) then batteryType = "battery-full%s-symbolic" - end - - if status == 'Charging' then - batteryType = string.format(batteryType, '-charging') - else - batteryType = string.format(batteryType, '') - end - - widget.icon:set_image(path_to_icons .. batteryType .. ".svg") - - -- Update popup text - -- battery_popup.text = string.gsub(stdout, "\n$", "") - end, - icon_widget) - - if display_notification then - battery_widget:connect_signal("mouse::enter", function() show_battery_status(batteryType) end) - battery_widget:connect_signal("mouse::leave", function() naughty.destroy(notification) end) - elseif display_notification_onClick then - battery_widget:connect_signal("button::press", function(_,_,_,button) - if (button == 3) then show_battery_status(batteryType) end - end) - battery_widget:connect_signal("mouse::leave", function() naughty.destroy(notification) end) - end - - return wibox.container.margin(battery_widget, margin_left, margin_right) -end - -return setmetatable(battery_widget, { __call = function(_, ...) return worker(...) end }) diff --git a/.config/awesome/awesome-wm-widgets/battery-widget/spaceman.jpg b/.config/awesome/awesome-wm-widgets/battery-widget/spaceman.jpg de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`PI@QVjBxQ0FNNswIg zoZ3ZXfndOF3qYE3m{3r(3{CvplKC>%HGSzH6Q+4U4Tt6&Erf0XS83mKm%;S#-M`VO zhpSq~>jTp4JmfHWEv z!PiPy;91r!wL;}0Vb1`kSR(NK^+NN^^jx&#AuL3bo)R-onkbPvFchA)Is~om;<#g- z`d=_AT%FmcWItJS@W48X99C8hq#n5dszAj7wFz^#HQU|PbMBM-o5B88fl+RGqWDX* z(;$}zh15g(4uVxo*t%eL*@p7QTk-8NX=ASe!7=g2tQxHMJej_~-RIs;dT6DXbLhHQ zv!_}ez0JMpW!)6<+3kLSWF|%w1z^ZE3FgzK-RN_>0qo6356sl772A~@v@b}&#MV@u zXr7ri1cm2nyblaYi463>f`H=)4^>q2q1;e!fV*YrLJ^&gM_=H{(J{Oa+1|~>`vSm} z#Q23lenZ$wpaPQ-(qsETP8Z%){Wi6rOqbbag_~mPoW~cza=`-3vHyqr0L7`F4x| z=1suVd}8dBD#2^NX<~5l&mDF|Gej%#-*HVmh}lUv-_{7e2J;US9A$%JV$w$~K2s8p Jcoq0s`# - inc_brightness_cmd = 'light -A ' .. step - dec_brightness_cmd = 'light -U ' .. step - elseif program == 'xbacklight' then - get_brightness_cmd = 'xbacklight -get' - set_brightness_cmd = 'xbacklight -set %d' -- - inc_brightness_cmd = 'xbacklight -inc ' .. step - dec_brightness_cmd = 'xbacklight -dec ' .. step - elseif program == 'brightnessctl' then - get_brightness_cmd = 'bash -c "brightnessctl -m | cut -d, -f4 | tr -d %"' - set_brightness_cmd = 'brightnessctl set %d%%' -- - inc_brightness_cmd = 'brightnessctl set +' .. step .. '%' - dec_brightness_cmd = 'brightnessctl set ' .. step .. '-%' - else - show_warning(program .. " command is not supported by the widget") - return - end - - if type == 'icon_and_text' then - brightness_widget.widget = wibox.widget { - { - { - image = path_to_icon, - resize = false, - widget = wibox.widget.imagebox, - }, - valign = 'center', - layout = wibox.container.place - }, - { - id = 'txt', - font = font, - widget = wibox.widget.textbox - }, - spacing = 2, - layout = wibox.layout.fixed.horizontal, - set_value = function(self, level) - self:get_children_by_id('txt')[1]:set_text(level .. '') - end - } - elseif type == 'arc' then - brightness_widget.widget = wibox.widget { - { - { - image = path_to_icon, - resize = true, - widget = wibox.widget.imagebox, - }, - valign = 'center', - layout = wibox.container.place - }, - max_value = 100, - thickness = 2, - start_angle = 4.71238898, -- 2pi*3/4 - forced_height = 18, - forced_width = 18, - paddings = 2, - widget = wibox.container.arcchart, - set_value = function(self, level) - self:set_value(level) - end - } - else - show_warning(type .. " type is not supported by the widget") - return - - end - - local update_widget = function(widget, stdout, _, _, _) - local brightness_level = tonumber(string.format("%.0f", stdout)) - current_level = brightness_level - widget:set_value(brightness_level) - end - - function brightness_widget:set(value) - current_level = value - spawn.easy_async(string.format(set_brightness_cmd, value), function() - spawn.easy_async(get_brightness_cmd, function(out) - update_widget(brightness_widget.widget, out) - end) - end) - end - local old_level = 0 - function brightness_widget:toggle() - if old_level < 0.1 then - -- avoid toggling between '0' and 'almost 0' - old_level = 1 - end - if current_level < 0.1 then - -- restore previous level - current_level = old_level - else - -- save current brightness for later - old_level = current_level - current_level = 0 - end - brightness_widget:set(current_level) - end - function brightness_widget:inc() - spawn.easy_async(inc_brightness_cmd, function() - spawn.easy_async(get_brightness_cmd, function(out) - update_widget(brightness_widget.widget, out) - end) - end) - end - function brightness_widget:dec() - spawn.easy_async(dec_brightness_cmd, function() - spawn.easy_async(get_brightness_cmd, function(out) - update_widget(brightness_widget.widget, out) - end) - end) - end - - brightness_widget.widget:buttons( - awful.util.table.join( - awful.button({}, 1, function() brightness_widget:set(base) end), - awful.button({}, 3, function() brightness_widget:toggle() end), - awful.button({}, 4, function() brightness_widget:inc() end), - awful.button({}, 5, function() brightness_widget:dec() end) - ) - ) - - watch(get_brightness_cmd, timeout, update_widget, brightness_widget.widget) - - if tooltip then - awful.tooltip { - objects = { brightness_widget.widget }, - timer_function = function() - return current_level .. " %" - end, - } - end - - return brightness_widget.widget -end - -return setmetatable(brightness_widget, { __call = function(_, ...) - return worker(...) -end }) diff --git a/.config/awesome/awesome-wm-widgets/brightness-widget/brightness.svg b/.config/awesome/awesome-wm-widgets/brightness-widget/brightness.svg deleted file mode 100644 index d33437203..000000000 --- a/.config/awesome/awesome-wm-widgets/brightness-widget/brightness.svg +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - diff --git a/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/lock.svg b/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/lock.svg deleted file mode 100644 index 3cfa528a2..000000000 --- a/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/lock.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/log-out.svg b/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/log-out.svg deleted file mode 100644 index 77afebb47..000000000 --- a/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/log-out.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/moon.svg b/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/moon.svg deleted file mode 100644 index 60e6ce8da..000000000 --- a/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/moon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/power.svg b/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/power.svg deleted file mode 100644 index 68b1be8d6..000000000 --- a/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/power.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/power_w.svg b/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/power_w.svg deleted file mode 100644 index 1f9c4e3b4..000000000 --- a/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/power_w.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/refresh-cw.svg b/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/refresh-cw.svg deleted file mode 100644 index 39f52a559..000000000 --- a/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/refresh-cw.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/.config/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.lua b/.config/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.lua deleted file mode 100644 index b4c59da0b..000000000 --- a/.config/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.lua +++ /dev/null @@ -1,136 +0,0 @@ -------------------------------------------------- --- Logout Menu Widget for Awesome Window Manager --- More details could be found here: --- https://github.com/streetturtle/awesome-wm-widgets/tree/master/logout-menu-widget - --- @author Pavel Makhov --- @copyright 2020 Pavel Makhov -------------------------------------------------- - -local awful = require("awful") -local wibox = require("wibox") -local gears = require("gears") -local beautiful = require("beautiful") - -local HOME = os.getenv('HOME') -local ICON_DIR = HOME .. '/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/' - -local logout_menu_widget = wibox.widget { - { - { - image = ICON_DIR .. 'power_w.svg', - resize = true, - widget = wibox.widget.imagebox, - }, - margins = 4, - layout = wibox.container.margin - }, - shape = function(cr, width, height) - gears.shape.rounded_rect(cr, width, height, 4) - end, - widget = wibox.container.background, -} - -local popup = awful.popup { - ontop = true, - visible = false, - shape = function(cr, width, height) - gears.shape.rounded_rect(cr, width, height, 4) - end, - border_width = 1, - border_color = beautiful.bg_focus, - maximum_width = 400, - offset = { y = 5 }, - widget = {} -} - -local function worker(user_args) - local rows = { layout = wibox.layout.fixed.vertical } - - local args = user_args or {} - - local font = args.font or beautiful.font - - local onlogout = args.onlogout or function () awesome.quit() end - local onlock = args.onlock or function() awful.spawn.with_shell("betterlockscreen -l") end - local onreboot = args.onreboot or function() awful.spawn.with_shell("loginctl reboot") end - local onsuspend = args.onsuspend or function() awful.spawn.with_shell("loginctl suspend && betterlockscreen -l") end - local onpoweroff = args.onpoweroff or function() awful.spawn.with_shell("loginctl poweroff") end - - local menu_items = { - { name = 'Log out', icon_name = 'log-out.svg', command = onlogout }, - { name = 'Lock', icon_name = 'lock.svg', command = onlock }, - { name = 'Reboot', icon_name = 'refresh-cw.svg', command = onreboot }, - { name = 'Suspend', icon_name = 'moon.svg', command = onsuspend }, - { name = 'Power off', icon_name = 'power.svg', command = onpoweroff }, - } - - for _, item in ipairs(menu_items) do - - local row = wibox.widget { - { - { - { - image = ICON_DIR .. item.icon_name, - resize = false, - widget = wibox.widget.imagebox - }, - { - text = item.name, - font = font, - widget = wibox.widget.textbox - }, - spacing = 12, - layout = wibox.layout.fixed.horizontal - }, - margins = 8, - layout = wibox.container.margin - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - } - - row:connect_signal("mouse::enter", function(c) c:set_bg(beautiful.bg_focus) end) - row:connect_signal("mouse::leave", function(c) c:set_bg(beautiful.bg_normal) end) - - local old_cursor, old_wibox - row:connect_signal("mouse::enter", function() - local wb = mouse.current_wibox - old_cursor, old_wibox = wb.cursor, wb - wb.cursor = "hand1" - end) - row:connect_signal("mouse::leave", function() - if old_wibox then - old_wibox.cursor = old_cursor - old_wibox = nil - end - end) - - row:buttons(awful.util.table.join(awful.button({}, 1, function() - popup.visible = not popup.visible - item.command() - end))) - - table.insert(rows, row) - end - popup:setup(rows) - - logout_menu_widget:buttons( - awful.util.table.join( - awful.button({}, 1, function() - if popup.visible then - popup.visible = not popup.visible - logout_menu_widget:set_bg('#00000000') - else - popup:move_next_to(mouse.current_widget_geometry) - logout_menu_widget:set_bg(beautiful.bg_focus) - end - end) - ) - ) - - return logout_menu_widget - -end - -return setmetatable(logout_menu_widget, { __call = function(_, ...) return worker(...) end }) diff --git a/.config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-high-symbolic.svg b/.config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-high-symbolic.svg deleted file mode 100644 index 985c107bf..000000000 --- a/.config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-high-symbolic.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/.config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-low-symbolic.svg b/.config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-low-symbolic.svg deleted file mode 100644 index 7eb453137..000000000 --- a/.config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-low-symbolic.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/.config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-medium-symbolic.svg b/.config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-medium-symbolic.svg deleted file mode 100644 index 11e44fe9d..000000000 --- a/.config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-medium-symbolic.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/.config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-muted-symbolic.svg b/.config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-muted-symbolic.svg deleted file mode 100644 index e577d0505..000000000 --- a/.config/awesome/awesome-wm-widgets/volume-widget/icons/audio-volume-muted-symbolic.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/.config/awesome/awesome-wm-widgets/volume-widget/utils.lua b/.config/awesome/awesome-wm-widgets/volume-widget/utils.lua deleted file mode 100644 index 417a666ed..000000000 --- a/.config/awesome/awesome-wm-widgets/volume-widget/utils.lua +++ /dev/null @@ -1,105 +0,0 @@ - - -local utils = {} - -local function split(string_to_split, separator) - if separator == nil then separator = "%s" end - local t = {} - - for str in string.gmatch(string_to_split, "([^".. separator .."]+)") do - table.insert(t, str) - end - - return t -end - -function utils.extract_sinks_and_sources(pacmd_output) - local sinks = {} - local sources = {} - local device - local properties - local ports - local in_sink = false - local in_source = false - local in_device = false - local in_properties = false - local in_ports = false - for line in pacmd_output:gmatch("[^\r\n]+") do - if string.match(line, 'source%(s%) available.') then - in_sink = false - in_source = true - end - if string.match(line, 'sink%(s%) available.') then - in_sink = true - in_source = false - end - - if string.match(line, 'index:') then - in_device = true - in_properties = false - device = { - id = line:match(': (%d+)'), - is_default = string.match(line, '*') ~= nil - } - if in_sink then - table.insert(sinks, device) - elseif in_source then - table.insert(sources, device) - end - end - - if string.match(line, '^\tproperties:') then - in_device = false - in_properties = true - properties = {} - device['properties'] = properties - end - - if string.match(line, 'ports:') then - in_device = false - in_properties = false - in_ports = true - ports = {} - device['ports'] = ports - end - - if string.match(line, 'active port:') then - in_device = false - in_properties = false - in_ports = false - device['active_port'] = line:match(': (.+)'):gsub('<',''):gsub('>','') - end - - if in_device then - local t = split(line, ': ') - local key = t[1]:gsub('\t+', ''):lower() - local value = t[2]:gsub('^<', ''):gsub('>$', '') - device[key] = value - end - - if in_properties then - local t = split(line, '=') - local key = t[1]:gsub('\t+', ''):gsub('%.', '_'):gsub('-', '_'):gsub(':', ''):gsub("%s+$", "") - local value - if t[2] == nil then - value = t[2] - else - value = t[2]:gsub('"', ''):gsub("^%s+", ""):gsub(' Analog Stereo', '') - end - properties[key] = value - end - - if in_ports then - local t = split(line, ': ') - local key = t[1] - if key ~= nil then - key = key:gsub('\t+', '') - end - ports[key] = t[2] - end - end - - return sinks, sources -end - -return utils \ No newline at end of file diff --git a/.config/awesome/awesome-wm-widgets/volume-widget/volume-2.svg b/.config/awesome/awesome-wm-widgets/volume-widget/volume-2.svg deleted file mode 100644 index 10f1c67ad..000000000 --- a/.config/awesome/awesome-wm-widgets/volume-widget/volume-2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/.config/awesome/awesome-wm-widgets/volume-widget/volume.lua b/.config/awesome/awesome-wm-widgets/volume-widget/volume.lua deleted file mode 100644 index 5c95f6657..000000000 --- a/.config/awesome/awesome-wm-widgets/volume-widget/volume.lua +++ /dev/null @@ -1,228 +0,0 @@ -------------------------------------------------- --- The Ultimate Volume Widget for Awesome Window Manager --- More details could be found here: --- https://github.com/streetturtle/awesome-wm-widgets/tree/master/volume-widget - --- @author Pavel Makhov --- @copyright 2020 Pavel Makhov -------------------------------------------------- - -local awful = require("awful") -local wibox = require("wibox") -local spawn = require("awful.spawn") -local gears = require("gears") -local beautiful = require("beautiful") -local watch = require("awful.widget.watch") -local utils = require("awesome-wm-widgets.volume-widget.utils") - - -local LIST_DEVICES_CMD = [[sh -c "pacmd list-sinks; pacmd list-sources"]] -local function GET_VOLUME_CMD(device) return 'amixer -D ' .. device .. ' sget Master' end -local function INC_VOLUME_CMD(device, step) return 'amixer set Master ' .. step .. '%+' end -local function DEC_VOLUME_CMD(device, step) return 'amixer set Master ' .. step .. '%-' end -local function TOG_VOLUME_CMD(device) return 'amixer set Master toggle' end - - -local widget_types = { - icon_and_text = require("awesome-wm-widgets.volume-widget.widgets.icon-and-text-widget"), - icon = require("awesome-wm-widgets.volume-widget.widgets.icon-widget"), - arc = require("awesome-wm-widgets.volume-widget.widgets.arc-widget"), - horizontal_bar = require("awesome-wm-widgets.volume-widget.widgets.horizontal-bar-widget"), - vertical_bar = require("awesome-wm-widgets.volume-widget.widgets.vertical-bar-widget") -} -local volume = {} - -local rows = { layout = wibox.layout.fixed.vertical } - -local popup = awful.popup{ - bg = beautiful.bg_normal, - ontop = true, - visible = false, - shape = gears.shape.rounded_rect, - border_width = 1, - border_color = beautiful.bg_focus, - maximum_width = 400, - offset = { y = 5 }, - widget = {} -} - -local function build_main_line(device) - if device.active_port ~= nil and device.ports[device.active_port] ~= nil then - return device.properties.device_description .. ' · ' .. device.ports[device.active_port] - else - return device.properties.device_description - end -end - -local function build_rows(devices, on_checkbox_click, device_type) - local device_rows = { layout = wibox.layout.fixed.vertical } - for _, device in pairs(devices) do - - local checkbox = wibox.widget { - checked = device.is_default, - color = beautiful.bg_normal, - paddings = 2, - shape = gears.shape.circle, - forced_width = 20, - forced_height = 20, - check_color = beautiful.fg_urgent, - widget = wibox.widget.checkbox - } - - checkbox:connect_signal("button::press", function() - spawn.easy_async(string.format([[sh -c 'pacmd set-default-%s "%s"']], device_type, device.name), function() - on_checkbox_click() - end) - end) - - local row = wibox.widget { - { - { - { - checkbox, - valign = 'center', - layout = wibox.container.place, - }, - { - { - text = build_main_line(device), - align = 'left', - widget = wibox.widget.textbox - }, - left = 10, - layout = wibox.container.margin - }, - spacing = 8, - layout = wibox.layout.align.horizontal - }, - margins = 4, - layout = wibox.container.margin - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - } - - row:connect_signal("mouse::enter", function(c) c:set_bg(beautiful.bg_focus) end) - row:connect_signal("mouse::leave", function(c) c:set_bg(beautiful.bg_normal) end) - - local old_cursor, old_wibox - row:connect_signal("mouse::enter", function() - local wb = mouse.current_wibox - old_cursor, old_wibox = wb.cursor, wb - wb.cursor = "hand1" - end) - row:connect_signal("mouse::leave", function() - if old_wibox then - old_wibox.cursor = old_cursor - old_wibox = nil - end - end) - - row:connect_signal("button::press", function() - spawn.easy_async(string.format([[sh -c 'pacmd set-default-%s "%s"']], device_type, device.name), function() - on_checkbox_click() - end) - end) - - table.insert(device_rows, row) - end - - return device_rows -end - -local function build_header_row(text) - return wibox.widget{ - { - markup = "" .. text .. "", - align = 'center', - widget = wibox.widget.textbox - }, - bg = beautiful.bg_normal, - widget = wibox.container.background - } -end - -local function rebuild_popup() - spawn.easy_async(LIST_DEVICES_CMD, function(stdout) - - local sinks, sources = utils.extract_sinks_and_sources(stdout) - - for i = 0, #rows do rows[i]=nil end - - table.insert(rows, build_header_row("SINKS")) - table.insert(rows, build_rows(sinks, function() rebuild_popup() end, "sink")) - table.insert(rows, build_header_row("SOURCES")) - table.insert(rows, build_rows(sources, function() rebuild_popup() end, "source")) - - popup:setup(rows) - end) -end - - -local function worker(user_args) - - local args = user_args or {} - - local mixer_cmd = args.mixer_cmd or 'pavucontrol' - local widget_type = args.widget_type - local refresh_rate = args.refresh_rate or 1 - local step = args.step or 5 - local device = args.device or 'pulse' - - if widget_types[widget_type] == nil then - volume.widget = widget_types['icon_and_text'].get_widget(args.icon_and_text_args) - else - volume.widget = widget_types[widget_type].get_widget(args) - end - - local function update_graphic(widget, stdout) - local mute = string.match(stdout, "%[(o%D%D?)%]") -- \[(o\D\D?)\] - [on] or [off] - if mute == 'off' then widget:mute() - elseif mute == 'on' then widget:unmute() - end - local volume_level = string.match(stdout, "(%d?%d?%d)%%") -- (\d?\d?\d)\%) - volume_level = string.format("% 3d", volume_level) - widget:set_volume_level(volume_level) - end - - function volume:inc(s) - spawn.easy_async(INC_VOLUME_CMD(device, s or step), function(stdout) update_graphic(volume.widget, stdout) end) - end - - function volume:dec(s) - spawn.easy_async(DEC_VOLUME_CMD(device, s or step), function(stdout) update_graphic(volume.widget, stdout) end) - end - - function volume:toggle() - spawn.easy_async(TOG_VOLUME_CMD(device), function(stdout) update_graphic(volume.widget, stdout) end) - end - - function volume:mixer() - if mixer_cmd then - spawn.easy_async(mixer_cmd) - end - end - - volume.widget:buttons( - awful.util.table.join( - awful.button({}, 3, function() - if popup.visible then - popup.visible = not popup.visible - else - rebuild_popup() - popup:move_next_to(mouse.current_widget_geometry) - end - end), - awful.button({}, 4, function() volume:inc() end), - awful.button({}, 5, function() volume:dec() end), - awful.button({}, 2, function() volume:mixer() end), - awful.button({}, 1, function() volume:toggle() end) - ) - ) - - watch(GET_VOLUME_CMD(device), refresh_rate, update_graphic, volume.widget) - - return volume.widget -end - -return setmetatable(volume, { __call = function(_, ...) return worker(...) end }) diff --git a/.config/awesome/awesome-wm-widgets/volume-widget/widgets/arc-widget.lua b/.config/awesome/awesome-wm-widgets/volume-widget/widgets/arc-widget.lua deleted file mode 100644 index b512f127f..000000000 --- a/.config/awesome/awesome-wm-widgets/volume-widget/widgets/arc-widget.lua +++ /dev/null @@ -1,46 +0,0 @@ -local wibox = require("wibox") -local beautiful = require('beautiful') - -local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/volume-widget/icons/' - -local widget = {} - -function widget.get_widget(widgets_args) - local args = widgets_args or {} - - local thickness = args.thickness or 2 - local main_color = args.main_color or beautiful.fg_color - local bg_color = args.bg_color or '#ffffff11' - local mute_color = args.mute_color or beautiful.fg_urgent - local size = args.size or 18 - - return wibox.widget { - { - id = "icon", - image = ICON_DIR .. 'audio-volume-high-symbolic.svg', - resize = true, - widget = wibox.widget.imagebox, - }, - max_value = 100, - thickness = thickness, - start_angle = 4.71238898, -- 2pi*3/4 - forced_height = size, - forced_width = size, - bg = bg_color, - paddings = 2, - widget = wibox.container.arcchart, - set_volume_level = function(self, new_value) - self.value = new_value - end, - mute = function(self) - self.colors = { mute_color } - end, - unmute = function(self) - self.colors = { main_color } - end - } - -end - - -return widget \ No newline at end of file diff --git a/.config/awesome/awesome-wm-widgets/volume-widget/widgets/horizontal-bar-widget.lua b/.config/awesome/awesome-wm-widgets/volume-widget/widgets/horizontal-bar-widget.lua deleted file mode 100644 index be1f38d2e..000000000 --- a/.config/awesome/awesome-wm-widgets/volume-widget/widgets/horizontal-bar-widget.lua +++ /dev/null @@ -1,58 +0,0 @@ -local wibox = require("wibox") -local beautiful = require('beautiful') -local gears = require("gears") - -local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/volume-widget/icons/' - -local widget = {} - -function widget.get_widget(widgets_args) - local args = widgets_args or {} - - local main_color = args.main_color or beautiful.fg_normal - local mute_color = args.mute_color or beautiful.fg_urgent - local bg_color = args.bg_color or '#ffffff11' - local width = args.width or 50 - local margins = args.margins or 10 - local shape = args.shape or 'bar' - local with_icon = args.with_icon == true and true or false - - local bar = wibox.widget { - { - { - id = "icon", - image = ICON_DIR .. 'audio-volume-high-symbolic.svg', - resize = false, - widget = wibox.widget.imagebox, - }, - valign = 'center', - visible = with_icon, - layout = wibox.container.place, - }, - { - id = 'bar', - max_value = 100, - forced_width = width, - color = main_color, - margins = { top = margins, bottom = margins }, - background_color = bg_color, - shape = gears.shape[shape], - widget = wibox.widget.progressbar, - }, - spacing = 4, - layout = wibox.layout.fixed.horizontal, - set_volume_level = function(self, new_value) - self:get_children_by_id('bar')[1]:set_value(tonumber(new_value)) - end, - mute = function(self) - self:get_children_by_id('bar')[1]:set_color(mute_color) - end, - unmute = function(self) - self:get_children_by_id('bar')[1]:set_color(main_color) - end - } - - return bar -end - -return widget diff --git a/.config/awesome/awesome-wm-widgets/volume-widget/widgets/icon-and-text-widget.lua b/.config/awesome/awesome-wm-widgets/volume-widget/widgets/icon-and-text-widget.lua deleted file mode 100644 index b1a2793dd..000000000 --- a/.config/awesome/awesome-wm-widgets/volume-widget/widgets/icon-and-text-widget.lua +++ /dev/null @@ -1,59 +0,0 @@ -local wibox = require("wibox") -local beautiful = require('beautiful') - -local widget = {} - -local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/volume-widget/icons/' - -function widget.get_widget(widgets_args) - local args = widgets_args or {} - - local font = args.font or beautiful.font - local icon_dir = args.icon_dir or ICON_DIR - - return wibox.widget { - { - { - id = "icon", - resize = false, - widget = wibox.widget.imagebox, - }, - valign = 'center', - layout = wibox.container.place - }, - { - id = 'txt', - font = font, - widget = wibox.widget.textbox - }, - layout = wibox.layout.fixed.horizontal, - set_volume_level = function(self, new_value) - self:get_children_by_id('txt')[1]:set_text(new_value) - local volume_icon_name - if self.is_muted then - volume_icon_name = 'audio-volume-muted-symbolic' - else - local new_value_num = tonumber(new_value) - if (new_value_num >= 0 and new_value_num < 33) then - volume_icon_name="audio-volume-low-symbolic" - elseif (new_value_num < 66) then - volume_icon_name="audio-volume-medium-symbolic" - else - volume_icon_name="audio-volume-high-symbolic" - end - end - self:get_children_by_id('icon')[1]:set_image(icon_dir .. volume_icon_name .. '.svg') - end, - mute = function(self) - self.is_muted = true - self:get_children_by_id('icon')[1]:set_image(icon_dir .. 'audio-volume-muted-symbolic.svg') - end, - unmute = function(self) - self.is_muted = false - end - } - -end - - -return widget \ No newline at end of file diff --git a/.config/awesome/awesome-wm-widgets/volume-widget/widgets/icon-widget.lua b/.config/awesome/awesome-wm-widgets/volume-widget/widgets/icon-widget.lua deleted file mode 100644 index cc39a3d3a..000000000 --- a/.config/awesome/awesome-wm-widgets/volume-widget/widgets/icon-widget.lua +++ /dev/null @@ -1,46 +0,0 @@ -local wibox = require("wibox") - -local widget = {} - -local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/volume-widget/icons/' - -function widget.get_widget(widgets_args) - local args = widgets_args or {} - - local icon_dir = args.icon_dir or ICON_DIR - - return wibox.widget { - { - id = "icon", - resize = false, - widget = wibox.widget.imagebox, - }, - valign = 'center', - layout = wibox.container.place, - set_volume_level = function(self, new_value) - local volume_icon_name - if self.is_muted then - volume_icon_name = 'audio-volume-muted-symbolic' - else - local new_value_num = tonumber(new_value) - if (new_value_num >= 0 and new_value_num < 33) then - volume_icon_name="audio-volume-low-symbolic" - elseif (new_value_num < 66) then - volume_icon_name="audio-volume-medium-symbolic" - else - volume_icon_name="audio-volume-high-symbolic" - end - end - self:get_children_by_id('icon')[1]:set_image(icon_dir .. volume_icon_name .. '.svg') - end, - mute = function(self) - self.is_muted = true - self:get_children_by_id('icon')[1]:set_image(icon_dir .. 'audio-volume-muted-symbolic.svg') - end, - unmute = function(self) - self.is_muted = false - end - } -end - -return widget \ No newline at end of file diff --git a/.config/awesome/awesome-wm-widgets/volume-widget/widgets/vertical-bar-widget.lua b/.config/awesome/awesome-wm-widgets/volume-widget/widgets/vertical-bar-widget.lua deleted file mode 100644 index 6f32b50d9..000000000 --- a/.config/awesome/awesome-wm-widgets/volume-widget/widgets/vertical-bar-widget.lua +++ /dev/null @@ -1,64 +0,0 @@ -local wibox = require("wibox") -local beautiful = require('beautiful') -local gears = require("gears") - -local ICON_DIR = os.getenv("HOME") .. '/.config/awesome/awesome-wm-widgets/volume-widget/icons/' - -local widget = {} - -function widget.get_widget(widgets_args) - local args = widgets_args or {} - - local main_color = args.main_color or beautiful.fg_normal - local mute_color = args.mute_color or beautiful.fg_urgent - local bg_color = args.bg_color or '#ffffff11' - local width = args.width or 10 - local margins = args.height or 2 - local shape = args.shape or 'bar' - local with_icon = args.with_icon == true and true or false - - local bar = wibox.widget { - { - { - id = "icon", - image = ICON_DIR .. 'audio-volume-high-symbolic.svg', - resize = false, - widget = wibox.widget.imagebox, - }, - valign = 'center', - visible = with_icon, - layout = wibox.container.place, - }, - { - { - id = 'bar', - max_value = 100, - forced_width = width, - forced_height = 5, - margins = { top = margins, bottom = margins }, - color = main_color, - background_color = bg_color, - shape = gears.shape[shape], - widget = wibox.widget.progressbar, - }, - forced_width = width, - direction = 'east', - layout = wibox.container.rotate, - }, - spacing = 4, - layout = wibox.layout.fixed.horizontal, - set_volume_level = function(self, new_value) - self:get_children_by_id('bar')[1]:set_value(tonumber(new_value)) - end, - mute = function(self) - self:get_children_by_id('bar')[1]:set_color(mute_color) - end, - unmute = function(self) - self:get_children_by_id('bar')[1]:set_color(main_color) - end - } - - return bar -end - -return widget diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 1d33c8337..7f18053d2 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -1,21 +1,15 @@ --- ____ ____ _ __ +-- ____ ____ _ _ -- | _ \| _ \| |/ / -- | | | | |_) | ' / Clay Gomera (Drake) -- | |_| | _ <| . \ My custom awesome config -- |____/|_| \_\_|\_\ -- - -- BEGINNING OF LIBRARIES -- -- Standard awesome library local gears = require("gears") --Utilities such as color parsing and objects local awful = require("awful") --Everything related to window managment require("awful.autofocus") - -- Custom libraries -local battery_widget = require("awesome-wm-widgets.battery-widget.battery") -local volume_widget = require('awesome-wm-widgets.volume-widget.volume') -local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness") -local logout_menu_widget = require("awesome-wm-widgets.logout-menu-widget.logout-menu") -- Widget and layout library local wibox = require("wibox") -- Theme handling library @@ -115,7 +109,7 @@ local terminal = "alacritty" local edit = "emacsclient -c -a emacs" local file = "alacritty -e ./.config/vifm/scripts/vifmrun" local web = "qutebrowser" -local music = "alacritty -e musikcube" +local music = "alacritty -e mocp" local games = "retroarch" -- Key bindings variables local modkey = "Mod4" @@ -294,31 +288,18 @@ globalkeys = my_table.join( -- games awful.key({ modkey }, "F7", function () awful.util.spawn(games) end, {description = "Launch gaming app", group = "Apps"}), - -- misc - awful.key({ modkey, "Shift" }, "p", function () awful.util.spawn("alacritty -e pulsemixer") awful.util.spawn("alacritty -e alsamixer") end, - {description = "Launch mixers", group = "Apps"}), - awful.key({ modkey, altkey }, "w", function () awful.util.spawn("alacritty -e nmtui connect") end, - {description = "Launch mixers", group = "Apps"}), -- Volume - awful.key({}, "XF86AudioRaiseVolume", function() volume_widget:inc(5) end, + awful.key({}, "XF86AudioRaiseVolume", function() awful.spawn("amixer set Master 5%+") end, {description = "Increase volume", group = "Quick Actions"}), - awful.key({}, "XF86AudioLowerVolume", function() volume_widget:dec(5) end, + awful.key({}, "XF86AudioLowerVolume", function() awful.spawn("amixer set Master 5%-") end, {description = "Decrease volume", group = "Quick Actions"}), - awful.key({}, "XF86AudioMute", function() volume_widget:toggle() end, + awful.key({}, "XF86AudioMute", function() awful.spawn("amixer set Master toggle") end, {description = "Mute volume", group = "Quick Actions"}), -- Brightness - awful.key({}, "XF86MonBrightnessUp", function () brightness_widget:inc(5) end, + awful.key({}, "XF86MonBrightnessUp", function () awful.spawn("xbacklight -inc 10") end, {description = "Increase brightness", group = "Quick Actions"}), - awful.key({}, "XF86MonBrightnessDown", function () brightness_widget:dec(5) end, + awful.key({}, "XF86MonBrightnessDown", function () awful.spawn("xbacklight -dec 10") end, {description = "Decrease brightness", group = "Quick Actions"}), --- Screenshots - awful.key({ modkey }, "Print", function() awful.util.spawn("scrot") end, - {description = "Take a screenshot (Complete screen mode)", group = "Quick Actions"}), - awful.key({ modkey, modkey1 }, "Print", function() awful.util.spawn("scrot -s") end, - {description = "Take a screenshot (Area selection mode)", group = "Quick Actions"}), --- Screen configuration tool - awful.key({ modkey }, "p", function() awful.util.spawn("arandr") end, - {description = "Launch screen configuration tool", group = ("Quick Actions")}), -- Screenlocker awful.key({ modkey, modkey1 }, "l", function() awful.spawn(screenlocker) end, {description = "Lock the screen", group = "Quick Actions"}), @@ -547,6 +528,7 @@ client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_n -- BEGINNING OF AUTOSTART -- awful.util.spawn_with_shell("sh $HOME/.fehbg &") awful.util.spawn_with_shell("lxpolkit &") -awful.util.spawn_with_shell("picom --config ~/.config/picom/picom.conf &") awful.util.spawn_with_shell("/usr/bin/emacs --daemon &") +awful.util.spawn_with_shell("pulseaudio &") +awful.util.spawn_with_shell("picom --config $HOME/.config/picom/picom.conf &") -- END OF AUTOSTART -- diff --git a/.config/awesome/themes/gruvbox-dark/theme.lua b/.config/awesome/themes/gruvbox-dark/theme.lua index c2e4daae2..5c70f47f6 100644 --- a/.config/awesome/themes/gruvbox-dark/theme.lua +++ b/.config/awesome/themes/gruvbox-dark/theme.lua @@ -5,10 +5,6 @@ -- |____/|_| \_\_|\_\ -- ---[[ - VARIABLES -]] - local gears = require("gears") local lain = require("lain") local lain_helpers = require("lain.helpers") @@ -17,12 +13,6 @@ local wibox = require("wibox") local lgi = require("lgi") local dpi = require("beautiful.xresources").apply_dpi --- Custom libraries -local battery_widget = require("awesome-wm-widgets.battery-widget.battery") -local volume_widget = require('awesome-wm-widgets.volume-widget.volume') -local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness") -local logout_menu_widget = require("awesome-wm-widgets.logout-menu-widget.logout-menu") - local os = os local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility @@ -123,6 +113,84 @@ local clock = awful.widget.watch( widget:set_markup(" " .. markup.font(theme.font, stdout)) end ) + +-- Battery +local baticon = wibox.widget.imagebox(theme.widget_battery) +local bat = lain.widget.bat({ + settings = function() + if bat_now.status and bat_now.status ~= "N/A" then + if bat_now.ac_status == 1 then + baticon:set_image(theme.widget_ac) + elseif not bat_now.perc and tonumber(bat_now.perc) <= 5 then + baticon:set_image(theme.widget_battery_empty) + elseif not bat_now.perc and tonumber(bat_now.perc) <= 15 then + baticon:set_image(theme.widget_battery_low) + else + baticon:set_image(theme.widget_battery) + end + widget:set_markup(markup.font(theme.font, " " .. bat_now.perc .. "% ")) + else + widget:set_markup(markup.font(theme.font, " AC ")) + baticon:set_image(theme.widget_ac) + end + end +}) + +-- CPU +local cpuicon = wibox.widget.imagebox(theme.widget_cpu) +local cpu = lain.widget.cpu({ + settings = function() + widget:set_markup(markup.font(theme.font, " " .. cpu_now.usage .. "% ")) + end +}) + +-- MEM +local memicon = wibox.widget.imagebox(theme.widget_mem) +local mem = lain.widget.mem({ + settings = function() + widget:set_markup(markup.font(theme.font, " " .. mem_now.used .. "MB ")) + end +}) + +-- Net +local neticon = wibox.widget.imagebox(theme.widget_net) +local net = lain.widget.net({ + settings = function() + widget:set_markup(markup.font(theme.font, + markup("#7AC82E", "DN: " .. string.format("%2.fK", net_now.received)) + .. " | " .. + markup("#46A8C3", "UP: " .. string.format("%2.fK", net_now.sent) .. " "))) + end +}) + +-- ALSA volume +local volicon = wibox.widget.imagebox(theme.widget_vol) +theme.volume = lain.widget.alsa({ + settings = function() + if volume_now.status == "off" then + volicon:set_image(theme.widget_vol_mute) + elseif tonumber(volume_now.level) == 0 then + volicon:set_image(theme.widget_vol_no) + elseif tonumber(volume_now.level) <= 50 then + volicon:set_image(theme.widget_vol_low) + else + volicon:set_image(theme.widget_vol) + end + + widget:set_markup(markup.font(theme.font, " " .. volume_now.level .. "% ")) + end +}) +theme.volume.widget:buttons(awful.util.table.join( + awful.button({}, 4, function () + awful.util.spawn("amixer set Master 1%+") + theme.volume.update() + end), + awful.button({}, 5, function () + awful.util.spawn("amixer set Master 1%-") + theme.volume.update() + end) +)) + -- Separators local spr = wibox.widget.textbox(' ') local arrl_dl = separators.arrow_left(theme.bg_focus, "alpha") @@ -175,21 +243,24 @@ function theme.at_screen_connect(s) wibox.container.background(mykeyboardlayout, theme.bg_focus), arrl_dl, arrl_ld, - wibox.container.background(volume_widget{ - widget_type = 'icon_and_text', - device = 'default'}, theme.bg_focus), + wibox.container.background(volicon, theme.bg_focus), + wibox.container.background(theme.volume.widget, theme.bg_focus), arrl_dl, arrl_ld, - wibox.container.background(battery_widget(), theme.bg_focus), + wibox.container.background(baticon, theme.bg_focus), + wibox.container.background(bat.widget, theme.bg_focus), arrl_dl, arrl_ld, - wibox.container.background(brightness_widget{ - type = 'icon_and_text', - program = 'xbacklight'}, theme.bg_focus), + wibox.container.background(cpuicon, theme.bg_focus), + wibox.container.background(cpu.widget, theme.bg_focus), arrl_dl, arrl_ld, - wibox.container.background(logout_menu_widget{ - font = 'mononoki Nerd Font'}, theme.bg_focus), + wibox.container.background(memicon, theme.bg_focus), + wibox.container.background(mem.widget, theme.bg_focus), + arrl_dl, + arrl_ld, + wibox.container.background(neticon, theme.bg_focus), + wibox.container.background(net.widget, theme.bg_focus), }, }, { diff --git a/.config/doom/config.el b/.config/doom/config.el index bc62b1a8d..c0551204b 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -1,3 +1,5 @@ +(beacon-mode 1) + (map! :leader (:prefix ("b". "buffer") :desc "List bookmarks" "L" #'list-bookmarks @@ -90,6 +92,11 @@ (kbd "g ") 'centaur-tabs-forward-group (kbd "g ") 'centaur-tabs-backward-group) +(map! :leader + (:prefix ("c h" . "Help info from Clippy") + :desc "Clippy describes function under point" "f" #'clippy-describe-function + :desc "Clippy describes variable under point" "v" #'clippy-describe-variable)) + (use-package dashboard :init ;; tweak dashboard config before loading it (setq dashboard-set-heading-icons t) @@ -296,6 +303,11 @@ List of keybindings (SPC h b b)") :desc "Toggle line highlight globally" "H" #'global-hl-line-mode :desc "Toggle truncate lines" "t" #'toggle-truncate-lines)) +(setq minimap-window-location 'right) +(map! :leader + (:prefix ("t" . "toggle") + :desc "Toggle minimap-mode" "m" #'minimap-mode)) + (set-face-attribute 'mode-line nil :font "Ubuntu Mono-13") (setq doom-modeline-height 30 ;; sets modeline height doom-modeline-bar-width 5 ;; sets right bar width diff --git a/.config/doom/config.org b/.config/doom/config.org index a94cd0cc6..8d534b920 100644 --- a/.config/doom/config.org +++ b/.config/doom/config.org @@ -6,12 +6,14 @@ * TABLE OF CONTENTS :toc: - [[#about-this-config][ABOUT THIS CONFIG]] +- [[#beacon][BEACON]] - [[#bookmarks-and-buffers][BOOKMARKS AND BUFFERS]] - [[#bookmarks][Bookmarks]] - [[#buffers][Buffers]] - [[#keybindings-within-ibuffer-mode][Keybindings within ibuffer mode]] - [[#calendar][CALENDAR]] - [[#centaur-tabs][CENTAUR-TABS]] +- [[#clippy][CLIPPY]] - [[#dashboard][DASHBOARD]] - [[#configuring-dashboard][Configuring Dashboard]] - [[#dashboard-in-emacsclient][Dashboard in Emacsclient]] @@ -32,6 +34,7 @@ - [[#ivy-posframe][IVY-POSFRAME]] - [[#ivy-keybindings][IVY KEYBINDINGS]] - [[#line-settings][LINE SETTINGS]] +- [[#minimap][MINIMAP]] - [[#modeline][MODELINE]] - [[#mouse-support][MOUSE SUPPORT]] - [[#neotree][NEOTREE]] @@ -54,6 +57,13 @@ * ABOUT THIS CONFIG This is my personal Doom Emacs config. Doom Emacs is a distribution of Emacs that uses the "evil" keybindings (Vim keybindings) and includes a number of nice extensions and a bit of configuration out of the box. I am maintaining this config not just for myself, but also for those that want to explore some of what is possible with Emacs. I will add a lot of examples of plugins and settings, some of them I may not even use personally. I do this because many people following me on YouTube look at my configs as "documentation". This config is a fork of DistroTube's config. +* BEACON +Never lose your cursor. When you scroll, your cursor will shine! This is a global minor-mode. Turn it on everywhere with: + +#+begin_src emacs-lisp +(beacon-mode 1) +#+end_src + * BOOKMARKS AND BUFFERS Doom Emacs uses 'SPC b' for keybindings related to bookmarks and buffers. @@ -207,6 +217,22 @@ To use tabs in Doom Emacs, be sure to uncomment "tabs" in Doom's init.el. Displ (kbd "g ") 'centaur-tabs-backward-group) #+END_SRC +* CLIPPY +Gives us a popup box with "Clippy, the paper clip". You can make him say various things by calling 'clippy-say' function. But the more useful functions of clippy are the two describe functions provided: 'clippy-describe-function' and 'clippy-describe-variable'. Hit the appropriate keybinding while the point is over a function/variable to call it. A popup with helpful clippy will appear, telling you about the function/variable (using describe-function and describe-variable respectively). + +| COMMAND | DESCRIPTION | KEYBINDING | +|--------------------------+---------------------------------------+------------| +| clippy-describe-function | /Clippy describes function under point/ | SPC c h f | +| clippy-describe-variable | /Clippy describes variable under point/ | SPC c h v | + +#+begin_src emacs-lisp +(map! :leader + (:prefix ("c h" . "Help info from Clippy") + :desc "Clippy describes function under point" "f" #'clippy-describe-function + :desc "Clippy describes variable under point" "v" #'clippy-describe-variable)) + +#+end_src + * DASHBOARD Emacs Dashboard is an extensible startup screen showing you recent files, bookmarks, agenda items and an Emacs banner. @@ -522,6 +548,7 @@ Some custom functions to insert the date. The function 'insert-todays-date' can :desc "Insert any date" "a" #'dt/insert-any-date :desc "Insert todays date" "t" #'dt/insert-todays-date)) #+end_src + * IVY Ivy is a generic completion mechanism for Emacs. @@ -593,6 +620,20 @@ I set comment-line to 'SPC TAB TAB' which is a rather comfortable keybinding for :desc "Toggle truncate lines" "t" #'toggle-truncate-lines)) #+END_SRC +* MINIMAP +A minimap sidebar displaying a smaller version of the current buffer on either the left or right side. It highlights the currently shown region and updates its position automatically. Be aware that this minimap program does not work in Org documents. This is not unusual though because I have tried several minimap programs and none of them can handle Org. + +| COMMAND | DESCRIPTION | KEYBINDING | +|--------------+-------------------------------------------+------------| +| minimap-mode | /Toggle minimap-mode/ | SPC t m | + +#+begin_src emacs-lisp +(setq minimap-window-location 'right) +(map! :leader + (:prefix ("t" . "toggle") + :desc "Toggle minimap-mode" "m" #'minimap-mode)) +#+end_src + * MODELINE The modeline is the bottom status bar that appears in Emacs windows. For more information on what is available to configure in the Doom modeline, check out: https://github.com/seagle0128/doom-modeline diff --git a/.config/doom/packages.el b/.config/doom/packages.el index f20e8d638..c357931aa 100644 --- a/.config/doom/packages.el +++ b/.config/doom/packages.el @@ -66,14 +66,22 @@ (package! elfeed-goodies) (package! elpher) (package! emojify) +(package! esxml) (package! evil-tutor) (package! ivy-posframe) (package! mw-thesaurus) +(package! org-board) +(package! org-web-tools) (package! ox-gemini) (package! pacmacs) (package! peep-dired) (package! password-store) (package! rainbow-mode) +(package! request) (package! resize-window) +(package! s) (package! tldr) (package! wc-mode) +(package! beacon) +(package! clippy) +(package! minimap) diff --git a/.config/fish/config.fish b/.config/fish/config.fish deleted file mode 100644 index 46f3a2de7..000000000 --- a/.config/fish/config.fish +++ /dev/null @@ -1,229 +0,0 @@ -## ____ ____ _ __ -## | _ \| _ \| |/ / -## | | | | |_) | ' / Clay Gomera (Drake) -## | |_| | _ <| . \ My custom config.fish -## |____/|_| \_\_|\_\ -## - -if status is-interactive - # Commands to run in interactive sessions can go here -end - -### EXPORT -set -U fish_greeting "" -set EDITOR "emacsclient -t -a ''" # $EDITOR use Emacs in terminal -set VISUAL "emacsclient -c -a emacs" # $VISUAL use Emacs in GUI mode - -### ADDING TO THE PATH -# First line removes the path; second line sets it. Without the first line, -# your path gets massive and fish becomes very slow. -set -e fish_user_paths -set -U fish_user_paths $HOME/.local/bin $HOME/Applications $fish_user_paths - -# Vi mode -function fish_user_key_bindings - # fish_default_key_bindings - fish_vi_key_bindings -end - -### "bat" as manpager -set -x MANPAGER "sh -c 'col -bx | bat -l man -p'" - -### AUTOCOMPLETE AND HIGHLIGHT COLORS ### -set fish_color_normal brcyan -set fish_color_autosuggestion '#7d7d7d' -set fish_color_command brcyan -set fish_color_error '#ff6c6b' -set fish_color_param brcyan - -### FUNCTIONS -# Functions needed for !! and !$ -function __history_previous_command - switch (commandline -t) - case "!" - commandline -t $history[1]; commandline -f repaint - case "*" - commandline -i ! - end -end - -function __history_previous_command_arguments - switch (commandline -t) - case "!" - commandline -t "" - commandline -f history-token-search-backward - case "*" - commandline -i '$' - end -end -# The bindings for !! and !$ -if [ $fish_key_bindings = "fish_vi_key_bindings" ]; - bind -Minsert ! __history_previous_command - bind -Minsert '$' __history_previous_command_arguments -else - bind ! __history_previous_command - bind '$' __history_previous_command_arguments -end - -# Function for creating a backup file -# ex: backup file.txt -# result: copies file as file.txt.bak -function backup --argument filename - cp $filename $filename.bak -end - -# Function for copying files and directories, even recursively. -# ex: copy DIRNAME LOCATIONS -# result: copies the directory and all of its contents. -function copy - set count (count $argv | tr -d \n) - if test "$count" = 2; and test -d "$argv[1]" - set from (echo $argv[1] | trim-right /) - set to (echo $argv[2]) - command cp -r $from $to - else - command cp $argv - end -end - -# Function for printing a column (splits input on whitespace) -# ex: echo 1 2 3 | coln 3 -# output: 3 -function coln - while read -l input - echo $input | awk '{print $'$argv[1]'}' - end -end - -# Function for printing a row -# ex: seq 3 | rown 3 -# output: 3 -function rown --argument index - sed -n "$index p" -end - -# Function for ignoring the first 'n' lines -# ex: seq 10 | skip 5 -# results: prints everything but the first 5 lines -function skip --argument n - tail +(math 1 + $n) -end - -# Function for taking the first 'n' lines -# ex: seq 10 | take 5 -# results: prints only the first 5 lines -function take --argument number - head -$number -end - -### ALIASES -# navigation -alias ..='cd ..' -alias .2='cd ../..' -alias .3='cd ../../..' -alias .4='cd ../../../..' -alias .5='cd ../../../../..' - -# bat as cat -alias cat='bat' - -# editors -alias vim='nvim' -alias em="/usr/bin/emacs -nw" -alias emacs="emacsclient -c -a 'emacs'" -alias doomsync="~/.emacs.d/bin/doom sync" -alias doomdoctor="~/.emacs.d/bin/doom doctor" -alias doomupgrade="~/.emacs.d/bin/doom upgrade" -alias doompurge="~/.emacs.d/bin/doom purge" -alias doominstall="~/.emacs.d/bin/doom install" - -# Changing "ls" to "exa" -alias ls='exa -al --color=always --group-directories-first' # my preferred listing -alias la='exa -a --color=always --group-directories-first' # all files and dirs -alias ll='exa -l --color=always --group-directories-first' # long format -alias lt='exa -aT --color=always --group-directories-first' # tree listing -alias l.='exa -a | egrep "^\."' - -# xbps -alias xb-up='sudo xbps-install -Su && xcheckrestart' # update the whole system -alias xb-get='sudo xbps-install -S' # install a program -alias xb-qry='sudo xbps-query' # query details about a program -alias xb-rmv='sudo xbps-remove -R' # remove a package with all its dependencies (it may brake something) -alias xb-rmv-sec='sudo xbps-remove' # remove a package with all its dependencies (secure way) -alias xb-cln='sudo xbps-remove -o && sudo xbps-remove -O' # remove unnecesary packages and clean cache - -# Colorize grep output (good for log files) -alias grep='grep --color=auto' -alias egrep='egrep --color=auto' -alias fgrep='fgrep --color=auto' - -# confirm before overwriting something -alias rm='rm -i' -alias mv='mv -i' -alias cp='cp -i' - -# git -alias git-clone='git clone' - -# ani-cli -alias ani='ani-cli' -alias ani-q='ani-cli -q' # to select video quality - -# ytfzf -alias yt='ytfzf -f -t' - -# notflix -alias nt='notflix' - -# mount and unmount drives -alias mnt='sudo mount' -alias umnt='sudo umount' - -# mixers -alias mx='pulsemixer' -alias amx='alsamixer' - -# music player -alias mk='musikcube' - -# power management -alias po='loginctl poweroff' -alias sp='loginctl suspend' -alias rb='loginctl reboot' - -# file manager -alias fm='/home/drk/.config/vifm/scripts/./vifmrun' - -# system monitor -alias tp='btop' -alias top='btop' -alias htop='btop' - -# get error messages from journalctl -alias jctl="journalctl -p 3 -xb" - -# youtube-dl -alias yta-aac="youtube-dl --extract-audio --audio-format aac " -alias yta-best="youtube-dl --extract-audio --audio-format best " -alias yta-flac="youtube-dl --extract-audio --audio-format flac " -alias yta-m4a="youtube-dl --extract-audio --audio-format m4a " -alias yta-mp3="youtube-dl --extract-audio --audio-format mp3 " -alias yta-opus="youtube-dl --extract-audio --audio-format opus " -alias yta-vorbis="youtube-dl --extract-audio --audio-format vorbis " -alias yta-wav="youtube-dl --extract-audio --audio-format wav " -alias ytv-best="youtube-dl -f bestvideo+bestaudio " - -# Network Manager and bluetooth -alias netstats='nmcli dev' -alias wfi='nmtui-connect' -alias wfi-scan='nmcli dev wifi list' -alias wfi-edit='nmtui-edit' -alias wfi-on='nmcli radio wifi on' -alias wfi-off='nmcli radio wifi off' -alias blt='bluetoothctl' - -# the terminal rickroll -alias rr='curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash' - -### SETTING THE STARSHIP PROMPT ### -starship init fish | source diff --git a/.config/scripts/deploy.sh b/.config/scripts/deploy.sh new file mode 100755 index 000000000..a02c4ecf1 --- /dev/null +++ b/.config/scripts/deploy.sh @@ -0,0 +1,55 @@ +#!/bin/sh +# This is script is meant to deploy all my configs to an specific directory + +# Directory list +dir1="$HOME/.config/awesome/" +dir2="$HOME/.config/alacritty/" +dir3="$HOME/.config/picom/" +dir4="$HOME/.config/vifm/" +dir6="$HOME/.config/doom/" +dir7="$HOME/.config/scripts/" + +# File List +newsboaturl="$HOME/.newsboat/urls" +zshrc="$HOME/.zshrc" +bashrc="$HOME/.bashrc" +starshiprc="$HOME/.config/starship.toml" +mocrc="$HOME/.moc/config" +mocth="$HOME/.moc/themes/" + +# Deploy directory +echo "Checking the deploy directory, creating if it's not created" +echo "Deleting the last deploy if it's there" +deploydir="$HOME/.deploy" +rm -rf "${deploydir:?}"/* +mkdir -p "$HOME/.deploy/" +mkdir -p "$HOME/.deploy/.config/" +mkdir -p "$HOME/.deploy/.moc/" +mkdir -p "$HOME/.deploy/.newsboat/" + +# Deploying +echo "Deploying the awesomewm config"; +cp -r "$dir1" "$deploydir/.config/"; +echo "Deploying the alacritty config"; +cp -r "$dir2" "$deploydir/.config/"; +echo "Deploying the picom config"; +cp -r "$dir3" "$deploydir/.config/"; +echo "Deploying the vifm config"; +cp -r "$dir4" "$deploydir/.config/"; +echo "Deploying the zsh config"; +cp "$zshrc" "$deploydir/"; +echo "Deploying the starship config"; +cp "$starshiprc" "$deploydir/.config/"; +echo "Deploying the bash config"; +cp "$bashrc" "$deploydir/"; +echo "Deploying the moc config"; +cp -r "$mocrc" "$deploydir/.moc/"; +echo "Deploying the moc themes"; +cp -r "$mocth" "$deploydir/.moc/"; +echo "Deploying the DOOM Emacs config"; +cp -r "$dir6" "$deploydir/.config/"; +echo "Deploying scripts"; +cp -r "$dir7" "$deploydir/.config/"; +echo "Deploying the newsboat config"; +cp "$newsboaturl" "$deploydir/.newsboat/"; +rm "$deploydir"/.config/vifm/vifminfo* diff --git a/.config/scripts/dmenu-wifi.sh b/.config/scripts/dmenu-wifi.sh index 22280d113..6eda5fe94 100755 --- a/.config/scripts/dmenu-wifi.sh +++ b/.config/scripts/dmenu-wifi.sh @@ -29,6 +29,7 @@ selectnet() { exit 0 fi } +selectnet # Typing password selectpass() { @@ -39,11 +40,11 @@ selectpass() { exit 0 fi } -selectnet selectpass # Main connection command -nmcli dev wifi connect "$query" password ""$passqry"" +nmcli device wifi connect "$query" password "$passqry" || nmcli device wifi connect "$query" + # Check notification notify-send "Checking if the connection was successful" diff --git a/.config/starship.toml b/.config/starship.toml index 14786af8e..562257a5c 100755 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -5,8 +5,6 @@ ## |____/|_| \_\_|\_\ ## -# ~/.config/starship.toml - # disable starship from forcing a new line to be taken. Solved the empty line # at start of terminal add_newline = false diff --git a/.moc/config b/.moc/config new file mode 100644 index 000000000..db5bf8df8 --- /dev/null +++ b/.moc/config @@ -0,0 +1,690 @@ +# This is a configuration file for the MOC player. It should be named +# 'config' and placed in the ~/.moc directory. As this file can specify +# commands which invoke other applications, MOC will refuse to start if it +# is not owned by either root or the current user, or if it is writable by +# anyone other than its owner. All options are given with their default +# values, and therefore commented. + +# Comments begin with '#'. +# You can use quotes and escape ('\') in parameters. +# +# You can have variable values substituted by enclosing the variable name +# as "${...}". (This only applies to the portion of the option following +# the '='.) Variables are substituted first from the environment then, +# if not found, from the configuration options. (Note that the value of +# a configuration option substituted is that which it has at the time the +# substitution variable is encountered.) If there is a naming conflict +# between an environment and configuration variable, you may be able to +# resolve it by using lowercase as the environment variable matches are +# case-sensitive whereas the configuration variables are not. +# +# You can also use the form "${...:-...}" where the value in the second +# position will be substituted if the variable name given in the first +# position is unset or null. +# +# So, for example: +# +# MusicDir = /music/${USER:-public} +# Fastdir1 = ${MusicDir}/mp3/rock +# Fastdir2 = ${MusicDir}/mp3/electronic +# Fastdir3 = ${MusicDir}/mp3/rap +# Fastdir4 = ${MusicDir}/mp3/etc +# +# Variable names are limited to those accepted by the BASH shell; that +# is, those comprising the upper- and lowercase ASCII characters, digits +# and the underscore. +# +# If you need to use the "${" sequence for any other purpose, write "$${" +# and it will be replaced by "${" and not treated as a substitution. +# +# Some options take lists of strings as their values. The strings are +# separated by colons. Additional strings can be appended to the list +# using "+=" in place of a plain "=" to assign the value. For an example, +# see the XTerms option. +# +# You can override any configuration option when you run MOC using the +# '-O' command line option: +# +# mocp -O AutoNext=no -O messagelingertime=1 -O XTerms+=xxt:xwt +# +# This command line option can be repeated as many times as needed and +# the configuration option name is not case sensitive. (Note that MOC +# does not perform variable substitution on the value of such overridden +# configuration options.) Most option values are set before the +# configuration file is processed (which allows the new values to be +# picked up by substitutions), however list-valued options are overridden +# afterwards (which gives the choice of whether the configured values are +# replaced or added to). + +# Remember that the client and server are separate processes and the +# server will retain the configuration values formed from the environment +# within which it was originally started. + +# Show file titles (title, author, album) instead of file names? +ReadTags = yes + +# In which directory do you store your music files? If you specify it +# you will be able to jump straight to this directory with the '-m' +# parameter or the 'm' command. This can also point to a playlist. +# +# Example: MusicDir = "/home/joe/music" +# +MusicDir = "~/Music" + +# Start in the music directory by default? If set to 'no', start +# in the current directory by default. A single directory on +# the command line takes precedence. +StartInMusicDir = yes + +# How to sort? FileName is the option's only value for now. +#Sort = FileName + +# Show errors in the streams (for example, broken frames in MP3 files)? +#ShowStreamErrors = no + +# Ignore CRC errors in MP3 files? Most players do that, so the default +# value is 'yes'. +#MP3IgnoreCRCErrors = yes + +# Set playback toggles. +#Repeat = no +#Shuffle = no +#AutoNext = yes + +# Default FormatString: +# +# %n - Track number +# %a - Artist +# %A - Album +# %t - Title +# %(X:TRUE:FALSE) - Ternary expression: if X exists, do TRUE, +# otherwise FALSE. The escape character must +# be doubled (i.e., '\\'). (See zshmisc +# documentation for more information.) +# +#FormatString = "%(n:%n :)%(a:%a - :)%(t:%t:)%(A: \(%A\):)" + +# Input and output buffer sizes (in kilobytes). +#InputBuffer = 512 # Minimum value is 32KB +#OutputBuffer = 512 # Minimum value is 128KB + +# How much to fill the input buffer before playing (in kilobytes)? +# This can't be greater than the value of InputBuffer. While this has +# a positive effect for network streams, it also causes the broadcast +# audio to be delayed. +#Prebuffering = 64 + +# Use this HTTP proxy server for internet streams. If not set, the +# environment variables http_proxy and ALL_PROXY will be used if present. +# +# Format: HTTPProxy = PROXY_NAME:PORT +# +#HTTPProxy = + +# Sound driver - OSS, ALSA, JACK, SNDIO (on OpenBSD) or null (only for +# debugging). You can enter more than one driver as a colon-separated +# list. The first working driver will be used. +#SoundDriver = JACK:ALSA:OSS + +# Jack output settings. +#JackClientName = "moc" +#JackStartServer = no +#JackOutLeft = "system:playback_1" +#JackOutRight = "system:playback_2" + +# OSS output settings. +#OSSDevice = /dev/dsp +#OSSMixerDevice = /dev/mixer +#OSSMixerChannel1 = pcm # 'pcm', 'master' or 'speaker' +#OSSMixerChannel2 = master # 'pcm', 'master' or 'speaker' + +# ALSA output settings. If you need to dump the audio produced by MOC +# to a file for diagnostic purposes, the following setting of 'ALSADevice' +# should do that: +# +# ALSADevice=tee:hw,'/tmp/out.wav',wav +# +#ALSADevice = default +#ALSAMixer1 = PCM +#ALSAMixer2 = Master + +# Under some circumstances on 32-bit systems, audio played continously +# for long periods of time may begin to stutter. Setting this option to +# 'yes' will force MOC to avoid ALSA's dmix resampling and prevent this +# stutter. But it also has other implications: +# +# - You may experience unacceptably high CPU load. +# - ALSA's resampler plug-ins will not be used. +# - The resampling may be of lower quality than ALSA would provide. +# - You may need to try different "ResampleMethod" option settings. +# - The "ForceSampleRate" option may be ineffective. +# - If libsamplerate is not configured, many audios may be unplayable. +# +#ALSAStutterDefeat = no + +# Save software mixer state? +# If enabled, a file 'softmixer' will be created in '~/.moc/' storing the +# mixersetting set when the server is shut down. +# Note that there is a "hidden" 'Amplification' setting in that file. +# Amplification (0-200) is used to scale the mixer setting (0-100). This +# results in a higher signal amplitude but may also produce clipping. +#Softmixer_SaveState = yes + +# Save equalizer state? +# If enabled, a file 'equalizer' will be created in '~/.moc/' storing the +# equalizer settings when the server is shut down. +# Note that there is a "hidden" 'Mixin' setting in that file. +# Mixin (0.0-1.0) is used to determine how much of the original signal is +# used after equalizing. 0 means to only use the equalized sound, while 1 +# effectively disabled the mixer. The default is 0.25. +#Equalizer_SaveState = yes + +# Show files with dot at the beginning? +ShowHiddenFiles = no + +# Hide file name extensions? +HideFileExtension = yes + +# Show file format in menu? +ShowFormat = yes + +# Show file time in menu? Possible values: 'yes', 'no' and 'IfAvailable' +# (meaning show the time only when it is already known, which often works +# faster). +ShowTime = yes + +# Show time played as a percentage in the time progress bar. +#ShowTimePercent = no + +# Values of the TERM environment variable which are deemed to be managed by +# screen(1). If you are setting a specific terminal using screen(1)'s +# '-T ' option, then you will need to add 'screen.' to this list. +# Note that this is only a partial test; the value of the WINDOW environment +# variable must also be a number (which screen(1) sets). +#ScreenTerms = screen:screen-w:vt100 + +# Values of the TERM environment variable which are deemed to be xterms. If +# you are using MOC within screen(1) under an xterm, then add screen(1)'s +# TERM setting here as well to cause MOC to update the xterm's title. +#XTerms = xterm +#XTerms += xterm-colour:xterm-color +#XTerms += xterm-256colour:xterm-256color +#XTerms += rxvt:rxvt-unicode +#XTerms += rxvt-unicode-256colour:rxvt-unicode-256color +#XTerms += eterm + +# Theme file to use. This can be absolute path or relative to +# /usr/share/moc/themes/ (depends on installation prefix) or +# ~/.moc/themes/ . +# +# Example: Theme = laras_theme +# +Theme = transparent-background + +# The theme used when running on an xterm. +# +# Example: XTermTheme = transparent-background +# +#XTermTheme = + +# Should MOC try to autoload the default lyrics file for an audio? (The +# default lyrics file is a text file with the same file name as the audio +# file name with any trailing "extension" removed.) +#AutoLoadLyrics = yes + +# MOC directory (where pid file, socket and state files are stored). +# You can use ~ at the beginning. +#MOCDir = ~/.moc + +# Use mmap() to read files. mmap() is much slower on NFS. +#UseMMap = no + +# Use MIME to identify audio files. This can make for slower loading +# of playlists but is more accurate than using "extensions". +#UseMimeMagic = no + +# Assume this encoding for ID3 version 1/1.1 tags (MP3 files). Unlike +# ID3v2, UTF-8 is not used here and MOC can't guess how tags are encoded. +# Another solution is using librcc (see the next option). This option is +# ignored if UseRCC is set to 'yes'. +#ID3v1TagsEncoding = WINDOWS-1250 + +# Use librcc to fix ID3 version 1/1.1 tags encoding. +#UseRCC = yes + +# Use librcc to filenames and directory names encoding. +#UseRCCForFilesystem = yes + +# When this option is set the player assumes that if the encoding of +# ID3v2 is set to ISO-8859-1 then the ID3v1TagsEncoding is actually +# that and applies appropriate conversion. +#EnforceTagsEncoding = no + +# Enable the conversion of filenames from the local encoding to UTF-8. +#FileNamesIconv = no + +# Enable the conversion of the xterm title from UTF-8 to the local encoding. +#NonUTFXterm = no + +# Should MOC precache files to assist gapless playback? +#Precache = yes + +# Remember the playlist after exit? +SavePlaylist = yes + +# When using more than one client (interface) at a time, do they share +# the playlist? +SyncPlaylist = yes + +# Choose a keymap file (relative to '~/.moc/' or using an absolute path). +# An annotated example keymap file is included ('keymap.example'). +# +# Example: Keymap = my_keymap +# +#Keymap = + +# Use ASCII rather than graphic characters for drawing lines. This +# helps on some terminals. +#ASCIILines = no + +# FastDirs, these allow you to jump directly to a directory, the key +# bindings are in the keymap file. +# +# Examples: Fastdir1 = /mp3/rock +# Fastdir2 = /mp3/electronic +# Fastdir3 = /mp3/rap +# Fastdir4 = /mp3/etc +# +#Fastdir1 = +#Fastdir2 = +#Fastdir3 = +#Fastdir4 = +#Fastdir5 = +#Fastdir6 = +#Fastdir7 = +#Fastdir8 = +#Fastdir9 = +#Fastdir10 = + +# How fast to seek (in number of seconds per keystroke). The first +# option is for normal seek and the second for silent seek. +#SeekTime = 1 +#SilentSeekTime = 5 + +# PreferredDecoders allows you to specify which decoder should be used +# for any given audio format. It is a colon-separated list in which +# each entry is of the general form 'code(decoders)', where 'code' +# identifies the audio format and 'decoders' is a comma-separated list +# of decoders in order of preference. +# +# The audio format identifier may be either a filename extension or a +# MIME media type. If the latter, the format is 'type/subtype' (e.g., +# 'audio/flac'). Because different systems may give different MIME +# media types, any 'x-' prefix of the subtype is ignored both here and +# in the actual file MIME type (so all combinations of 'audio/flac' and +# 'audio/x-flac' match each other). +# +# For Internet streams the matching is done on MIME media type and on +# actual content. For files the matches are made on MIME media type +# (if the 'UseMimeMagic' option is set) and on filename extension. The +# MIME media type of a file is not determined until the first entry for +# MIME is encountered in the list. +# +# The matching is done in the order of appearance in the list with any +# entries added from the command line being matched before those listed +# here. Therefore, if you place all filename extension entries before +# all MIME entries you will speed up MOC's processing of directories +# (which could be significant for remote file systems). +# +# The decoder list may be empty, in which case no decoders will be used +# for files (and files with that audio format ignored) while Internet +# streams will be assessed on the actual content. Any decoder position +# may contain an asterisk, in which case any decoder not otherwise listed +# which can handle the audio format will be used. It is not an error to +# list the same decoder twice, but neither does it make sense to do so. +# +# If you have a mix of audio and non-audio files in your directories, you +# may wish to include entries at top of the list which ignore non-audio +# files by extension. +# +# In summary, the PreferredDecoders option provides fine control over the +# type of matching which is performed (filename extension, MIME media +# type and streamed media content) and which decoder(s) (if any) are used +# based on the option's list entries and their ordering. +# +# Examples: aac(aac,ffmpeg) first try FAAD2 for AACs then FFmpeg +# mp3() ignore MP3 files +# wav(*,sndfile) use sndfile for WAV as a last resort +# ogg(vorbis,*):flac(flac,*) try Xiph decoders first +# ogg():audio/ogg() ignore OGG files, and +# force Internet selection by content +# gz():html() ignore some non-audio files +# +# Any unspecified audio formats default to trying all decoders. +# Any unknown (or misspelt) drivers are ignored. +# All names are case insensitive. +# The default setting reflects the historical situation modified by +# the experience of users. +# +#PreferredDecoders = aac(aac,ffmpeg):m4a(ffmpeg) +#PreferredDecoders += mpc(musepack,*,ffmpeg):mpc8(musepack,*,ffmpeg) +#PreferredDecoders += sid(sidplay2):mus(sidplay2) +#PreferredDecoders += wav(sndfile,*,ffmpeg) +#PreferredDecoders += wv(wavpack,*,ffmpeg) +#PreferredDecoders += audio/aac(aac):audio/aacp(aac):audio/m4a(ffmpeg) +#PreferredDecoders += audio/wav(sndfile,*) + +# The following PreferredDecoders attempt to handle the ambiguity surrounding +# container types such as OGG for files. The first two entries will force +# a local file to the correct decoder (assuming the .ogg file contains Vorbis +# audio), while the MIME media types will cause Internet audio streams to +# be assessed on content (which may be either Vorbis or Speex). +# +#PreferredDecoders += ogg(vorbis,ffmpeg):oga(vorbis,ffmpeg):ogv(ffmpeg) +#PreferredDecoders += opus(ffmpeg) +#PreferredDecoders += spx(speex) +#PreferredDecoders += application/ogg(vorbis):audio/ogg(vorbis) + +# Which resampling method to use. There are a few methods of resampling +# sound supported by libresamplerate. The default is 'Linear') which is +# also the fastest. A better description can be found at: +# +# http://www.mega-nerd.com/libsamplerate/api_misc.html#Converters +# +# but briefly, the following methods are based on bandlimited interpolation +# and are higher quality, but also slower: +# +# SincBestQuality - really slow (I know you probably have an xx GHz +# processor, but it's still not enough to not see +# this in the top output :) The worst case +# Signal-to-Noise Ratio is 97dB. +# SincMediumQuality - much faster. +# SincFastest - the fastest bandlimited interpolation. +# +# And these are lower quality, but much faster methods: +# +# ZeroOrderHold - really poor quality, but it's really fast. +# Linear - a bit better and a bit slower. +# +#ResampleMethod = Linear + +# Always use this sample rate (in Hz) when opening the audio device (and +# resample the sound if necessary). When set to 0 the device is opened +# with the file's rate. +#ForceSampleRate = 0 + +# By default, even if the sound card reports that it can output 24bit samples +# MOC converts 24bit PCM to 16bit. Setting this option to 'yes' allows MOC +# to use 24bit output. (The MP3 decoder, for example, uses this format.) +# This is disabled by default because there were reports that it prevents +# MP3 files from playing on some soundcards. +#Allow24bitOutput = no + +# Use realtime priority for output buffer thread. This will prevent gaps +# while playing even with heavy load. The user who runs MOC must have +# permissions to set such a priority. This could be dangerous, because it +# is possible that a bug in MOC will freeze your computer. +#UseRealtimePriority = no + +# The number of audio files for which MOC will cache tags. When this limit +# is reached, file tags are discarded on a least recently used basis (with +# one second resolution). You can disable the cache by giving it a size of +# zero. Note that if you decrease the cache size below the number of items +# currently in the cache, the number will not decrease immediately (if at +# all). +#TagsCacheSize = 256 + +# Number items in the playlist. +PlaylistNumbering = yes + +# Main window layouts can be configured. You can change the position and +# size of the menus (directory and playlist). You have three layouts and +# can switch between then using the 'l' key (standard mapping). By default, +# only two layouts are configured. +# +# The format is as follows: +# +# - Each layout is described as a list of menu entries. +# - Each menu entry is of the form: +# +# menu(position_x, position_y, width, height) +# +# where 'menu' is either 'directory' or 'playlist'. +# - The parameters define position and size of the menu. They can +# be absolute numbers (like 10) or a percentage of the screen size +# (like 45%). +# - 'width' and 'height' can have also value of 'FILL' which means +# fill the screen from the menu's position to the border. +# - Menus may overlap. +# +# You must describe at least one menu (default is to fill the whole window). +# There must be at least one layout (Layout1) defined; others can be empty. +# +# Example: Layout1 = playlist(50%,50%,50%,50%) +# Layout2 = "" +# Layout3 = "" +# +# Just one layout, the directory will occupy the whole +# screen, the playlist will have 1/4 of the screen size +# and be positioned at lower right corner. (Note that +# because the playlist will be hidden by the directory +# you will have to use the TAB key to make the playlist +# visible.) +# +# Example: Layout1 = playlist(0,0,100%,10):directory(0,10,100%,FILL) +# +# The screen is split into two parts: playlist at the top +# and the directory menu at the bottom. Playlist will +# occupy 10 lines and the directory menu the rest. +# +#Layout1 = directory(0,0,50%,100%):playlist(50%,0,FILL,100%) +#Layout2 = directory(0,0,100%,100%):playlist(0,0,100%,100%) +#Layout3 = "" + +# When the song changes, should the menu be scrolled so that the currently +# played file is visible? +#FollowPlayedFile = yes + +# What to do if the interface was started and the server is already playing +# something from the playlist? If CanStartInPlaylist is set to 'yes', the +# interface will switch to the playlist. When set to 'no' it will start +# from the last directory. +#CanStartInPlaylist = yes + +# Executing external commands (1 - 10) invoked with key commands (F1 - F10 +# by default). +# +# Some arguments are substituted before executing: +# +# %f - file path +# %i - title made from tags +# %S - start block mark (in seconds) +# %E - end block mark (in seconds) +# +# Data from tags can also be substituted: +# +# %t - title +# %a - album +# %r - artist +# %n - track +# %m - time of the file (in seconds) +# +# The parameters above apply to the currently selected file. If you change +# them to capital letters, they are taken from the file currently playing. +# +# Programs are run using execv(), not a shell, so you can't do things like +# redirecting the output to a file. The command string is split using blank +# characters as separators; the first element is the command to be executed +# and the rest are its parameters, so if you use "echo Playing: %I" we run +# program 'echo' (from $PATH) with 2 parameters: the string 'Playing:' and +# the title of the file currently playing. Even if the title contains +# spaces, it's still one parameter and it's safe if it contains `rm -rf /`. +# +# Examples: ExecCommand1 = "cp %f /mnt/usb_drive" +# ExecCommand2 = "/home/joe/now_playing %I" +# +#ExecCommand1 = +#ExecCommand2 = +#ExecCommand3 = +#ExecCommand4 = +#ExecCommand5 = +#ExecCommand6 = +#ExecCommand7 = +#ExecCommand8 = +#ExecCommand9 = +#ExecCommand10 = + +# Display the cursor in the line with the selected file. Some braille +# readers (the Handy Tech modular series ZMU 737, for example) use the +# cursor to focus and can make use of it to present the file line even +# when other fields are changing. +#UseCursorSelection = no + +# Set the terminal title when running under xterm. +#SetXtermTitle = yes + +# Set the terminal title when running under screen(1). If MOC can detect +# that it is running under screen(1), then it will set an appropriate +# title (see description of ScreenTerms above). However, if multiple +# levels of screen management are involved, detection might fail and this +# could cause a screen upset. In that situation you can use this option +# to force screen titles off. +#SetScreenTitle = yes + +# Display full paths instead of just file names in the playlist. +#PlaylistFullPaths = yes + +# The following setting describes how block markers are displayed in +# the play time progress bar. Its value is a string of exactly three +# characters. The first character is displayed in a position which +# corresponds to the time marked as the start of a block and the last +# character to the time marked as the end of the block. The middle +# character is displayed instead if both the start and the end of the block +# would fall in the same position (within the resolution of the interface). +# You can turn off the displaying of these block marker positions by using +# three space characters. +#BlockDecorators = "`\"'" + +# How long (in seconds) to leave a message displayed on the screen. +# Setting this to a high value allows you to scroll through the messages +# using the 'hide_message' key. Setting it to zero means you'll have to +# be quick to see any message at all. Any new messages will be queued up +# and displayed after the current message's linger time expires. +#MessageLingerTime = 3 + +# Does MOC display a prefix on delayed messages indicating +# the number of queued messages still to be displayed? +#PrefixQueuedMessages = yes + +# String to append to the queued message count if any +# error messages are still waiting to be displayed. +#ErrorMessagesQueued = "!" + +# Self-describing ModPlug options (with 'yes' or 'no' values). +#ModPlug_Oversampling = yes +#ModPlug_NoiseReduction = yes +#ModPlug_Reverb = no +#ModPlug_MegaBass = no +#ModPlug_Surround = no + +# ModPlug resampling mode. +# Valid values are: +# +# FIR - 8 tap fir filter (extremely high quality) +# SPLINE - Cubic spline interpolation (high quality) +# LINEAR - Linear interpolation (fast, good quality) +# NEAREST - No interpolation (very fast, extremely bad sound quality) +# +#ModPlug_ResamplingMode = FIR + +# Other self-describing ModPlug audio characteristic options. +# (Note that the 32 bit sample size seems to be buggy.) +#ModPlug_Channels = 2 # 1 or 2 channels +#ModPlug_Bits = 16 # 8, 16 or 32 bits +#ModPlug_Frequency = 44100 # 11025, 22050, 44100 or 48000 Hz +#ModPlug_ReverbDepth = 0 # 0 (quiet) to 100 (loud) +#ModPlug_ReverbDelay = 0 # Delay in ms (usually 40-200ms) +#ModPlug_BassAmount = 0 # 0 (quiet) to 100 (loud). +#ModPlug_BassRange = 10 # Cutoff in Hz (10-100). +#ModPlug_SurroundDepth = 0 # Surround level 0(quiet)-100(heavy). +#ModPlug_SurroundDelay = 0 # Surround delay in ms, usually 5-40ms. +#ModPlug_LoopCount = 0 # 0 (never), n (times) or -1 (forever) + +# Self-describing TiMidity audio characteristic options. +#TiMidity_Rate = 44100 # Between 8000 and 48000 +#TiMidity_Bits = 16 # 8 or 16 +#TiMidity_Channels = 2 # 1 or 2 +#TiMidity_Volume = 100 # 0 to 800 + +# You can setup a TiMidity-Config-File here. +# Leave it unset to use library defaults (/etc/timidity.cfg mostly). +# Setting it to 'yes' also uses the library defaults. +# Set it to 'no' if you don't have any configuration file. +# Otherwise set it to the name of a specific file. +#TiMidity_Config = + +# Self-describing SidPlay2 audio characteristic options. +#SidPlay2_DefaultSongLength = 180 # If not in database (in seconds) +#SidPlay2_MinimumSongLength = 0 # Play at least n (in seconds) +#SidPlay2_Frequency = 44100 # 4000 to 48000 +#SidPlay2_Bits = 16 # 8 or 16 +#SidPlay2_Optimisation = 0 # 0 (worst quality) to 2 (best quality) + +# Set path to a HVSC-compatible database (if not set, database is disabled). +#SidPlay2_Database = + +# SidPlay2 playback Mode: +# +# "M": Mono (best for many SIDs) +# "S": Stereo +# "L"/"R": Left / Right +# +#SidPlay2_PlayMode = "M" + +# Use start-song information from SID ('yes') or start at first song +# ('no'). Songs before the start-song won't be played. (Note that this +# option previously took the values 1 and 0; these are now deprecated +# in favour of 'yes' and 'no'.) +#SidPlay2_StartAtStart = yes + +# Play sub-tunes. (Note that this option previously took the values 1 +# and 0; these are now deprecated in favour of 'yes' and 'no'.) +#SidPlay2_PlaySubTunes = yes + +# Run the OnSongChange command when a new song starts playing. +# Specify the full path (i.e. no leading '~') of an executable to run. +# Arguments will be passed, and you can use the following escapes: +# +# %a artist +# %r album +# %f filename +# %t title +# %n track +# %d file duration in XX:YY form +# %D file duration, number of seconds +# +# No pipes/redirects can be used directly, but writing a shell script +# can do the job. +# +# Example: OnSongChange = "/home/jack/.moc/myscript %a %r" +# +#OnSongChange = + +# If RepeatSongChange is 'yes' then MOC will execute the command every time +# a song starts playing regardless of whether or not it is just repeating. +# Otherwise the command will only be executed when a different song is +# started. +#RepeatSongChange = no + +# Run the OnStop command (full path, no arguments) when MOC changes state +# to stopped (i.e., when user stopped playing or changes a song). +#OnStop = "/home/jack/.moc/myscript_on_stop" + +# This option determines which song to play after finishing all the songs +# in the queue. Setting this to 'yes' causes MOC to play the song which +# follows the song being played before queue playing started. If set to +# 'no', MOC will play the song following the last song in the queue if it +# is in the playlist. The default is 'yes' because this is the way other +# players usually behave. (Note that this option previously took the +# values 1 and 0; these are now deprecated in favour of 'yes' and 'no'.) +#QueueNextSongReturn = yes diff --git a/.moc/themes/black_theme b/.moc/themes/black_theme new file mode 100644 index 000000000..955ca38cb --- /dev/null +++ b/.moc/themes/black_theme @@ -0,0 +1,34 @@ +# Black theme by Arn + +background = white black +frame = white black +window_title = white black +directory = white black +selected_directory = white black reverse +playlist = white black +selected_playlist = white black reverse +file = white black +selected_file = white black reverse +marked_file = white black bold +marked_selected_file = white black bold,reverse +info = white black underline +status = white black +title = white black bold +state = white black +current_time = white black bold +time_left = white black bold +total_time = white black bold +time_total_frames = white black +sound_parameters = white black bold +legend = white black +disabled = white black +enabled = white black bold +empty_mixer_bar = white black +filled_mixer_bar = white black reverse +empty_time_bar = white black +filled_time_bar = white black reverse +entry = white black +entry_title = white black +error = white black bold,underline +message = white black +plist_time = white black diff --git a/.moc/themes/darkdot_theme b/.moc/themes/darkdot_theme new file mode 100644 index 000000000..8bbec1b4f --- /dev/null +++ b/.moc/themes/darkdot_theme @@ -0,0 +1,34 @@ +# Theme to match the 'darkdot' vim theme, by David Lazar (david_bv|at|yahoo|com) + +background = default default +frame = white default +window_title = white default +directory = blue default bold +selected_directory = black cyan +playlist = white default bold +selected_playlist = black cyan +file = white default +selected_file = black cyan +marked_file = white default bold +marked_selected_file = white cyan bold +info = white default +status = white default +title = white default bold +state = white default bold +current_time = white default bold +time_left = black default bold +total_time = white default +time_total_frames = white default +sound_parameters = white default bold +legend = white default +disabled = black default bold +enabled = white default bold +empty_mixer_bar = white default +filled_mixer_bar = black white +empty_time_bar = white default +filled_time_bar = black white +entry = white default +entry_title = white default +error = white red bold +message = white default +plist_time = white default diff --git a/.moc/themes/example_theme b/.moc/themes/example_theme new file mode 100644 index 000000000..44439d2c2 --- /dev/null +++ b/.moc/themes/example_theme @@ -0,0 +1,125 @@ +# Example color theme for MOC. +# You can use a theme by copying it to ~/.moc/themes directory and using +# Theme config option or -T command line option. +# +# Fill free to make your own themes and send me them. It will be included in +# official MOC releases or on the MOC web site. +# +# The format of this file is: +# Lines beginning with # are comments. +# Blank lines are ignored. +# Every other line is expected to be in format: +# +# ELEMENT = FOREGROUND_COLOR BACKGROUND_COLOR [ATTRIBUTE[,ATTRIBUTE,..]] +# +# or +# +# colordef COLOR = RED GREEN BLUE +# +# Where names are case insensitive. +# +# ELEMENT is an element of MOC interface. This can be: +# background - default background for regions when nothing is displayed +# frame - frames for windows +# window_title - the title of the window (eg name of the current +# directory) +# directory - a directory in the menu +# selected_directory - a directory that is selected using arrows +# playlist - playlist file +# selected_playlist - see selected directory +# file - an ordinary file in the menu (mp3, ogg, ...) +# selected_file - see selected directory +# marked_file - a file that is currently being played +# marked_selected_file - a file that is currently being played and is also +# selected using arrows +# info - information shown at the right side of files +# selected_info - see selected directory +# marked_info - a file (its time) that is currently being played +# marked_selected_info - a file (its time) that is currently being played +# and is also selected using arrows +# status - the status line with a message +# title - the title of the file that is currently being played +# state - the state: play, stop, or paused (>, [], ||) +# current_time - current time of playing +# time_left - the time left to the end of playing the current file +# total_time - the length of the currently played file +# time_total_frames - the brackets outside the total time of a file ([10:13]) +# sound_parameters - the frequency and bitrate numbers +# legend - "KHz" and "Kbps" +# disabled - disabled element ([STEREO]) +# enabled - enabled element +# empty_mixer_bar - "empty" part of the volume bar +# filled_mixer_bar - "filled" part of the volume bar +# empty_time_bar - "empty" part of the time bar +# filled_time_bar - "filled" part of the time bar +# entry - place wher user can type a search query or a file name +# entry_title - the title of an entry +# error - error message +# message - information message +# plist_time - total time of displayed items +# +# FOREGOUND_COLOR and BACKGROUND_COLOR can have one of the following values: +# black, red, green, yellow, blue, magenta, cyan, white, default (can be +# transparent), grey (not standard, but works) +# +# Optional ATTRIBUTE parameters can be (from ncurses manual): +# normal - default (no highlight) +# standout - best highlighting mode of the terminal +# underline - underlining +# reverse - reverse video +# blink - blinking +# dim - half bright +# bold - extra bright or bold +# protect - protected mode +# +# You can specify a list of attributes separated by commas: attr1,attr2,attr3. +# Don't use spaces anywhere in such a list. +# +# With colordef you can change the definition of a color. It works only if +# your terminal supports it, if not those lines will be silently ignored. +# COLOR must be a valid color name and the RED GREEN and BLUE are numbers +# from 0 to 1000. Example: +# +# colordef red = 1000 0 0 +# +# HINT: you have only 8 colors, but combined with attributes bold and/or +# reversed you actually get more colors. +# +# If you don't specify some elements, the default values will be used. +# +# Here follows the default configuration: +background = white blue +frame = white blue +window_title = white blue +directory = white blue bold +selected_directory = white black bold +playlist = white blue bold +selected_playlist = white black bold +file = white blue +selected_file = white black +marked_file = green blue bold +marked_selected_file = green black bold +info = blue blue bold +selected_info = blue black bold +marked_info = blue blue bold +marked_selected_info = blue black bold +status = white blue +title = white blue bold +state = white blue bold +current_time = white blue bold +time_left = white blue bold +total_time = white blue bold +time_total_frames = white blue +sound_parameters = white blue bold +legend = white blue +disabled = blue blue bold +enabled = white blue bold +empty_mixer_bar = white blue +filled_mixer_bar = black cyan +empty_time_bar = white blue +filled_time_bar = black cyan +entry = white blue +entry_title = black cyan +error = red blue bold +message = green blue bold +plist_time = white blue diff --git a/.moc/themes/green_theme b/.moc/themes/green_theme new file mode 100644 index 000000000..4df566758 --- /dev/null +++ b/.moc/themes/green_theme @@ -0,0 +1,35 @@ +# green theme by Jacek Lehmann +# best viewed on shaded or black terminal + +background = default default +frame = black default +window_title = green default +directory = red default +selected_directory = yellow default +playlist = blue default +selected_playlist = magenta default +file = green default +selected_file = cyan default +marked_file = green default bold +marked_selected_file = cyan default bold +info = cyan default +status = magenta default +title = green default +state = magenta default +current_time = magenta default +time_left = cyan default +total_time = cyan default +time_total_frames = magenta default +sound_parameters = cyan default +legend = magenta default +disabled = black default +enabled = yellow default +empty_mixer_bar = green default +filled_mixer_bar = black green +empty_time_bar = green default +filled_time_bar = black green +entry = yellow default +entry_title = red default +error = red default +message = yellow default +plist_time = magenta default diff --git a/.moc/themes/moca_theme b/.moc/themes/moca_theme new file mode 100644 index 000000000..58c2aa056 --- /dev/null +++ b/.moc/themes/moca_theme @@ -0,0 +1,36 @@ +# +# Theme: moca +# Author: Nicola Vitale +# +background = white black +frame = white black +window_title = yellow black bold +directory = white black +selected_directory = white black bold +playlist = white black +selected_playlist = cyan black bold +file = white black +selected_file = yellow red bold +marked_file = cyan black blink,bold +marked_selected_file = cyan red blink,bold +info = magenta black bold +status = yellow black bold +title = cyan black bold +state = red black bold +current_time = green black bold +time_left = magenta black bold +total_time = red black bold +time_total_frames = red black bold +sound_parameters = white black bold +legend = white black +disabled = white black bold +enabled = blue black bold +empty_mixer_bar = cyan blue +filled_mixer_bar = blue cyan +empty_time_bar = green magenta +filled_time_bar = magenta green +entry = white black +entry_title = magenta black bold +error = red black bold +message = green black bold +plist_time = red black bold diff --git a/.moc/themes/nightly_theme b/.moc/themes/nightly_theme new file mode 100644 index 000000000..b9ff37b4a --- /dev/null +++ b/.moc/themes/nightly_theme @@ -0,0 +1,34 @@ +# Author: Wim Speekenbrink + +background = blue black +frame = blue black bold +window_title = blue black bold +directory = blue black bold +selected_directory = black magenta +playlist = blue black bold +selected_playlist = black magenta +file = blue black bold +selected_file = black magenta +marked_file = green black bold +marked_selected_file = green magenta bold +info = green black bold +status = blue black bold +title = green black bold +state = blue black bold +current_time = magenta black bold +time_left = magenta black bold +total_time = magenta black bold +time_total_frames = blue black bold +sound_parameters = magenta black bold +legend = blue black bold +disabled = black black +enabled = blue black bold +empty_mixer_bar = blue black bold +filled_mixer_bar = black magenta +empty_time_bar = blue black bold +filled_time_bar = black magenta +entry = green black bold +entry_title = green black bold +error = red black bold +message = green black bold +plist_time = green black bold diff --git a/.moc/themes/red_theme b/.moc/themes/red_theme new file mode 100644 index 000000000..fe6297ce1 --- /dev/null +++ b/.moc/themes/red_theme @@ -0,0 +1,36 @@ +# rednblack theme by yyz +# works good on a light term + +#property fg bg fx +background = default default +frame = black default +window_title = black default +directory = red default +selected_directory = black default bold +playlist = blue default +selected_playlist = black default bold +file = red default +selected_file = black default bold +marked_file = red default underline +marked_selected_file = black default bold +info = red default +status = black default +title = red default +state = black default +current_time = black default +time_left = black default +total_time = black default +time_total_frames = black default +sound_parameters = black default +legend = black default +disabled = white default +enabled = black default +empty_mixer_bar = black default +filled_mixer_bar = black red +empty_time_bar = black default +filled_time_bar = black red +entry = black default +entry_title = red default +error = red default +message = black default +plist_time = black default diff --git a/.moc/themes/transparent-background b/.moc/themes/transparent-background new file mode 100644 index 000000000..a73ffa5be --- /dev/null +++ b/.moc/themes/transparent-background @@ -0,0 +1,34 @@ +# Transparent background theme by Marcin Michałowski + +background = default default +frame = white default +window_title = white default +directory = white default bold +selected_directory = white blue bold +playlist = white default bold +selected_playlist = white blue bold +file = white default +selected_file = white blue +marked_file = green default bold +marked_selected_file = green blue bold +info = blue default bold +status = white default +title = white default bold +state = white default bold +current_time = white default bold +time_left = white default bold +total_time = white default bold +time_total_frames = white default +sound_parameters = white default bold +legend = white default +disabled = blue default bold +enabled = white default bold +empty_mixer_bar = white default +filled_mixer_bar = black cyan +empty_time_bar = white default +filled_time_bar = black cyan +entry = white default +entry_title = black cyan +error = red default bold +message = green default bold +plist_time = white default bold diff --git a/.moc/themes/yellow_red_theme b/.moc/themes/yellow_red_theme new file mode 100644 index 000000000..8a1bb71f1 --- /dev/null +++ b/.moc/themes/yellow_red_theme @@ -0,0 +1,35 @@ +# Yellow/Red theme - mostly Yellow. By Morten Grunnet Buhl +# Doesn't work on terminals when underline is not supported (like Linux console) + +background = red default +frame = red default +window_title = yellow default underline,dim +directory = yellow default +selected_directory = yellow default underline +playlist = yellow default +selected_playlist = yellow default +file = yellow default +selected_file = yellow default underline +marked_file = yellow default bold +marked_selected_file = red default bold,underline +info = yellow default +status = yellow default +title = yellow default +state = yellow default +current_time = yellow default +time_left = yellow default +total_time = yellow default +time_total_frames = yellow default +sound_parameters = yellow default +legend = yellow default +disabled = red default dim +enabled = yellow default bold +empty_mixer_bar = yellow red +filled_mixer_bar = red yellow +empty_time_bar = yellow default +filled_time_bar = default yellow +entry = yellow default +entry_title = yellow default bold +error = cyan default +message = yellow default +plist_time = yellow default diff --git a/.newsboat/urls b/.newsboat/urls new file mode 100644 index 000000000..1cafb1031 --- /dev/null +++ b/.newsboat/urls @@ -0,0 +1,11 @@ +https://archlinux.org/feeds/news/ "Reading" +https://www.linux.com/feed/ "Reading" +https://linuxhandbook.com/rss/ "Reading" +https://www.gamingonlinux.com/article_rss.php "Reading" +https://www.omgubuntu.co.uk/feed "Reading" +https://askubuntu.com/feeds "Reading" +https://itsubuntu.com/feed/ "Reading" +https://www.tecmint.com/feed/ "Reading" +https://www.linuxfoundation.org/feed/ "Reading" +https://linuxhint.com/feed/ "Reading" +https://techhut.tv/rss/ "Reading" diff --git a/.zshrc b/.zshrc new file mode 100644 index 000000000..565cb3cae --- /dev/null +++ b/.zshrc @@ -0,0 +1,246 @@ +## ____ ____ _ __ +## | _ \| _ \| |/ / +## | | | | |_) | ' / Clay Gomera (Drake) +## | |_| | _ <| . \ My custom zshrc +## |____/|_| \_\_|\_\ +## + +### EXPORT +export TERM="xterm-256color" # getting proper colors +export HISTORY_IGNORE="(ls|cd|pwd|exit|sudo reboot|history|cd -|cd ..)" +export EDITOR="emacsclient -t -a ''" # $EDITOR use Emacs in terminal +export VISUAL="emacsclient -c -a emacs" # $VISUAL use Emacs in GUI mode + +### SET MANPAGER +### "bat" as manpager +export MANPAGER="sh -c 'col -bx | bat -l man -p'" + +### SET VI MODE ### +# Comment this line out to enable default emacs-like bindings +bindkey -v + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +### PATH +if [ -d "$HOME/.bin" ] ; + then PATH="$HOME/.bin:$PATH" +fi + +if [ -d "$HOME/.local/bin" ] ; + then PATH="$HOME/.local/bin:$PATH" +fi + +if [ -d "$HOME/Applications" ] ; + then PATH="$HOME/Applications:$PATH" +fi + +### CHANGE TITLE OF TERMINALS +case ${TERM} in + xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|alacritty|st|konsole*) + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"' + ;; + screen*) + PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"' + ;; +esac + +### Function extract for common file formats ### +SAVEIFS=$IFS +IFS=$(echo -en "\n\b") + +function extract { + if [ -z "$1" ]; then + # display usage if no parameters given + echo "Usage: extract ." + echo " extract [path/file_name_2.ext] [path/file_name_3.ext]" + else + for n in "$@" + do + if [ -f "$n" ] ; then + case "${n%,}" in + *.cbt|*.tar.bz2|*.tar.gz|*.tar.xz|*.tbz2|*.tgz|*.txz|*.tar) + tar xvf "$n" ;; + *.lzma) unlzma ./"$n" ;; + *.bz2) bunzip2 ./"$n" ;; + *.cbr|*.rar) unrar x -ad ./"$n" ;; + *.gz) gunzip ./"$n" ;; + *.cbz|*.epub|*.zip) unzip ./"$n" ;; + *.z) uncompress ./"$n" ;; + *.7z|*.arj|*.cab|*.cb7|*.chm|*.deb|*.dmg|*.iso|*.lzh|*.msi|*.pkg|*.rpm|*.udf|*.wim|*.xar) + 7z x ./"$n" ;; + *.xz) unxz ./"$n" ;; + *.exe) cabextract ./"$n" ;; + *.cpio) cpio -id < ./"$n" ;; + *.cba|*.ace) unace x ./"$n" ;; + *) + echo "extract: '$n' - unknown archive method" + return 1 + ;; + esac + else + echo "'$n' - file does not exist" + return 1 + fi + done +fi +} + +IFS=$SAVEIFS + +### ALIASES ### + +# navigation +up () { + local d="" + local limit="$1" + + # Default to limit of 1 + if [ -z "$limit" ] || [ "$limit" -le 0 ]; then + limit=1 + fi + + for ((i=1;i<=limit;i++)); do + d="../$d" + done + + # perform cd. Show error if cd fails + if ! cd "$d"; then + echo "Couldn't go up $limit dirs."; + fi +} +alias ..='cd ..' +alias .2='cd ../..' +alias .3='cd ../../..' +alias .4='cd ../../../..' +alias .5='cd ../../../../..' + +# bat as cat +alias cat='bat' + +# editors +alias vim='nvim' +alias em='/usr/bin/emacs -nw' +alias emacs='emacsclient -c -a emacs' +alias doomsync='~/.emacs.d/bin/doom sync' +alias doomdoctor='~/.emacs.d/bin/doom doctor' +alias doomupgrade='~/.emacs.d/bin/doom upgrade' +alias doompurge='~/.emacs.d/bin/doom purge' +alias doominstall='~/.emacs.d/bin/doom install' + +# Changing "ls" to "exa" +alias ls='exa -al --color=always --group-directories-first' # my preferred listing +alias la='exa -a --color=always --group-directories-first' # all files and dirs +alias ll='exa -l --color=always --group-directories-first' # long format +alias lt='exa -aT --color=always --group-directories-first' # tree listing +alias l.='exa -a | egrep "^\."' + +# xbps +alias xb-up='sudo xbps-install -Su && xcheckrestart' # update the whole system +alias xb-get='sudo xbps-install -S' # install a program +alias xb-qry='sudo xbps-query' # query details about a program +alias xb-rmv='sudo xbps-remove -R' # remove a package with all its dependencies (it may brake something) +alias xb-rmv-sec='sudo xbps-remove' # remove a package with all its dependencies (secure way) +alias xb-cln='sudo xbps-remove -o && sudo xbps-remove -O' # remove unnecesary packages and clean cache + +# Colorize grep output (good for log files) +alias grep='grep --color=auto' +alias egrep='egrep --color=auto' +alias fgrep='fgrep --color=auto' + +# confirm before overwriting something +alias rm='rm -i' +alias mv='mv -i' +alias cp='cp -i' + +# git +alias addup='git add -u' +alias addall='git add .' +alias branch='git branch' +alias checkout='git checkout' +alias clone='git clone' +alias commit='git commit -m' +alias fetch='git fetch' +alias pull='git pull origin' +alias push='git push origin' +alias stat='git status' # 'status' is protected name so using 'stat' instead +alias tag='git tag' +alias newtag='git tag -a' + +# adding flags +alias df='df -h' # human-readable sizes +alias free='free -m' # show sizes in MB + +# ani-cli +alias ani='ani-cli' +alias ani-q='ani-cli -q' # to select video quality + +# ytfzf +alias yt='ytfzf -f -t' + +# notflix +alias nt='notflix' + +# mount and unmount drives +alias mnt='sudo mount' +alias umnt='sudo umount' + +# mixers +alias mx='pulsemixer' +alias amx='alsamixer' + +# music player +alias mk='mocp' + +# power management +alias po='loginctl poweroff' +alias sp='loginctl suspend' +alias rb='loginctl reboot' + +# file manager +alias fm='./.config/vifm/scripts/vifmrun' +alias vifm='./.config/vifm/scripts/vifmrun' + +# system monitor +alias tp='btop' +alias top='btop' +alias htop='btop' + +# ps +alias psa="ps auxf" +alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e" +alias psmem='ps auxf | sort -nr -k 4' +alias pscpu='ps auxf | sort -nr -k 3' + +# get error messages from journalctl +alias jctl="journalctl -p 3 -xb" + +# youtube-dl +alias yta-aac="youtube-dl --extract-audio --audio-format aac " +alias yta-best="youtube-dl --extract-audio --audio-format best " +alias yta-flac="youtube-dl --extract-audio --audio-format flac " +alias yta-m4a="youtube-dl --extract-audio --audio-format m4a " +alias yta-mp3="youtube-dl --extract-audio --audio-format mp3 " +alias yta-opus="youtube-dl --extract-audio --audio-format opus " +alias yta-vorbis="youtube-dl --extract-audio --audio-format vorbis " +alias yta-wav="youtube-dl --extract-audio --audio-format wav " +alias ytv-best="youtube-dl -f bestvideo+bestaudio " + +# Network Manager and bluetooth +alias netstats='nmcli dev' +alias wfi='nmtui-connect' +alias wfi-scan='nmcli dev wifi list' +alias wfi-edit='nmtui-edit' +alias wfi-on='nmcli radio wifi on' +alias wfi-off='nmcli radio wifi off' +alias blt='bluetoothctl' + +# the terminal rickroll +alias rr='curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash' + +# Deploy script +alias deploynow='sh $HOME/.config/scripts/deploy.sh' + +### SETTING THE STARSHIP PROMPT ### +eval "$(starship init zsh)" +