Commit ff9f8786 authored by epsi sayidina's avatar epsi sayidina
Browse files

coding style

parent 6bada51f
......@@ -3,7 +3,8 @@
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----
# helpers
function hc($arguments) {
function hc($arguments)
{
system("herbstclient $arguments");
}
......@@ -22,7 +23,8 @@ function do_config($command, $hash) {
# Must pass the array as parameters,
# since PHP can't read local array variable outside function.
function set_tags_with_name($tag_names, $tag_keys) {
function set_tags_with_name($tag_names, $tag_keys)
{
hc("rename default '$tag_names[0]' 2>/dev/null || true");
foreach($tag_names as $index=>$value) {
......@@ -42,7 +44,8 @@ function set_tags_with_name($tag_names, $tag_keys) {
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----
# miscellanous
function bind_cycle_layout() {
function bind_cycle_layout()
{
# The following cycles through the available layouts
# within a frame, but skips layouts, if the layout change
# wouldn't affect the actual window positions.
......@@ -63,7 +66,8 @@ function bind_cycle_layout() {
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----
# find the panel
function do_panel() {
function do_panel()
{
$panel = __dir__."/../bash/dzen2/panel.sh";
if (!is_executable($panel))
$panel = "/etc/xdg/herbstluftwm/panel.sh";
......
......@@ -2,7 +2,8 @@
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----
# load on startup
function startup_run() {
function startup_run()
{
$command = 'silent new_attr bool my_not_first_autostart';
system("herbstclient $command", $exitcode);
......
module GMC
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
# google material colors
# https://material.io/guidelines/style/color.html
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
# google material colors
# https://material.io/guidelines/style/color.html
# Associative Array (Hash)
# http://ruby-doc.org/core-2.4.1/Hash.html
# Associative Array (Hash)
# http://ruby-doc.org/core-2.4.1/Hash.html
Color = {
'white' => '#ffffff',
'black' => '#000000',
Color = {
'white' => '#ffffff',
'black' => '#000000',
'grey50' => '#fafafa',
'grey100' => '#f5f5f5',
'grey200' => '#eeeeee',
'grey300' => '#e0e0e0',
'grey400' => '#bdbdbd',
'grey500' => '#9e9e9e',
'grey600' => '#757575',
'grey700' => '#616161',
'grey800' => '#424242',
'grey900' => '#212121',
'grey50' => '#fafafa',
'grey100' => '#f5f5f5',
'grey200' => '#eeeeee',
'grey300' => '#e0e0e0',
'grey400' => '#bdbdbd',
'grey500' => '#9e9e9e',
'grey600' => '#757575',
'grey700' => '#616161',
'grey800' => '#424242',
'grey900' => '#212121',
'red50' => '#ffebee',
'red100' => '#ffcdd2',
'red200' => '#ef9a9a',
'red300' => '#e57373',
'red400' => '#ef5350',
'red500' => '#f44336',
'red600' => '#e53935',
'red700' => '#d32f2f',
'red800' => '#c62828',
'red900' => '#b71c1c',
'redA100' => '#ff8a80',
'redA200' => '#ff5252',
'redA400' => '#ff1744',
'redA700' => '#d50000',
'red50' => '#ffebee',
'red100' => '#ffcdd2',
'red200' => '#ef9a9a',
'red300' => '#e57373',
'red400' => '#ef5350',
'red500' => '#f44336',
'red600' => '#e53935',
'red700' => '#d32f2f',
'red800' => '#c62828',
'red900' => '#b71c1c',
'redA100' => '#ff8a80',
'redA200' => '#ff5252',
'redA400' => '#ff1744',
'redA700' => '#d50000',
'pink50' => '#fce4ec',
'pink100' => '#f8bbd0',
'pink200' => '#f48fb1',
'pink300' => '#f06292',
'pink400' => '#ec407a',
'pink500' => '#e91e63',
'pink600' => '#d81b60',
'pink700' => '#c2185b',
'pink800' => '#ad1457',
'pink900' => '#880e4f',
'pinkA100' => '#ff80ab',
'pinkA200' => '#ff4081',
'pinkA400' => '#f50057',
'pinkA700' => '#c51162',
'pink50' => '#fce4ec',
'pink100' => '#f8bbd0',
'pink200' => '#f48fb1',
'pink300' => '#f06292',
'pink400' => '#ec407a',
'pink500' => '#e91e63',
'pink600' => '#d81b60',
'pink700' => '#c2185b',
'pink800' => '#ad1457',
'pink900' => '#880e4f',
'pinkA100' => '#ff80ab',
'pinkA200' => '#ff4081',
'pinkA400' => '#f50057',
'pinkA700' => '#c51162',
'blue50' => '#e3f2fd',
'blue100' => '#bbdefb',
'blue200' => '#90caf9',
'blue300' => '#64b5f6',
'blue400' => '#42a5f5',
'blue500' => '#2196f3',
'blue600' => '#1e88e5',
'blue700' => '#1976d2',
'blue800' => '#1565c0',
'blue900' => '#0d47a1',
'blueA100' => '#82b1ff',
'blueA200' => '#448aff',
'blueA400' => '#2979ff',
'blueA700' => '#2962ff',
'blue50' => '#e3f2fd',
'blue100' => '#bbdefb',
'blue200' => '#90caf9',
'blue300' => '#64b5f6',
'blue400' => '#42a5f5',
'blue500' => '#2196f3',
'blue600' => '#1e88e5',
'blue700' => '#1976d2',
'blue800' => '#1565c0',
'blue900' => '#0d47a1',
'blueA100' => '#82b1ff',
'blueA200' => '#448aff',
'blueA400' => '#2979ff',
'blueA700' => '#2962ff',
'yellow50' => '#fffde7',
'yellow100' => '#fff9c4',
'yellow200' => '#fff59d',
'yellow300' => '#fff176',
'yellow400' => '#ffee58',
'yellow500' => '#ffeb3b',
'yellow600' => '#fdd835',
'yellow700' => '#fbc02d',
'yellow800' => '#f9a825',
'yellow900' => '#f57f17',
'yellowA100' => '#ffff8d',
'yellowA200' => '#ffff00',
'yellowA400' => '#ffea00',
'yellowA700' => '#ffd600',
'yellow50' => '#fffde7',
'yellow100' => '#fff9c4',
'yellow200' => '#fff59d',
'yellow300' => '#fff176',
'yellow400' => '#ffee58',
'yellow500' => '#ffeb3b',
'yellow600' => '#fdd835',
'yellow700' => '#fbc02d',
'yellow800' => '#f9a825',
'yellow900' => '#f57f17',
'yellowA100' => '#ffff8d',
'yellowA200' => '#ffff00',
'yellowA400' => '#ffea00',
'yellowA700' => '#ffd600',
'teal50' => '#e0f2f1',
'teal100' => '#b2dfdb',
'teal200' => '#80cbc4',
'teal300' => '#4db6ac',
'teal400' => '#26a69a',
'teal500' => '#009688',
'teal600' => '#00897b',
'teal700' => '#00796b',
'teal800' => '#00695c',
'teal900' => '#004d40',
'tealA100' => '#a7ffeb',
'tealA200' => '#64ffda',
'tealA400' => '#1de9b6',
'tealA700' => '#00bfa5',
'teal50' => '#e0f2f1',
'teal100' => '#b2dfdb',
'teal200' => '#80cbc4',
'teal300' => '#4db6ac',
'teal400' => '#26a69a',
'teal500' => '#009688',
'teal600' => '#00897b',
'teal700' => '#00796b',
'teal800' => '#00695c',
'teal900' => '#004d40',
'tealA100' => '#a7ffeb',
'tealA200' => '#64ffda',
'tealA400' => '#1de9b6',
'tealA700' => '#00bfa5',
'green50' => '#e8f5e9',
'green100' => '#c8e6c9',
'green200' => '#a5d6a7',
'green300' => '#81c784',
'green400' => '#66bb6a',
'green500' => '#4caf50',
'green600' => '#43a047',
'green700' => '#388e3c',
'green800' => '#2e7d32',
'green900' => '#1b5e20',
'greenA100' => '#b9f6ca',
'greenA200' => '#69f0ae',
'greenA400' => '#00e676',
'greenA700' => '#00c853',
'green50' => '#e8f5e9',
'green100' => '#c8e6c9',
'green200' => '#a5d6a7',
'green300' => '#81c784',
'green400' => '#66bb6a',
'green500' => '#4caf50',
'green600' => '#43a047',
'green700' => '#388e3c',
'green800' => '#2e7d32',
'green900' => '#1b5e20',
'greenA100' => '#b9f6ca',
'greenA200' => '#69f0ae',
'greenA400' => '#00e676',
'greenA700' => '#00c853',
'orange50' => '#fff3e0',
'orange100' => '#ffe0b2',
'orange200' => '#ffcc80',
'orange300' => '#ffb74d',
'orange400' => '#ffa726',
'orange500' => '#ff9800',
'orange600' => '#fb8c00',
'orange700' => '#f57c00',
'orange800' => '#ef6c00',
'orange900' => '#e65100',
'orangeA100' => '#ffd180',
'orangeA200' => '#ffab40',
'orangeA400' => '#ff9100',
'orangeA700' => '#ff6d00',
'orange50' => '#fff3e0',
'orange100' => '#ffe0b2',
'orange200' => '#ffcc80',
'orange300' => '#ffb74d',
'orange400' => '#ffa726',
'orange500' => '#ff9800',
'orange600' => '#fb8c00',
'orange700' => '#f57c00',
'orange800' => '#ef6c00',
'orange900' => '#e65100',
'orangeA100' => '#ffd180',
'orangeA200' => '#ffab40',
'orangeA400' => '#ff9100',
'orangeA700' => '#ff6d00',
'deepOrange50' => '#fbe9e7',
'deepOrange100' => '#ffccbc',
'deepOrange200' => '#ffab91',
'deepOrange300' => '#ff8a65',
'deepOrange400' => '#ff7043',
'deepOrange500' => '#ff5722',
'deepOrange600' => '#f4511e',
'deepOrange700' => '#e64a19',
'deepOrange800' => '#d84315',
'deepOrange900' => '#bf360c',
'deepOrangeA100' => '#ff9e80',
'deepOrangeA200' => '#ff6e40',
'deepOrangeA400' => '#ff3d00',
'deepOrangeA700' => '#dd2c00'
}
'deepOrange50' => '#fbe9e7',
'deepOrange100' => '#ffccbc',
'deepOrange200' => '#ffab91',
'deepOrange300' => '#ff8a65',
'deepOrange400' => '#ff7043',
'deepOrange500' => '#ff5722',
'deepOrange600' => '#f4511e',
'deepOrange700' => '#e64a19',
'deepOrange800' => '#d84315',
'deepOrange900' => '#bf360c',
'deepOrangeA100' => '#ff9e80',
'deepOrangeA200' => '#ff6e40',
'deepOrangeA400' => '#ff3d00',
'deepOrangeA700' => '#dd2c00'
}
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----
# end of ruby module
......
......@@ -16,7 +16,7 @@ system("xsetroot -solid '#{GMC::Color['blue500']}'")
hc('emit_hook reload')
# gap counter
system("echo 35 > /tmp/herbstluftwm-gap");
system("echo 35 > /tmp/herbstluftwm-gap")
# do not repaint until unlock
hc("lock");
......
require_relative 'assets/gmc'
module Config
include GMC
Tag_names = Array (1..9)
Tag_keys = (Array (1..9)) << 0
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
# keybindings
# if you have a super key you will be much happier with Mod set to Mod4
# Mod=Mod1 # Use alt as the main modifier
# Alt=Mod1
# Mod=Mod4 # Use the super key as the main modifier
# Modifier variables
s = 'Shift'
c = 'Control'
m = 'Mod4'
a = 'Mod1'
# resizing frames
resizestep = "0.05";
Keybinds = {
# session
"#{m}-#{s}-q" => 'quit',
"#{m}-#{s}-r" => 'reload',
"#{m}-#{s}-c" => 'close',
# use your $TERMINAL with xterm as fallback
"#{m}-Return" => 'spawn ${TERMINAL:-xfce4-terminal}',
# epsi
"#{m}-d" => 'spawn dmenu_run_hlwm',
"#{m}-#{s}-d" => 'spawn rofi -show run -opacity 90',
"#{m}-#{s}-x" => 'spawn oblogout',
# basic movement
# focusing clients
"#{m}-Left" => 'focus left',
"#{m}-Down" => 'focus down',
"#{m}-Up" => 'focus up',
"#{m}-Right" => 'focus right',
"#{m}-h" => 'focus left',
"#{m}-j" => 'focus down',
"#{m}-k" => 'focus up',
"#{m}-l" => 'focus right',
# moving clients
"#{m}-#{s}-Left" => 'shift left',
"#{m}-#{s}-Down" => 'shift down',
"#{m}-#{s}-Up" => 'shift up',
"#{m}-#{s}-Right" => 'shift right',
"#{m}-#{s}-h" => 'shift left',
"#{m}-#{s}-j" => 'shift down',
"#{m}-#{s}-k" => 'shift up',
"#{m}-#{s}-l" => 'shift right',
# splitting frames
# create an empty frame at the specified direction
"#{m}-u" => 'split bottom 0.5',
"#{m}-o" => 'split right 0.5',
# let the current frame explode into subframes
"#{m}-#{c}-space" => 'split explode',
# resizing frames
"#{m}-#{c}-h" => "resize left +#{resizestep}",
"#{m}-#{c}-j" => "resize down +#{resizestep}",
"#{m}-#{c}-k" => "resize up +#{resizestep}",
"#{m}-#{c}-l" => "resize right +#{resizestep}",
"#{m}-#{c}-Left" => "resize left +#{resizestep}",
"#{m}-#{c}-Down" => "resize down +#{resizestep}",
"#{m}-#{c}-Up" => "resize up +#{resizestep}",
"#{m}-#{c}-Right" => "resize right +#{resizestep}",
# MPC
"#{m}-#{a}-h" => 'spawn mpc toggle',
"#{m}-#{a}-t" => 'spawn mpc prev',
"#{m}-#{a}-n" => 'spawn mpc next'
}
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
# tags
Tagskeybinds = {
# cycle through tags
"#{m}-period" => 'use_index +1 --skip-visible',
"#{m}-comma" => 'use_index -1 --skip-visible',
# layouting
"#{m}-r" => 'remove',
"#{m}-s" => 'floating toggle',
"#{m}-f" => 'fullscreen toggle',
"#{m}-p" => 'pseudotile toggle',
# focus
"#{m}-BackSpace" => 'cycle_monitor',
"#{m}-Tab" => 'cycle_all +1',
"#{m}-#{s}-Tab" => 'cycle_all -1',
"#{m}-c" => 'cycle',
"#{m}-i" => 'jumpto urgent'
}
Mousebinds = {
# mouse
"#{m}-Button1" => 'move',
"#{m}-Button2" => 'zoom',
"#{m}-Button3" => 'resize'
}
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
# theme
Attributes = {
"theme.tiling.reset" => '1',
"theme.floating.reset" => '1',
"theme.active.color" => "'#{Color['red500']}'",
"theme.normal.color" => "'#{Color['grey200']}'",
"theme.urgent.color" => "'#{Color['pink500']}'",
"theme.inner_width" => '0',
"theme.inner_color" => 'black',
"theme.border_width" => '2',
"theme.floating.border_width" => '4',
"theme.floating.outer_width" => '1',
"theme.floating.outer_color" => "'black'",
"theme.active.inner_color" => "'#3E4A00'",
"theme.active.outer_color" => "'#3E4A00'",
"theme.background_color" => "'#141414'"
}
Sets = {
"frame_border_active_color" => "'#{Color['grey200']}'",
"frame_bg_active_color" => "'#{Color['yellow900']}'",
"frame_border_normal_color" => "'#{Color['grey50']}'",
"frame_bg_normal_color" => "'#{Color['red500']}'",
"frame_border_width" => '0',
"always_show_frame" => '0',
"frame_bg_transparent" => '1',
"frame_transparent_width" => '2',
"frame_gap" => '20',
"window_gap" => '0',
"frame_padding" => '0',
"smart_window_surroundings" => '0',
"smart_frame_surroundings" => '1',
"mouse_recenter_gap" => '0'
}
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
# rules
Rules = {
# normally focus new clients
"focus=on" => '',
# zero based array
"class=Firefox" => "tag=#{Tag_names[1]}",
"class=Chromium" => "tag=#{Tag_names[1]}",
"class=Geany" => "tag=#{Tag_names[2]}",
"class=Thunar" => "tag=#{Tag_names[3]}",
"class=gimp" => "tag=#{Tag_names[4]} pseudotile=on",
include GMC
Tag_names = Array (1..9)
Tag_keys = (Array (1..9)) << 0
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
# keybindings
# if you have a super key you will be much happier with Mod set to Mod4
# Mod=Mod1 # Use alt as the main modifier
# Alt=Mod1
# Mod=Mod4 # Use the super key as the main modifier
# Modifier variables
s = 'Shift'
c = 'Control'
m = 'Mod4'
a = 'Mod1'
# resizing frames
resizestep = "0.05";
Keybinds = {
# session
"#{m}-#{s}-q" => 'quit',
"#{m}-#{s}-r" => 'reload',
"#{m}-#{s}-c" => 'close',
# use your $TERMINAL with xterm as fallback
"#{m}-Return" => 'spawn ${TERMINAL:-xfce4-terminal}',
# epsi
"#{m}-d" => 'spawn dmenu_run_hlwm',
"#{m}-#{s}-d" => 'spawn rofi -show run -opacity 90',
"#{m}-#{s}-x" => 'spawn oblogout',
# basic movement
# focusing clients
"#{m}-Left" => 'focus left',
"#{m}-Down" => 'focus down',
"#{m}-Up" => 'focus up',
"#{m}-Right" => 'focus right',
"#{m}-h" => 'focus left',
"#{m}-j" => 'focus down',
"#{m}-k" => 'focus up',
"#{m}-l" => 'focus right',
# moving clients
"#{m}-#{s}-Left" => 'shift left',
"#{m}-#{s}-Down" => 'shift down',
"#{m}-#{s}-Up" => 'shift up',
"#{m}-#{s}-Right" => 'shift right',
"#{m}-#{s}-h" => 'shift left',
"#{m}-#{s}-j" => 'shift down',
"#{m}-#{s}-k" => 'shift up',
"#{m}-#{s}-l" => 'shift right',
# splitting frames
# create an empty frame at the specified direction
"#{m}-u" => 'split bottom 0.5',
"#{m}-o" => 'split right 0.5',
# let the current frame explode into subframes
"#{m}-#{c}-space" => 'split explode',
# resizing frames
"#{m}-#{c}-h" => "resize left +#{resizestep}",
"#{m}-#{c}-j" => "resize down +#{resizestep}",
"#{m}-#{c}-k" => "resize up +#{resizestep}",
"#{m}-#{c}-l" => "resize right +#{resizestep}",
"#{m}-#{c}-Left" => "resize left +#{resizestep}",
"#{m}-#{c}-Down" => "resize down +#{resizestep}",
"#{m}-#{c}-Up" => "resize up +#{resizestep}",
"#{m}-#{c}-Right" => "resize right +#{resizestep}",
# MPC
"#{m}-#{a}-h" => 'spawn mpc toggle',
"#{m}-#{a}-t" => 'spawn mpc prev',
"#{m}-#{a}-n" => 'spawn mpc next'
}
# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
# tags
Tagskeybinds = {
# cycle through tags
"#{m}-period" => 'use_index +1 --skip-visible',
"#{m}-comma" => 'use_index -1 --skip-visible',