This commit is contained in:
Luca 2022-05-07 13:13:17 +01:00
commit 010de90c5f
4777 changed files with 575168 additions and 0 deletions

4
README.md Normal file
View File

@ -0,0 +1,4 @@
# dotfiles
My dotfiles 😊

100
home/.Xresources Normal file
View File

@ -0,0 +1,100 @@
Xcursor.theme:LyraS-cursors
Xcursor.size:16
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.autohint: true
Xft.hintstyle: hintfull
Xft.lcdfilter: lcdfilter
Xft.dpi: 96
XTerm.vt100.faceName: JetBrains Mono:style=Regular:size=12
#XTerm.vt100.faceName: Fantasque Sans Mono:style=Regular:size=14
XTerm.vt100.font: 7x13
XTerm.vt100.saveLines: 4096
XTerm.vt100.selectToClipboard: true
XTerm.vt100.scrollBar: false
! COLORS FOR SXIV
Sxiv.foreground: #c5c8c6
Sxiv.background: #1d1f21
Sxiv.font: JetBrains Mono:style=Bold:size=10
# tomorrow-ark
#! special
#*.foreground: #c5c8c6
#*.background: #1d1f21
#*.cursorColor: #c5c8c6
#
#! black
#*.color0: #282a2e
#*.color8: #373b41
#
#! red
#*.color1: #a54242
#*.color9: #cc6666
#
#! green
#*.color2: #8c9440
#*.color10: #b5bd68
#
#! yellow
#*.color3: #de935f
#*.color11: #f0c674
#
#! blue
#*.color4: #5f819d
#*.color12: #81a2be
#
#! magenta
#*.color5: #85678f
#*.color13: #b294bb
#
#! cyan
#*.color6: #5e8d87
#*.color14: #8abeb7
#
#! white
#*.color7: #707880
#*.color15: #c5c8c6
# hund :
! special
*.foreground: #c5c8c6
*.background: #1a1e21
*.cursorColor: #c5c8c6
! black
*.color0: #222222
*.color8: #666666
! red
*.color1: #e84f4f
*.color9: #d23d3d
! green
*.color2: #b7ce42
*.color10: #bde077
! yellow
*.color3: #fea63c
*.color11: #ffe863
! blue
*.color4: #66aabb
*.color12: #aaccbb
! magenta
*.color5: #b668c7
*.color13: #e16a98
! cyan
*.color6: #6d878d
*.color14: #42717b
! white
*.color7: #dddddd
*.color15: #cccccc

14
home/.bashrc Normal file
View File

@ -0,0 +1,14 @@
shopt -s autocd #Allows you to cd into directory merely by typing the directory name.
# Setting Bash prompt. Capitalizes username and host if root user (my root user uses this same config file).
if [ "$EUID" -ne 0 ]
then export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h\[$(tput setaf 5)\]\[$(tput setaf 1)]-($(tput setaf 5)\W\[$(tput setaf 1)\])\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]"
else export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]ROOT\[$(tput setaf 2)\]@\[$(tput setaf 4)\]$(hostname | awk '{print toupper($0)}') \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]"
fi
# Defult app :
EDITOR=nano

View File

@ -0,0 +1,2 @@
[General]
theme=Sweet-Mars

View File

@ -0,0 +1,14 @@
{
"workbench.iconTheme": "material-icon-theme",
"terminal.explorerKind": "external",
"terminal.external.linuxExec": "terminator",
"python.terminal.executeInFileDir": true,
"window.menuBarVisibility": "toggle",
"editor.fontSize": 20,
"editor.fontFamily": "JetBrains Mono",
"editor.minimap.enabled": false,
"terminal.integrated.fontFamily": "JetBrains Mono",
"python.terminal.activateEnvInCurrentTerminal": true,
"workbench.startupEditor": "none",
"workbench.colorTheme": "Sweet Mars"
}

View File

