moved to personal fennel config for awesome and added qutebrowser
This commit is contained in:
parent
403cb92b7d
commit
688748f8a6
502 changed files with 8576 additions and 9597 deletions
35
awes2/binaries/profile-image
Executable file
35
awes2/binaries/profile-image
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Depends: Mugshot
|
||||
# Written by manilarome
|
||||
|
||||
awesome_dir="${HOME}/.config/awesome/"
|
||||
user_profile_dir="${awesome_dir}/configuration/user-profile/"
|
||||
|
||||
accountsservice_user_icons="/var/lib/AccountsService/icons/${USER}"
|
||||
|
||||
# Check if user image exists
|
||||
if [ -f "${user_profile_dir}${USER}.png" ];
|
||||
then
|
||||
if [ -f "${accountsservice_user_icons}" ];
|
||||
then
|
||||
if ! cmp --silent "${user_profile_dir}${USER}.png" "${accountsservice_user_icons}";
|
||||
then
|
||||
cp "${accountsservice_user_icons}" "${user_profile_dir}${USER}.png"
|
||||
fi
|
||||
printf "${user_profile_dir}${USER}.png"
|
||||
else
|
||||
printf "${user_profile_dir}${USER}.png"
|
||||
fi
|
||||
exit;
|
||||
else
|
||||
if [ -f "${accountsservice_user_icons}" ];
|
||||
then
|
||||
cp "${accountsservice_user_icons}" "${user_profile_dir}${USER}.png"
|
||||
printf "${user_profile_dir}${USER}.png"
|
||||
exit;
|
||||
else
|
||||
printf "default"
|
||||
exit;
|
||||
fi
|
||||
fi
|
120
awes2/binaries/snap
Executable file
120
awes2/binaries/snap
Executable file
|
@ -0,0 +1,120 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# --- Simple screenshot script using maim and AwesomeWM API
|
||||
# --
|
||||
# -- Accepts `area` and `full` string args
|
||||
# --
|
||||
# -- For more details check `man maim`
|
||||
# --
|
||||
# -- @author manilarome <gerome.matilla07@gmail.com>
|
||||
# -- @copyright 2020 manilarome
|
||||
# -- @script snap
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
screenshot_dir=$(xdg-user-dir PICTURES)/Screenshots/
|
||||
|
||||
# Check save directory
|
||||
# Create it if it doesn't exist
|
||||
function check_dir() {
|
||||
if [ ! -d "$screenshot_dir" ];
|
||||
then
|
||||
mkdir -p "$screenshot_dir"
|
||||
fi
|
||||
}
|
||||
|
||||
# Main function
|
||||
function shot() {
|
||||
|
||||
check_dir
|
||||
|
||||
file_loc="${screenshot_dir}$(date +%Y%m%d_%H%M%S).png"
|
||||
|
||||
maim_command="$1"
|
||||
notif_message="$2"
|
||||
|
||||
# Execute maim command
|
||||
${maim_command} "${file_loc}"
|
||||
|
||||
# Exit if the user cancels the screenshot
|
||||
# So it means there's no new screenshot image file
|
||||
if [ ! -f "${file_loc}" ];
|
||||
then
|
||||
exit;
|
||||
fi
|
||||
|
||||
# Copy to clipboard
|
||||
xclip -selection clipboard -t image/png -i "${screenshot_dir}"/`ls -1 -t "${screenshot_dir}" | head -1` &
|
||||
|
||||
awesome-client "
|
||||
|
||||
-- IMPORTANT NOTE: THIS PART OF THE SCRIPT IS LUA!
|
||||
naughty = require('naughty')
|
||||
awful = require('awful')
|
||||
beautiful = require('beautiful')
|
||||
dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
local open_image = naughty.action {
|
||||
name = 'Open',
|
||||
icon_only = false,
|
||||
}
|
||||
|
||||
local open_folder = naughty.action {
|
||||
name = 'Open Folder',
|
||||
icon_only = false,
|
||||
}
|
||||
|
||||
local delete_image = naughty.action {
|
||||
name = 'Delete',
|
||||
icon_only = false,
|
||||
}
|
||||
|
||||
-- Execute the callback when 'Open' is pressed
|
||||
open_image:connect_signal('invoked', function()
|
||||
awful.spawn('xdg-open ' .. '${file_loc}', false)
|
||||
end)
|
||||
|
||||
open_folder:connect_signal('invoked', function()
|
||||
awful.spawn('xdg-open ' .. '${screenshot_dir}', false)
|
||||
end)
|
||||
|
||||
-- Execute the callback when 'Delete' is pressed
|
||||
delete_image:connect_signal('invoked', function()
|
||||
awful.spawn('gio trash ' .. '${file_loc}', false)
|
||||
end)
|
||||
|
||||
-- Show notification
|
||||
naughty.notification ({
|
||||
app_name = 'Screenshot Tool',
|
||||
icon = '${file_loc}',
|
||||
timeout = 10,
|
||||
title = '<b>Snap!</b>',
|
||||
message = '${notif_message}',
|
||||
actions = { open_image, open_folder, delete_image }
|
||||
})
|
||||
"
|
||||
|
||||
}
|
||||
|
||||
# Check the args passed
|
||||
if [ -z "$1" ] || ([ "$1" != 'full' ] && [ "$1" != 'area' ]);
|
||||
then
|
||||
echo "
|
||||
Requires an argument:
|
||||
area - Area screenshot
|
||||
full - Fullscreen screenshot
|
||||
|
||||
Example:
|
||||
./snap area
|
||||
./snap full
|
||||
"
|
||||
elif [ "$1" = 'full' ];
|
||||
then
|
||||
msg="Full screenshot saved and copied to clipboard!"
|
||||
shot 'maim -u -m 1' "${msg}"
|
||||
elif [ "$1" = 'area' ];
|
||||
then
|
||||
msg='Area screenshot saved and copied to clipboard!'
|
||||
shot 'maim -u -s -n -m 1' "${msg}"
|
||||
fi
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue