Dotfiles config update (2023-01-04)
This commit is contained in:
parent
c3537d7b28
commit
4f154bb78a
|
@ -31,7 +31,7 @@ echo '<b><span foreground="#379838" face="UbuntuMono Nerd Font" size="12650">
|
|||
echo '<b><span foreground="#379838" face="UbuntuMono Nerd Font" size="12650"> </span></b><b><span foreground="#e25ee6" face="UbuntuMono Nerd Font" size="12650"> Super + p </span></b><b><span foreground="#9ca8ce" face="UbuntuMono Nerd Font" size="12650">= Wofi (Run Mode)</span></b>'
|
||||
echo '<b><span foreground="#379838" face="UbuntuMono Nerd Font" size="12650"> </span></b><b><span foreground="#e25ee6" face="UbuntuMono Nerd Font" size="12650"> Super + o </span></b><b><span foreground="#9ca8ce" face="UbuntuMono Nerd Font" size="12650">= Wofi (Drun Mode)</span></b>'
|
||||
echo '<b><span foreground="#379838" face="UbuntuMono Nerd Font" size="12650"> </span></b><b><span foreground="#e25ee6" face="UbuntuMono Nerd Font" size="12650"> Super + q </span></b><b><span foreground="#9ca8ce" face="UbuntuMono Nerd Font" size="12650">= Rofi (Window Mode)</span></b>'
|
||||
echo '<b><span foreground="#379838" face="UbuntuMono Nerd Font" size="12650"> </span></b><b><span foreground="#e25ee6" face="UbuntuMono Nerd Font" size="12650"> Super + d </span></b><b><span foreground="#9ca8ce" face="UbuntuMono Nerd Font" size="12650">= Dmenu</span></b>'
|
||||
echo '<b><span foreground="#379838" face="UbuntuMono Nerd Font" size="12650"> </span></b><b><span foreground="#e25ee6" face="UbuntuMono Nerd Font" size="12650"> Super + d </span></b><b><span foreground="#9ca8ce" face="UbuntuMono Nerd Font" size="12650">= Wofi (Filebrowser)</span></b>'
|
||||
echo '<b><span foreground="#379838" face="UbuntuMono Nerd Font" size="12650"> </span></b><b><span foreground="#e25ee6" face="UbuntuMono Nerd Font" size="12650"> Super + b </span></b><b><span foreground="#9ca8ce" face="UbuntuMono Nerd Font" size="12650">= Mozilla Firefox</span></b>'
|
||||
echo '<b><span foreground="#379838" face="UbuntuMono Nerd Font" size="12650"> </span></b><b><span foreground="#e25ee6" face="UbuntuMono Nerd Font" size="12650"> Super + n </span></b><b><span foreground="#9ca8ce" face="UbuntuMono Nerd Font" size="12650">= PCManFM</span></b>'
|
||||
echo '<b><span foreground="#379838" face="UbuntuMono Nerd Font" size="12650"> </span></b><b><span foreground="#e25ee6" face="UbuntuMono Nerd Font" size="12650"> Super + t </span></b><b><span foreground="#9ca8ce" face="UbuntuMono Nerd Font" size="12650">= Wl-Screenshooter</span></b>'
|
||||
|
|
|
@ -73,25 +73,20 @@ bindsym $mod+Return exec kitty
|
|||
# kill focused window
|
||||
bindsym $mod+Shift+q kill
|
||||
|
||||
# start dmenu (a program launcher)
|
||||
bindsym $mod+d exec --no-startup-id dmenu_run
|
||||
# A more modern dmenu replacement is rofi:
|
||||
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
|
||||
# There also is i3-dmenu-desktop which only displays applications shipping a
|
||||
# .desktop file. It is a wrapper around dmenu, so you need that installed.
|
||||
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
|
||||
# start filebrowser (a program launcher)
|
||||
bindsym $mod+d exec --no-startup-id ~/.config/sway/wofi/wofi_fbrun
|
||||
|
||||
# NetworkManager
|
||||
#bindsym $mod+c exec --no-startup-id connman-gtk --no-icon
|
||||
bindsym $mod+c exec --no-startup-id nm-connection-editor
|
||||
|
||||
# Run applications
|
||||
bindsym $mod+o exec --no-startup-id wofi --show drun
|
||||
bindsym $mod+q exec --no-startup-id rofi -show window
|
||||
bindsym $mod+o exec --no-startup-id ~/.config/sway/wofi/wofi_drun
|
||||
bindsym $mod+q exec --no-startup-id ~/.config/sway/wofi/wofi_wrun
|
||||
bindsym $mod+x exec --no-startup-id wdisplays
|
||||
bindsym $mod+b exec --no-startup-id firefox
|
||||
bindsym $mod+n exec --no-startup-id pcmanfm
|
||||
bindsym $mod+p exec --no-startup-id wofi --show run
|
||||
bindsym $mod+p exec --no-startup-id ~/.config/sway/wofi/wofi_run
|
||||
bindsym $mod+g exec --no-startup-id geany
|
||||
bindsym $mod+m exec --no-startup-id telegram
|
||||
bindsym $mod+z exec --no-startup-id kitty -e wf-recorder
|
||||
|
@ -175,8 +170,8 @@ bindsym $mod+a focus parent
|
|||
#bindsym $mod+d focus child
|
||||
|
||||
# sway gaps config
|
||||
gaps inner 3
|
||||
gaps outer 2
|
||||
gaps inner 2
|
||||
gaps outer 1
|
||||
|
||||
# Disable borders
|
||||
#default_border none
|
||||
|
@ -313,7 +308,7 @@ exec_always {
|
|||
bar {
|
||||
position top
|
||||
status_command ~/.config/sway/scripts/status_bar.sh
|
||||
swaybar_command waybar
|
||||
#swaybar_command waybar
|
||||
workspace_buttons yes
|
||||
#tray_output DP-0
|
||||
colors {
|
||||
|
|
98
.config/sway/wofi/wofi_drun
Executable file
98
.config/sway/wofi/wofi_drun
Executable file
|
@ -0,0 +1,98 @@
|
|||
#!/bin/bash
|
||||
|
||||
##################################################################
|
||||
# wofi_drun - wofi-dmenu script that simulates 'rofi -show drun' #
|
||||
# #
|
||||
# Author: q3aql <q3aql@duck.com> #
|
||||
# Last update: 04-01-2023 #
|
||||
##################################################################
|
||||
|
||||
# Configuration variables
|
||||
load_theme_path="${HOME}/.wofi"
|
||||
load_desktop_files="${HOME}/.wofi/desktop"
|
||||
desktop_files="/usr/share/applications"
|
||||
desktop_files_home="${HOME}/.local/share/applications"
|
||||
|
||||
function generate_spaces() {
|
||||
num_spaces=${1}
|
||||
count_spaces=1
|
||||
while [ ${count_spaces} -le ${num_spaces} ] ; do
|
||||
echo -n " "
|
||||
count_spaces=$(expr ${count_spaces} + 1)
|
||||
done
|
||||
}
|
||||
|
||||
function list_desktop_files() {
|
||||
if [ -d "${desktop_files}" ] ; then
|
||||
ls -1 "${desktop_files}/" | grep ".desktop"
|
||||
fi
|
||||
if [ -d "${desktop_files_home}" ] ; then
|
||||
ls -1 "${desktop_files_home}/" | grep ".desktop"
|
||||
fi
|
||||
}
|
||||
|
||||
function list_desktop_icons() {
|
||||
echo " Scan New Desktop Files"
|
||||
ls -1 "${load_desktop_files}/" | while read current_desktop ; do
|
||||
echo " ${current_desktop}"
|
||||
done
|
||||
generate_spaces 75
|
||||
}
|
||||
|
||||
rundesk () {
|
||||
if [ -z ${1} ] ; then
|
||||
echo "No file entry"
|
||||
else
|
||||
if [ -f "${1}" ] ; then
|
||||
eval "$(awk -F= '$1=="Exec"{$1=""; print}' "$1" | head -1)"
|
||||
else
|
||||
echo "File does not exist"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function create_list_files() {
|
||||
mkdir -p ${load_desktop_files}
|
||||
if [ ! -f ${HOME}/.dmenu/read_list ] ; then
|
||||
echo "0" > ${HOME}/.dmenu/read_list
|
||||
fi
|
||||
exec_list=$(cat ${HOME}/.dmenu/read_list)
|
||||
if [ ${exec_list} -eq 0 ] ; then
|
||||
rm -rf ${load_desktop_files}/*
|
||||
list_desktop_files | while read current_file ; do
|
||||
if [ -f "${desktop_files}/${current_file}" ] ; then
|
||||
name_show=$(cat "${desktop_files}/${current_file}" | grep "Name=" | head -1 | cut -d "=" -f 2 | sed 's/\//|/g')
|
||||
if [ ! -z "${name_show}" ] ; then
|
||||
echo "${desktop_files}/${current_file}" > "${load_desktop_files}/${name_show}"
|
||||
fi
|
||||
fi
|
||||
if [ -f "${desktop_files_home}/${current_file}" ] ; then
|
||||
name_show=$(cat "${desktop_files_home}/${current_file}" | grep "Name=" | head -1 | cut -d "=" -f 2 | sed 's/\//|/g')
|
||||
if [ ! -z "${name_show}" ] ; then
|
||||
echo "${desktop_files_home}/${current_file}" > "${load_desktop_files}/${name_show}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "1" > ${HOME}/.dmenu/read_list
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -f /usr/bin/dex ] ; then
|
||||
runDesktop="dex"
|
||||
else
|
||||
runDesktop="rundesk"
|
||||
fi
|
||||
|
||||
create_list_files
|
||||
list_output=$(list_desktop_icons | wofi --dmenu -i -p " drun")
|
||||
run_output=$(echo ${list_output} | cut -c 5-999)
|
||||
if [ ! -z "${run_output}" ] ; then
|
||||
if [ "${run_output}" == "Scan New Desktop Files" ] ; then
|
||||
echo "0" > ${HOME}/.dmenu/read_list
|
||||
create_list_files
|
||||
$0
|
||||
else
|
||||
run_desktop_file=$(cat "${load_desktop_files}/${run_output}")
|
||||
${runDesktop} "${run_desktop_file}"
|
||||
fi
|
||||
fi
|
74
.config/sway/wofi/wofi_fbrun
Executable file
74
.config/sway/wofi/wofi_fbrun
Executable file
|
@ -0,0 +1,74 @@
|
|||
#!/bin/bash
|
||||
|
||||
##########################################################################
|
||||
# wofi_fbrun - wofi-dmenu script that simulates 'rofi -show filebrowser' #
|
||||
# #
|
||||
# Author: q3aql <q3aql@duck.com> #
|
||||
# Last update: 04-01-2023 #
|
||||
##########################################################################
|
||||
|
||||
# Configuration variables
|
||||
load_theme_path="${HOME}/.wofi"
|
||||
|
||||
function generate_spaces() {
|
||||
num_spaces=${1}
|
||||
count_spaces=1
|
||||
while [ ${count_spaces} -le ${num_spaces} ] ; do
|
||||
echo -n " "
|
||||
count_spaces=$(expr ${count_spaces} + 1)
|
||||
done
|
||||
}
|
||||
|
||||
function show_icon_tree() {
|
||||
ls -1 | while read current ; do
|
||||
if [ -f "${current}" ] ; then
|
||||
echo " ${current}"
|
||||
elif [ -d "${current}" ] ; then
|
||||
echo " ${current}"
|
||||
else
|
||||
echo " ${current}"
|
||||
fi
|
||||
done
|
||||
generate_spaces 75
|
||||
}
|
||||
|
||||
function remove_icon() {
|
||||
entry="${@}"
|
||||
remove_icon_space=0
|
||||
read_entry=$(echo "${entry}" | grep " ")
|
||||
if ! [ -z "${read_entry}" ] ; then
|
||||
remove_icon_space=1
|
||||
fi
|
||||
read_entry=$(echo "${entry}" | grep " ")
|
||||
if ! [ -z "${read_entry}" ] ; then
|
||||
remove_icon_space=1
|
||||
fi
|
||||
read_entry=$(echo "${entry}" | grep " ")
|
||||
if ! [ -z "${read_entry}" ] ; then
|
||||
remove_icon_space=1
|
||||
fi
|
||||
if [ ${remove_icon_space} -eq 1 ] ; then
|
||||
show_output=$(echo "${entry}" | cut -c4-999 | tr -s " " | cut -c2-999)
|
||||
echo "${show_output}"
|
||||
else
|
||||
echo "${entry}"
|
||||
fi
|
||||
}
|
||||
|
||||
file=1
|
||||
while [ "${file}" ]; do
|
||||
file_icon=$(show_icon_tree | wofi --dmenu -i -p " filebrowser: $(basename $(pwd))")
|
||||
file=$(remove_icon "${file_icon}")
|
||||
echo "# ${file} #"
|
||||
if [ -e "${file}" ]; then
|
||||
owd=$(pwd)
|
||||
if [ -d "${file}" ]; then
|
||||
cd "${file}"
|
||||
else [ -f "${file}" ]
|
||||
if which xdg-open &> /dev/null; then
|
||||
exec xdg-open "${owd}/${file}" &
|
||||
unset file
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
52
.config/sway/wofi/wofi_run
Executable file
52
.config/sway/wofi/wofi_run
Executable file
|
@ -0,0 +1,52 @@
|
|||
#!/bin/bash
|
||||
|
||||
################################################################
|
||||
# wofi_run - wofi-dmenu script that simulates 'rofi -show run' #
|
||||
# #
|
||||
# Author: q3aql <q3aql@duck.com> #
|
||||
# Last update: 04-01-2023 #
|
||||
################################################################
|
||||
|
||||
# Configuration variables
|
||||
load_theme_path="${HOME}/.wofi"
|
||||
|
||||
function generate_spaces() {
|
||||
num_spaces=${1}
|
||||
count_spaces=1
|
||||
while [ ${count_spaces} -le ${num_spaces} ] ; do
|
||||
echo -n " "
|
||||
count_spaces=$(expr ${count_spaces} + 1)
|
||||
done
|
||||
}
|
||||
|
||||
function list_binaries() {
|
||||
binaries=0
|
||||
path_binaries=${PATH}
|
||||
count_path=1
|
||||
while [ ${binaries} -eq 0 ] ; do
|
||||
current_path=$(echo ${path_binaries} | cut -d ":" -f ${count_path})
|
||||
if [ -z "${current_path}" ] ; then
|
||||
binaries=1
|
||||
else
|
||||
# Extra code / When /bin is the same that /usr/bin/
|
||||
bin_same=$(ls -la ${current_path} | grep "> usr/bin")
|
||||
if [ -z "${bin_same}" ] ; then
|
||||
ls -1 ${current_path}/
|
||||
count_path=$(expr ${count_path} + 1)
|
||||
else
|
||||
count_path=$(expr ${count_path} + 1)
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function list_binaries_icons() {
|
||||
list_binaries | while read current_binary ; do
|
||||
echo " ${current_binary}"
|
||||
done
|
||||
generate_spaces 75
|
||||
}
|
||||
|
||||
list_output=$(list_binaries_icons | wofi --dmenu -i -p " run")
|
||||
run_output=$(echo "${list_output}" | cut -c4-999)
|
||||
${run_output}
|
47
.config/sway/wofi/wofi_wrun
Executable file
47
.config/sway/wofi/wofi_wrun
Executable file
|
@ -0,0 +1,47 @@
|
|||
#!/bin/bash
|
||||
|
||||
####################################################################
|
||||
# wofi_wrun - wofi-dmenu script that simulates 'rofi -show window' #
|
||||
# #
|
||||
# Author: q3aql <q3aql@duck.com> #
|
||||
# Last update: 04-01-2023 #
|
||||
####################################################################
|
||||
|
||||
# Configuration variables
|
||||
load_theme_path="${HOME}/.wofi"
|
||||
|
||||
function generate_spaces() {
|
||||
num_spaces=${1}
|
||||
count_spaces=1
|
||||
while [ ${count_spaces} -le ${num_spaces} ] ; do
|
||||
echo -n " "
|
||||
count_spaces=$(expr ${count_spaces} + 1)
|
||||
done
|
||||
}
|
||||
|
||||
function check_wmctrl() {
|
||||
wmctrl -h &> /dev/null
|
||||
error=$?
|
||||
if [ ${error} -ne 0 ] ; then
|
||||
echo " Error: You need install 'wmctrl'" | wofi --dmenu -p " window"
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
function list_applications_icons() {
|
||||
wmctrl -l | while read current_app ; do
|
||||
echo " ${current_app}"
|
||||
done
|
||||
generate_spaces 75
|
||||
}
|
||||
|
||||
check_wmctrl
|
||||
list_output=$(list_applications_icons | wofi --dmenu -i -p " window")
|
||||
run_output=$(echo ${list_output} | cut -c 5-999)
|
||||
echo "# Selected: ${run_output}"
|
||||
run_output=$(echo "${run_output}" | cut -d " " -f 1)
|
||||
if [ -z "${run_output}" ] ; then
|
||||
echo "# Selection window canceled"
|
||||
else
|
||||
wmctrl -ia "${run_output}" &> /dev/null
|
||||
fi
|
Loading…
Reference in New Issue
Block a user