@ -0,0 +1,61 @@
## Import files (Colors, Fonts, Etc)
import:
- ~/.config/alacritty/colors.yml
- ~/.config/alacritty/fonts.yml
## Set environment variables
env:
TERM: alacritty
WINIT_X11_SCALE_FACTOR: '1.0'
## Terminal window settings
window:
dimensions:
columns: 82
lines: 25
padding:
x: 12
y: 12
decorations: full
startup_mode: Windowed
dynamic_title: true
## scrolling
history: 10000
multiplier: 3
## Background opacity
window:
opacity: 0.90
## Cursor
cursor:
style:
shape: Block
blinking: On
unfocused_hollow: false
## Live config reload
live_config_reload: true
key_bindings:
- { key: V, mods: Control|Shift, action: Paste }
- { key: C, mods: Control|Shift, action: Copy }
- { key: Insert, mods: Shift, action: PasteSelection }
- { key: Key0, mods: Control, action: ResetFontSize }
- { key: Equals, mods: Control, action: IncreaseFontSize }
- { key: Plus, mods: Control, action: IncreaseFontSize }
- { key: Minus, mods: Control, action: DecreaseFontSize }
- { key: F11, mods: None, action: ToggleFullscreen }
- { key: Paste, mods: None, action: Paste }
- { key: Copy, mods: None, action: Copy }
- { key: L, mods: Control, action: ClearLogNotice }
- { key: L, mods: Control, chars: "\x0c" }
- { key: PageUp, mods: None, action: ScrollPageUp, mode: ~Alt }
- { key: PageDown, mods: None, action: ScrollPageDown, mode: ~Alt }
- { key: Home, mods: Shift, action: ScrollToTop, mode: ~Alt }
- { key: End, mods: Shift, action: ScrollToBottom, mode: ~Alt }

View File

@ -0,0 +1,33 @@
colors:
# Default colors
primary:
background: "#161616"
foreground: "#c5c8c6"
cursor:
text: CellBackground
cursor: "#d7d7d7"
selection:
text: CellForeground
background: "#525252"
# Normal colors
normal:
black: "#222222"
red: "#e84f4f"
green: "#b7ce42"
yellow: "#fea63c"
blue: "#66aabb"
magenta: "#b668c7"
cyan: "#6d878d"
white: "#dddddd"
# Bright colors
bright:
black: "#666666"
red: "#d23d3d"
green: "#bde077"
yellow: "#ffe863"
blue: "#aaccbb"
magenta: "#e16a98"
cyan: "#42717b"
white: "#cccccc"

View File

@ -0,0 +1,29 @@
# Colors (Tokyo Night)
# Source: https://github.com/zatchheems/tokyo-night-alacritty-theme
colors:
# Default colors
primary:
background: '#02131a'
foreground: '#b5e8e0'
# Normal colors
normal:
black: '#1a1b26'
red: '#653945'
green: '#3c4349'
yellow: '#4c4c53'
blue: '#695861'
magenta: '#88374a'
cyan: '#985965'
white: '#bcb4b9'
# Bright colors
bright:
black: '#837d81'
red: '#653945'
green: '#3c4349'
yellow: '#4c4c53'
blue: '#695861'
magenta: '#88374a'
cyan: '#985965'
white: '#bcb4b9'

View File

@ -0,0 +1,30 @@
colors:
# Default colors
primary:
background: '#282c34'
foreground: '#bbc2cf'
cursor:
text: CellBackground
cursor: '#528bff'
selection:
text: CellForeground
background: '#3e4451'
normal:
black: '#1c1f24'
red: '#ff6c6b'
green: '#98be65'
yellow: '#da8548'
blue: '#51afef'
magenta: '#c678dd'
cyan: '#5699af'
white: '#202328'
bright:
black: '#5b6268'
red: '#da8548'
green: '#4db5bd'
yellow: '#ecbe7b'
blue: '#3071db' # This is 2257a0 in Doom Emacs but I lightened it.
magenta: '#a9a1e1'
cyan: '#46d9ff'
white: '#dfdfdf'

View File

@ -0,0 +1,30 @@
colors:
# Default colors
primary:
background: "#1D1F21"
foreground: "#bbc2cf"
cursor:
text: CellBackground
cursor: "#dfdfdf"
selection:
text: CellForeground
background: "#3e4451"
normal:
black: "#1c1f24"
red: "#ff6c6b"
green: "#98be65"
yellow: "#da8548"
blue: "#51afef"
magenta: "#c678dd"
cyan: "#5699af"
white: "#202328"
bright:
black: "#5b6268"
red: "#da8548"
green: "#4db5bd"
yellow: "#ecbe7b"
blue: "#3071db" # This is 2257a0 in Doom Emacs but I lightened it.
magenta: "#a9a1e1"
cyan: "#46d9ff"
white: "#dfdfdf"

