Add screenshot menu and update prompt
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
parent
d25e3618c4
commit
1792013f37
8 changed files with 214 additions and 9 deletions
8
install
8
install
|
@ -165,3 +165,11 @@ for file in ${SYSTEM_DIR}/etc/sudoers.d/*
|
||||||
do
|
do
|
||||||
copy_sudoers_content "${file}"
|
copy_sudoers_content "${file}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
print_header "Create issue file"
|
||||||
|
echo "\e{red}" >> "/tmp/issue"
|
||||||
|
cat "/etc/hostname" | tr '[:lower:]' '[:upper:]' | figlet -f big | sd '\\' '\\\\' >> "/tmp/issue"
|
||||||
|
|
||||||
|
echo "\r" >> "/tmp/issue"
|
||||||
|
echo "\e{reset}" >> "/tmp/issue"
|
||||||
|
sudo mv /tmp/issue /etc/issue
|
|
@ -58,7 +58,7 @@ export VISUAL=vim
|
||||||
export EDITOR="${VISUAL}"
|
export EDITOR="${VISUAL}"
|
||||||
export TERMINAL=termite
|
export TERMINAL=termite
|
||||||
export BROWSER="google-chrome-beta"
|
export BROWSER="google-chrome-beta"
|
||||||
export PAGER="most"
|
export PAGER="less"
|
||||||
export MANPAGER="${PAGER}"
|
export MANPAGER="${PAGER}"
|
||||||
|
|
||||||
# QT
|
# QT
|
||||||
|
@ -87,13 +87,52 @@ function current_branch() {
|
||||||
else
|
else
|
||||||
echo "[${branch}]"
|
echo "[${branch}]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function file_count() {
|
||||||
|
count="$(ls -a -1 | wc -l)"
|
||||||
|
echo "[${count} files]"
|
||||||
|
}
|
||||||
|
|
||||||
|
function folder_size() {
|
||||||
|
size="$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')"
|
||||||
|
echo "[${size}B]"
|
||||||
|
}
|
||||||
|
|
||||||
|
function prompt_width() {
|
||||||
|
hostname="$(hostname)"
|
||||||
|
branch="$(current_branch)"
|
||||||
|
pwd="$(print -P %~)"
|
||||||
|
file_count="$(file_count)"
|
||||||
|
folder_size="$(folder_size)"
|
||||||
|
echo "$((${COLUMNS} - 19 - ${#hostname} - ${#branch} - ${#pwd} - ${#file_count} - ${#folder_size}))"
|
||||||
|
}
|
||||||
|
|
||||||
|
function precmd() {
|
||||||
|
# Print a newline before the prompt, unless it's the
|
||||||
|
# first prompt in the process.
|
||||||
|
if [ -z "$NEW_LINE_BEFORE_PROMPT" ]; then
|
||||||
|
NEW_LINE_BEFORE_PROMPT=1
|
||||||
|
elif [ "$NEW_LINE_BEFORE_PROMPT" -eq 1 ]; then
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Custom prompt
|
# Custom prompt
|
||||||
NEWLINE=$'\n'
|
NEWLINE=$'\n'
|
||||||
export PS1="┌─"
|
export PS1="┌─"
|
||||||
export PS1="${PS1}%F{red}[%*]%f"
|
export PS1="${PS1}%F{red}[%*]%f"
|
||||||
export PS1="${PS1}%F{blue}[%m]%f"
|
export PS1="${PS1}%F{blue}[%m]%f"
|
||||||
export PS1="${PS1}%F{yellow}[%~]%f"
|
export PS1="${PS1}%F{yellow}[%~]%f"
|
||||||
export PS1="${PS1}%F{blue}"'$(current_branch)'"%f"
|
export PS1="${PS1}"'${(r:$(prompt_width)::─:)}'
|
||||||
|
export PS1="${PS1}%F{yellow}"'$(file_count)'"%f"
|
||||||
|
export PS1="${PS1}%F{blue}"'$(folder_size)'"%f"
|
||||||
|
export PS1="${PS1}%F{red}"'$(current_branch)'"%f"
|
||||||
|
export PS1="${PS1}─┐"
|
||||||
export PS1="${PS1}${NEWLINE}└─╼ "
|
export PS1="${PS1}${NEWLINE}└─╼ "
|
||||||
|
|
||||||
|
|
||||||
|
export RPROMPT="╾─┘"
|
||||||
|
|
||||||
|
|
||||||
|
#PS1="\n\[\e[30;1m\]\[\016\]l\[\017\](\[\e[34;1m\]\u@\h\[\e[30;1m\])-(\[\e[34;1m\]\j\[\e[30;1m\])-(\[\e[34;1m\]\@ \d\[\e[30;1m\])->\[\e[30;1m\]\n\[\016\]m\[\017\]-(\[\[\e[32;1m\]\w\[\e[30;1m\])-(\[\e[32;1m\]\$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed 's: ::g') files, \$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')b\[\e[30;1m\])--> \[\e[0m\]"
|
|
@ -13,6 +13,12 @@ show-places-in-to-menus=true
|
||||||
[org/nemo/list-view]
|
[org/nemo/list-view]
|
||||||
default-zoom-level='smaller'
|
default-zoom-level='smaller'
|
||||||
|
|
||||||
|
[org/nemo/desktop]
|
||||||
|
show-desktop-icons=false
|
||||||
|
|
||||||
|
[org/cinnamon/desktop/default-applications/terminal]
|
||||||
|
exec='termite'
|
||||||
|
|
||||||
[desktop/ibus/general]
|
[desktop/ibus/general]
|
||||||
engines-order=['xkb:ch::ger', 'anthy']
|
engines-order=['xkb:ch::ger', 'anthy']
|
||||||
preload-engines=['xkb:ch::ger', 'anthy']
|
preload-engines=['xkb:ch::ger', 'anthy']
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
LocationMode=path-bar
|
LocationMode=path-bar
|
||||||
ShowHidden=true
|
ShowHidden=true
|
||||||
ShowSizeColumn=true
|
ShowSizeColumn=true
|
||||||
GeometryX=0
|
GeometryX=540
|
||||||
GeometryY=0
|
GeometryY=225
|
||||||
GeometryWidth=840
|
GeometryWidth=840
|
||||||
GeometryHeight=630
|
GeometryHeight=630
|
||||||
SortColumn=name
|
SortColumn=name
|
||||||
|
|
|
@ -98,6 +98,9 @@ bindsym $mod+G exec games
|
||||||
# Open power menu
|
# Open power menu
|
||||||
bindsym $mod+F4 exec power
|
bindsym $mod+F4 exec power
|
||||||
|
|
||||||
|
# Open screenshot menu
|
||||||
|
bindsym Print exec screenshot
|
||||||
|
|
||||||
# Change focus
|
# Change focus
|
||||||
bindsym $mod+Left focus left
|
bindsym $mod+Left focus left
|
||||||
bindsym $mod+H focus left
|
bindsym $mod+H focus left
|
||||||
|
@ -221,7 +224,13 @@ bindsym XF86AudioPrev exec --no-startup-id cmus-remote -r
|
||||||
bindsym $mod+Control+Left exec --no-startup-id cmus-remote -r
|
bindsym $mod+Control+Left exec --no-startup-id cmus-remote -r
|
||||||
|
|
||||||
|
|
||||||
exec --no-startup-id "i3-msg 'workspace 10: ; append_layout /home/severin/.config/i3/workspace-10.json'"
|
exec --no-startup-id "i3-msg 'workspace 10: ; append_layout
|
||||||
|
/home/severin/.config/i3/workspace-10.json'"
|
||||||
|
|
||||||
|
exec --no-startup-id "i3-msg 'workspace 2: ; append_layout
|
||||||
|
/home/severin/.config/i3/workspace-2.json'"
|
||||||
|
|
||||||
|
exec --no-startup-id "i3-msg 'workspace 1: "
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Startup applications #
|
# Startup applications #
|
||||||
|
@ -245,6 +254,9 @@ exec_always --no-startup-id wallpaper
|
||||||
exec autokey-gtk
|
exec autokey-gtk
|
||||||
exec google-chrome-beta
|
exec google-chrome-beta
|
||||||
exec termite
|
exec termite
|
||||||
|
exec termite
|
||||||
|
exec termite
|
||||||
|
exec termite
|
||||||
exec discord
|
exec discord
|
||||||
exec nemo
|
exec nemo
|
||||||
exec nemo
|
exec nemo
|
||||||
|
|
106
system/.config/i3/workspace-2.json
Normal file
106
system/.config/i3/workspace-2.json
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"border": "none",
|
||||||
|
"floating": "auto_off",
|
||||||
|
"fullscreen_mode": 0,
|
||||||
|
"layout": "splith",
|
||||||
|
"percent": null,
|
||||||
|
"type": "con",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"border": "none",
|
||||||
|
"floating": "auto_off",
|
||||||
|
"layout": "splitv",
|
||||||
|
"percent": 0.5,
|
||||||
|
"type": "con",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"border": "pixel",
|
||||||
|
"current_border_width": 0,
|
||||||
|
"floating": "auto_off",
|
||||||
|
"geometry": {
|
||||||
|
"height": 434,
|
||||||
|
"width": 736,
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"name": null,
|
||||||
|
"percent": 0.5,
|
||||||
|
"swallows": [
|
||||||
|
{
|
||||||
|
"instance": "^termite$"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": "con"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"border": "pixel",
|
||||||
|
"current_border_width": 0,
|
||||||
|
"floating": "auto_off",
|
||||||
|
"geometry": {
|
||||||
|
"height": 434,
|
||||||
|
"width": 736,
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"name": null,
|
||||||
|
"percent": 0.5,
|
||||||
|
"swallows": [
|
||||||
|
{
|
||||||
|
"instance": "^termite$"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": "con"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"border": "none",
|
||||||
|
"floating": "auto_off",
|
||||||
|
"layout": "splitv",
|
||||||
|
"percent": 0.5,
|
||||||
|
"type": "con",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"border": "pixel",
|
||||||
|
"current_border_width": 0,
|
||||||
|
"floating": "auto_off",
|
||||||
|
"geometry": {
|
||||||
|
"height": 434,
|
||||||
|
"width": 736,
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"name": null,
|
||||||
|
"percent": 0.5,
|
||||||
|
"swallows": [
|
||||||
|
{
|
||||||
|
"instance": "^termite$"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": "con"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"border": "pixel",
|
||||||
|
"current_border_width": 0,
|
||||||
|
"floating": "auto_off",
|
||||||
|
"geometry": {
|
||||||
|
"height": 434,
|
||||||
|
"width": 736,
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"name": null,
|
||||||
|
"percent": 0.5,
|
||||||
|
"swallows": [
|
||||||
|
{
|
||||||
|
"instance": "^termite$"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": "con"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
|
@ -32,7 +32,7 @@ case "${SELECTION}" in
|
||||||
gw2
|
gw2
|
||||||
;;
|
;;
|
||||||
"3")
|
"3")
|
||||||
optirun -b primus minecraft-launcher
|
optirun -b primus java minecraft-launcher
|
||||||
;;
|
;;
|
||||||
"4")
|
"4")
|
||||||
optirun -b primus pegasus-fe
|
optirun -b primus pegasus-fe
|
||||||
|
|
34
system/.local/bin/screenshot
Executable file
34
system/.local/bin/screenshot
Executable file
|
@ -0,0 +1,34 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# SCRIPT NAME:
|
||||||
|
# screenshot
|
||||||
|
#
|
||||||
|
# AUTHOR:
|
||||||
|
# Severin Kaderli <severin@kaderli.dev>
|
||||||
|
#
|
||||||
|
# DESCRIPTION:
|
||||||
|
# Displays a screenshot menu using rofi.
|
||||||
|
#
|
||||||
|
# USAGE:
|
||||||
|
# ./screenshot
|
||||||
|
|
||||||
|
# The rofi prompt
|
||||||
|
PROMPT="Screenshot"
|
||||||
|
|
||||||
|
# Actions for the menu
|
||||||
|
ACTIONS=(
|
||||||
|
"1: Fullscreen"
|
||||||
|
"2: Selection"
|
||||||
|
)
|
||||||
|
|
||||||
|
FILENAME="${HOME}/Pictures/Screenshots/%Y-%m-%d-%H%I%S.png"
|
||||||
|
|
||||||
|
SELECTION=$(printf '%s\n' "${ACTIONS[@]}" | rofi -dmenu -p "${PROMPT}" | cut -d ":" -f1)
|
||||||
|
case "${SELECTION}" in
|
||||||
|
"1")
|
||||||
|
escrotum "${FILENAME}"
|
||||||
|
;;
|
||||||
|
"2")
|
||||||
|
escrotum -s "${FILENAME}"
|
||||||
|
;;
|
||||||
|
esac
|
Loading…
Add table
Add a link
Reference in a new issue