View File

@ -0,0 +1,34 @@
colors:
# Default colors
primary:
background: '#202328'
foreground: '#d7d7d7'
cursor:
text: CellBackground
cursor: '#d7d7d7'
selection:
text: CellForeground
background: '#3e4451'
# Normal colors
normal:
black: '#1c1f24'
red: '#ff6c6b'
green: '#98be65'
yellow: '#da8548'
blue: '#51afef'
magenta: '#c678dd'
cyan: '#5699af'
white: '#202328'
# Bright colors
bright:
black: '#5b6268'
red: '#da8548'
green: '#4db5bd'
yellow: '#ecbe7b'
blue: '#3071db'
magenta: '#a9a1e1'
cyan: '#46d9ff'
white: '#dfdfdf'

View File

@ -0,0 +1,52 @@
colors:
primary:
background: '#282a36'
foreground: '#f8f8f2'
bright_foreground: '#ffffff'
cursor:
text: CellBackground
cursor: CellForeground
vi_mode_cursor:
text: CellBackground
cursor: CellForeground
search:
matches:
foreground: '#44475a'
background: '#50fa7b'
focused_match:
foreground: '#44475a'
background: '#ffb86c'
bar:
background: '#282a36'
foreground: '#f8f8f2'
hints:
start:
foreground: '#282a36'
background: '#f1fa8c'
end:
foreground: '#f1fa8c'
background: '#282a36'
line_indicator:
foreground: None
background: None
selection:
text: CellForeground
background: '#44475a'
normal:
black: '#21222c'
red: '#ff5555'
green: '#50fa7b'
yellow: '#f1fa8c'
blue: '#bd93f9'
magenta: '#ff79c6'
cyan: '#8be9fd'
white: '#f8f8f2'
bright:
black: '#6272a4'
red: '#ff6e6e'
green: '#69ff94'
yellow: '#ffffa5'
blue: '#d6acff'
magenta: '#ff92df'
cyan: '#a4ffff'
white: '#ffffff'

View File

@ -0,0 +1,34 @@
colors:
# Default colors
primary:
background: '#1d1f21'
foreground: '#d7d7d7'
cursor:
text: CellBackground
cursor: '#d7d7d7'
selection:
text: CellForeground
background: '#3e4451'
# Normal colors
normal:
black: '#282828'
red: '#cc241d'
green: '#98971a'
yellow: '#d79921'
blue: '#458588'
magenta: '#b16286'
cyan: '#689d6a'
white: '#a89984'
# Bright colors
bright:
black: '#928374'
red: '#fb4934'
green: '#b8bb26'
yellow: '#fabd2f'
blue: '#83a598'
magenta: '#d3869b'
cyan: '#8ec07c'
white: '#ebdbb2'

View File

@ -0,0 +1,33 @@
colors:
# Default colors
primary:
background: "#161616"
foreground: "#c5c8c6"
cursor:
text: CellBackground
cursor: "#d7d7d7"
selection:
text: CellForeground
background: "#525252"
# Normal colors
normal:
black: "#222222"
red: "#e84f4f"
green: "#b7ce42"
yellow: "#fea63c"
blue: "#66aabb"
magenta: "#b668c7"
cyan: "#6d878d"
white: "#dddddd"
# Bright colors
bright:
black: "#666666"
red: "#d23d3d"
green: "#bde077"
yellow: "#ffe863"
blue: "#aaccbb"
magenta: "#e16a98"
cyan: "#42717b"
white: "#cccccc"

View File

@ -0,0 +1,32 @@
colors:
# Default colors
primary:
background: '#1d1f21'
foreground: '#d7d7d7'
cursor:
text: CellBackground
cursor: '#d7d7d7'
selection:
text: CellForeground
background: '#3e4451'
# Normal colors
normal:
black: '#1d1f21'
red: '#b24040'
green: '#2ebe8f'
yellow: '#dc8531'
blue: '#518fd8'
magenta: '#865596'
cyan: '#72b7c9'
white: '#707880'
# Bright colors
bright:
black: '#373b41'
red: '#cc6666'
green: '#b5bd68'
yellow: '#f0c674'
blue: '#709abe'
magenta: '#af85bb'
cyan: '#8abeb7'
white: '#c5c8c6'

View File

@ -0,0 +1,33 @@
colors:
# Default colors
primary:
background: "#1d1f21"
foreground: "#c5c8c6"
cursor:
text: CellBackground
cursor: "#d7d7d7"
selection:
text: CellForeground
background: "#3e4451"
# Normal colors
normal:
black: "#282a2e"
red: "#a54242"
green: "#8c9440"
yellow: "#de935f"
blue: "#5f819d"
magenta: "#85678f"
cyan: "#5e8d87"
white: "#707880"
# Bright colors
bright:
black: "#373b41"
red: "#cc6666"
green: "#b5bd68"
yellow: "#f0c674"
blue: "#81a2be"
magenta: "#b294bb"
cyan: "#8abeb7"
white: "#c5c8c6"

View File

@ -0,0 +1,32 @@
colors:
# Default colors
primary:
background: '#1d1f21'
foreground: '#c5c8c6'
cursor:
text: CellBackground
cursor: '#ffffff'
selection:
text: CellForeground
background: '#3e4451'
# Normal colors
normal:
black: '#1d1f21'
red: '#cc6666'
green: '#b5bd68'
yellow: '#e6c547'
blue: '#81a2be'
magenta: '#b294bb'
cyan: '#70c0ba'
white: '#373b41'
# Bright colors
bright:
black: '#666666'
red: '#ff3334'
green: '#9ec400'
yellow: '#f0c674'
blue: '#81a2be'
magenta: '#b77ee0'
cyan: '#54ced6'
white: '#282a2e'

View File

@ -0,0 +1,33 @@
colors:
# Default colors
primary:
background: "#1d1f21"
foreground: "#c5c8c6"
cursor:
text: CellBackground
cursor: '#d7d7d7'
selection:
text: CellForeground
background: '#3e4451'
# Normal colors
normal:
black: "#1d1f21"
red: "#cc241d"
green: "#98971a"
yellow: "#d7992a"
blue: "#458588"
magenta: "#b16286"
cyan: "#689d6a"
white: "#c5c8c6"
# Bright colors
bright:
black: "#969896"
red: "#fb4934"
green: "#b8bb26"
yellow: "#fabd2f"
blue: "#83a598"
magenta: "#d3869b"
cyan: "#8ec07c"
white: "#d7d7d7"

View File

@ -0,0 +1,33 @@
colors:
# Default colors
primary:
background: "#101010"
foreground: "#d2c5bc"
cursor:
text: CellBackground
cursor: "#d7d7d7"
selection:
text: CellForeground
background: "#3e4451"
# Normal colors
normal:
black: "#202020"
red: "#b91e2e"
green: "#81957c"
yellow: "#f9bb80"
blue: "#356579"
magenta: "#55365e"
cyan: "#0b3452"
white: "#909090"
# Bright colors
bright:
black: "#606060"
red: "#d14548"
green: "#a7b79a"
yellow: "#fae3a0"
blue: "#7491a1"
magenta: "#87314e"
cyan: "#0f829d"
white: "#fff0f0"

View File

@ -0,0 +1,45 @@
# Font configuration
font:
# Normal (roman) font face
normal:
family: "JetBrains Mono"
#family: "Fantasque Sans Mono"
#family: "Monospace"
#style: Regular
# Bold font face
bold:
family: "JetBrains Mono"
#family: "Fantasque Sans Mono"
#family: "Monospace"
#style: Bold
# Italic font face
italic:
family: "JetBrains Mono"
#family: "Fantasque Sans Mono"
#family: "Monospace"
#style: Italic
# Bold italic font face
bold_italic:
family: "JetBrains Mono"
#family: "Fantasque Sans Mono"
#family: "Monospace"
#style: Bold Italic
# Point size
#JetBrains && Monospace
size: 12
#Fantasque Sans Mono
#size: 14
# Offset
#offset:
# x: 0
# y: 0
# Glyph offset
#glyph_offset:
# x: 0
# y: 0

View File

@ -0,0 +1,292 @@
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
local menubar = require("menubar")
require("awful.autofocus")
-- Hotkeys awesome library
local hotkeys_popup = require("awful.hotkeys_popup")
require("awful.hotkeys_popup.keys")
-- Default modkey :
modkey = "Mod4"
altkey = "Mod1"
ctlkey = "Control"
-- This is used later as the default terminal and editor to run.
-- terminal = "alacritty"
terminal = "kitty"
editor = os.getenv("EDITOR") or "nano"
editor_cmd = terminal .. " -e " .. editor
local keys = {}
-- Key bindings :
globalkeys = gears.table.join(
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description="show help", group="awesome"}),
awful.key({ modkey, }, "Left", awful.tag.viewprev,
{description = "view previous", group = "tag"}),
awful.key({ modkey, }, "Right", awful.tag.viewnext,
{description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
{description = "go back", group = "tag"}),
awful.key({ modkey, }, "j",
function ()
awful.client.focus.byidx( 1)
end,
{description = "focus next by index", group = "client"}
),
awful.key({ modkey, }, "k",
function ()
awful.client.focus.byidx(-1)
end,
{description = "focus previous by index", group = "client"}
),
awful.key({ modkey, }, "w", function () mymainmenu:show() end,
{description = "show main menu", group = "awesome"}),
-- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
{description = "swap with next client by index", group = "client"}),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
{description = "swap with previous client by index", group = "client"}),
awful.key({ modkey, ctlkey }, "j", function () awful.screen.focus_relative( 1) end,
{description = "focus the next screen", group = "screen"}),
awful.key({ modkey, ctlkey }, "k", function () awful.screen.focus_relative(-1) end,
{description = "focus the previous screen", group = "screen"}),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
{description = "jump to urgent client", group = "client"}),
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end,
{description = "go back", group = "client"}),
-- Standard program
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
{description = "open a terminal", group = "launcher"}),
awful.key({ modkey, ctlkey }, "r", awesome.restart,
{description = "reload awesome", group = "awesome"}),
awful.key({ modkey, "Shift" }, "q", awesome.quit,
{description = "quit awesome", group = "awesome"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
{description = "decrease master width factor", group = "layout"}),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
{description = "increase the number of master clients", group = "layout"}),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
{description = "decrease the number of master clients", group = "layout"}),
awful.key({ modkey, ctlkey }, "h", function () awful.tag.incncol( 1, nil, true) end,
{description = "increase the number of columns", group = "layout"}),
awful.key({ modkey, ctlkey }, "l", function () awful.tag.incncol(-1, nil, true) end,
{description = "decrease the number of columns", group = "layout"}),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
{description = "select next", group = "layout"}),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
{description = "select previous", group = "layout"}),
awful.key({ modkey, ctlkey }, "n",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
c:emit_signal(
"request::activate", "key.unminimize", {raise = true}
)
end
end,
{description = "restore minimized", group = "client"}),
-- Prompt :
--awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
--{description = "run prompt", group = "launcher"}),
awful.key({ modkey }, "p", function () awful.spawn(string.format("rofi -show run -show-icons")) end,
{description = "rofi launcher", group = "launcher"}),
-- Personal keybindings :
awful.key({ ctlkey, "Shift" }, "f", function () awful.spawn(string.format("pcmanfm")) end,
{description = "pcmanfm", group = "file manager"}),
awful.key({ modkey, "Shift" }, "Return", function () awful.spawn(string.format("xterm")) end,
{description = "pcmanfm", group = "terminal"}),
-- Scripts (~/.local/bin/scripts)
-- Screenshots Keys :
awful.key({ }, "Print", function () awful.util.spawn("screenshot")end,
{description = "Maim", group = "screenshots"}),
awful.key({ modkey }, "Print", function () awful.util.spawn("screenshot-select")end,
{description = "Maim", group = "screenshots"}),
-- Keybord :
--awful.key({ "Shift_L" }, "Mod1", function() kbdcfg:next() end ),
--awful.key({ "Mod1" }, "Shift_L", function() kbdcfg:prev() end ),
-- System keybindings :
-- Volume Keys :sdسي
awful.key({}, "XF86AudioLowerVolume", function ()
awful.util.spawn("amixer -q -D pulse sset Master 5%-", false) end),
awful.key({}, "XF86AudioRaiseVolume", function ()
awful.util.spawn("amixer -q -D pulse sset Master 5%+", false) end),
awful.key({}, "XF86AudioMute", function ()
awful.util.spawn("amixer -D pulse set Master 1+ toggle", false) end),
-- Media Keys :
awful.key({}, "XF86AudioPlay", function()
awful.util.spawn("playerctl play-pause", false) end),
awful.key({}, "XF86AudioNext", function()
awful.util.spawn("playerctl next", false) end),
awful.key({}, "XF86AudioPrev", function()
awful.util.spawn("playerctl previous", false) end),
-- Brightness Keys :
awful.key({}, "XF86MonBrightnessUp", function()
awful.util.spawn("brightnessctl set 2%+", false) end),
awful.key({}, "XF86MonBrightnessDown", function()
awful.util.spawn("brightnessctl set 2%-", false) end),
-- Center Window :
awful.key({ modkey }, "y", awful.placement.centered),
awful.key({ modkey }, "x",
function ()
awful.prompt.run {
prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval"
}
end,
{description = "lua execute prompt", group = "awesome"}),
-- Menubar
awful.key({ modkey }, "r", function() menubar.show() end,
{description = "show the menubar", group = "launcher"})
)
clientkeys = gears.table.join(
awful.key({ modkey, }, "f",
function (c)
c.fullscreen = not c.fullscreen
c:raise()
end,
{description = "toggle fullscreen", group = "client"}),
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
{description = "close", group = "client"}),
awful.key({ modkey, ctlkey }, "space", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}),
awful.key({ modkey, ctlkey }, "Return", function (c) c:swap(awful.client.getmaster()) end,
{description = "move to master", group = "client"}),
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
{description = "move to screen", group = "client"}),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
{description = "toggle keep on top", group = "client"}),
awful.key({ modkey, }, "n",
function (c)
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
end ,
{description = "minimize", group = "client"}),
awful.key({ modkey, }, "m",
function (c)
c.maximized = not c.maximized
c:raise()
end ,
{description = "(un)maximize", group = "client"}),
awful.key({ modkey, ctlkey }, "m",
function (c)
c.maximized_vertical = not c.maximized_vertical
c:raise()
end ,
{description = "(un)maximize vertically", group = "client"}),
awful.key({ modkey, "Shift" }, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal
c:raise()
end ,
{description = "(un)maximize horizontally", group = "client"})
)
-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it work on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do
globalkeys = gears.table.join(globalkeys,
-- View tag only.
awful.key({ modkey }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end,
{description = "view tag #"..i, group = "tag"}),
-- Toggle tag display.
awful.key({ modkey, ctlkey }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end,
{description = "toggle tag #" .. i, group = "tag"}),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:move_to_tag(tag)
end
end
end,
{description = "move focused client to tag #"..i, group = "tag"}),
-- Toggle tag on focused client.
awful.key({ modkey, ctlkey, "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
{description = "toggle focused client on tag #" .. i, group = "tag"})
)
end
clientbuttons = gears.table.join(
awful.button({ }, 1, function (c)
c:emit_signal("request::activate", "mouse_click", {raise = true})
end),
awful.button({ modkey }, 1, function (c)
c:emit_signal("request::activate", "mouse_click", {raise = true})
awful.mouse.client.move(c)
end),
awful.button({ modkey }, 3, function (c)
c:emit_signal("request::activate", "mouse_click", {raise = true})
awful.mouse.client.resize(c)
end)
)
-- {{{ Mouse bindings
root.buttons(gears.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)
))
-- Set keys
root.keys(globalkeys)
return keys

View File

@ -0,0 +1,203 @@
--[[
Licensed under GNU General Public License v2
* (c) 2013, Luca CPZ
--]]
local spawn = require("awful.spawn")
local timer = require("gears.timer")
local debug = require("debug")
local io = { lines = io.lines,
open = io.open }
local pairs = pairs
local rawget = rawget
local table = { sort = table.sort, unpack = table.unpack }
local unpack = unpack or table.unpack -- lua 5.1 retro-compatibility
-- Lain helper functions for internal use
-- lain.helpers
local helpers = {}
helpers.lain_dir = debug.getinfo(1, 'S').source:match[[^@(.*/).*$]]
helpers.icons_dir = helpers.lain_dir .. 'icons/'
helpers.scripts_dir = helpers.lain_dir .. 'scripts/'
-- {{{ Modules loader
function helpers.wrequire(t, k)
return rawget(t, k) or require(t._NAME .. '.' .. k)
end
-- }}}
-- {{{ File operations
-- check if the file exists and is readable
function helpers.file_exists(path)
local file = io.open(path, "rb")
if file then file:close() end
return file ~= nil
end
-- get a table with all lines from a file
function helpers.lines_from(path)
local lines = {}
for line in io.lines(path) do
lines[#lines + 1] = line
end
return lines
end
-- get a table with all lines from a file matching regexp
function helpers.lines_match(regexp, path)
local lines = {}
for line in io.lines(path) do
if string.match(line, regexp) then
lines[#lines + 1] = line
end
end
return lines
end
-- get first line of a file
function helpers.first_line(path)
local file, first = io.open(path, "rb"), nil
if file then
first = file:read("*l")
file:close()
end
return first
end
-- get first non empty line from a file
function helpers.first_nonempty_line(path)
for line in io.lines(path) do
if #line then return line end
end
return nil
end
-- }}}
-- {{{ Timer maker
helpers.timer_table = {}
function helpers.newtimer(name, timeout, fun, nostart, stoppable)
if not name or #name == 0 then return end
name = (stoppable and name) or timeout
if not helpers.timer_table[name] then
helpers.timer_table[name] = timer({ timeout = timeout })
helpers.timer_table[name]:start()
end
helpers.timer_table[name]:connect_signal("timeout", fun)
if not nostart then
helpers.timer_table[name]:emit_signal("timeout")
end
return stoppable and helpers.timer_table[name]
end
-- }}}
-- {{{ Pipe operations
-- run a command and execute a function on its output (asynchronous pipe)
-- @param cmd the input command
-- @param callback function to execute on cmd output
-- @return cmd PID
function helpers.async(cmd, callback)
return spawn.easy_async(cmd,
function (stdout, _, _, exit_code)
callback(stdout, exit_code)
end)
end
-- like above, but call spawn.easy_async with a shell
function helpers.async_with_shell(cmd, callback)
return spawn.easy_async_with_shell(cmd,
function (stdout, _, _, exit_code)
callback(stdout, exit_code)
end)
end
-- run a command and execute a function on its output line by line
function helpers.line_callback(cmd, callback)
return spawn.with_line_callback(cmd, {
stdout = function (line)
callback(line)
end,
})
end
-- }}}
-- {{{ A map utility
helpers.map_table = {}
function helpers.set_map(element, value)
helpers.map_table[element] = value
end
function helpers.get_map(element)
return helpers.map_table[element]
end
-- }}}
-- {{{ Misc
-- check if an element exist on a table
function helpers.element_in_table(element, tbl)
for _, i in pairs(tbl) do
if i == element then
return true
end
end
return false
end
-- iterate over table of records sorted by keys
function helpers.spairs(t)
-- collect the keys
local keys = {}
for k in pairs(t) do keys[#keys+1] = k end
table.sort(keys)
-- return the iterator function
local i = 0
return function()
i = i + 1
if keys[i] then
return keys[i], t[keys[i]]
end
end
end
-- create the partition of singletons of a given set
-- example: the trivial partition set of {a, b, c}, is {{a}, {b}, {c}}
function helpers.trivial_partition_set(set)
local ss = {}
for _,e in pairs(set) do
ss[#ss+1] = {e}
end
return ss
end
-- create the powerset of a given set
function helpers.powerset(s)
if not s then return {} end
local t = {{}}
for i = 1, #s do
for j = 1, #t do
t[#t+1] = {s[i],unpack(t[j])}
end
end
return t
end
-- }}}
return helpers

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Some files were not shown because too many files have changed in this diff Show More