Commit a5cf32a0 authored by Naoki OKAMURA's avatar Naoki OKAMURA

change: use openbox from gnome3

parent e62e7c73
......@@ -7,14 +7,13 @@
# networks
firefox
chromium
midori
electron_3
gnome3.geary
slack
uget
tdesktop
deezer
feedreader
vlc
# credentials
keepassxc # TODO: change to pass?
......@@ -25,7 +24,6 @@
# music
deadbeef
spotify
# graphics
gimp inkscape
......@@ -48,12 +46,12 @@
firefox
chromium
midori
electron_3
gnome3.geary
slack
uget
feedreader
uget
vlc
keepassxc
veracrypt
......
......@@ -4,6 +4,8 @@
fonts.fontconfig.dpi = 192;
environment.variables = {
GDK_SCALE = "2";
GDK_DPI_SCALE = "0.5";
QT_AUTO_SCREEN_SCALE_FACTOR = "0";
QT_SCREEN_SCALE_FACTORS = "1.5";
QT_SCALE_FACTOR = "1";
......
......@@ -12,7 +12,12 @@
];
services.xserver.displayManager.sessionCommands = ''
export GTK_IM_MODULE=ibus
export [email protected]=ibus
export QT_IM_MODULE=ibus
${pkgs.gnome3.dconf.lib}/libexec/dconf-service &
${config.i18n.inputMethod.package}/bin/ibus-daemon -drx --config=${config.i18n.inputMethod.package}/libexec/ibus-dconf
'';
}
......@@ -21,10 +21,10 @@
];
environment.systemPackages = with pkgs; [
qjackctl jack2
qjackctl jack2 a2jmidid
];
services.dbus.packages = with pkgs; [
qjackctl jack2
qjackctl jack2 a2jmidid
];
}
{ config, pkgs, ... }:
let
apps = (with pkgs.gnome3; [
nautilus file-roller
eog evince gedit ghex seahorse
gnome-calculator gucharmap
gnome-system-monitor
gsound zenity
dconf gvfs
dconf-editor
]) ++ (with pkgs; [
polybar dunst
light pavucontrol connman-gtk polkit_gnome
lxappearance-gtk3 obconf arandr
hsetroot xorg.xrdb xorg.xsetroot xorg.xwininfo wmctrl xdotool
openbox
bamf glib-networking udisks2
]) ++ [ config.i18n.inputMethod.package ];
themes = {
gtk = pkgs.plastik-theme;
icon = pkgs.newaita-icons;
cursor = pkgs.capitaine-cursors;
};
addToXDGDirs = p: ''
if test -d "${p}/share"; then
export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share
fi
if test -d "${p}/lib/girepository-1.0"; then
export GI_TYPELIB_PATH=$GI_TYPELIB_PATH=''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH=''${LD_LIBRARY_PATH:+:}${p}/lib
fi
if test -d "${p}/lib/gio" ; then
export GIO_EXTRA_MODULES=$GIO_EXTRA_MODULES''${GIO_EXTRA_MODULES:+:}${p}/lib/gio/modules
fi
'';
nixos-gsettings-overrides = pkgs.runCommand "nixos-gsettings-overrides" {}
''
mkdir -p $out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/
cp -rf ${pkgs.gnome3.gsettings-desktop-schemas}/share/gsettings-schemas/gsettings-desktop-schemas*/glib-2.0/schemas/*.xml \
$out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/
${pkgs.stdenv.lib.concatMapStrings (p: ''
if test -d ${p}/share/gsettings-schemas; then
cp -rf ${p}/share/gsettings-schemas/*/glib-2.0/schemas/* \
$out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/
fi
'') (config.environment.systemPackages ++ apps)}
${pkgs.glib.dev}/bin/glib-compile-schemas $out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas/
'';
in {
services.xserver = {
enable = true;
autorun = true;
updateDbusEnvironment = true;
libinput = {
enable = true;
};
displayManager = {
job = {
environment = {
LANG = "ja_JP.UTF-8";
};
};
lightdm = {
enable = true;
greeters = {
mini = {
enable = true;
user = "nyarla";
extraConfig = ''
[greeter]
show-password-label = true
show-input-cursor = true
password-label-text = login:
invalid-password-text = retry:
[greeter-hotkeys]
mod-key = control
suspend-key = s
hibernate-key = h
restart-key = r
shutdown-key = o
[greeter-theme]
font = "Sans"
font-size = 1em
text-color = "#F8F8F8"
error-color = "#E09690"
background-image = ""
background-color = "#242424"
window-color = "#363636"
border-color = "#9CD9F0"
border-width = 1px
layout-space = 30
password-color = "#FFFFFF"
passwrd-background-color = "#242424"
'';
};
};
};
};
desktopManager = {
default = "openbox";
session = pkgs.stdenv.lib.singleton {
name = "openbox";
bsSupport = true;
start = ''
export GTK_DATA_PREFIX=${config.system.path}
export GTK_PATH=${config.system.path}/lib/gtk-3.0:${config.system.path}/lib/gtk-2.0
export NIX_GSETTINGS_OVERRIDES_DIR=${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas
export NAUTILUS_EXTENSION_DIR=${config.system.path}/lib/nautilus/extensions-3.0/
${pkgs.stdenv.lib.concatMapStrings (p: ''
${addToXDGDirs p}
'') config.environment.systemPackages}
export XCURSOR_THEME=capitaine-cursors-white
export XCURSOR_SIZE=48
${pkgs.xorg.xsetroot}/bin/xsetroot -cursor_name left_ptr
${pkgs.hsetroot}/bin/hsetroot -solid "#363636"
${pkgs.openbox}/bin/openbox-session &
waitPID=$!
'';
};
};
};
services.dbus.packages = (with pkgs.gnome3; [
nautilus file-roller
eog evince gedit ghex seahorse
gnome-calculator gnome-characters gucharmap
gnome-system-monitor
gsound zenity gvfs dconf
dconf-editor
]) ++ (with pkgs; [
plank polybar dunst
light pavucontrol connman-gtk
lxappearance-gtk3 obconf arandr
polkit_gnome
]) ++ [
config.i18n.inputMethod.package
];
networking.connman = {
enable = true;
enableVPN = true;
networkInterfaceBlacklist = [
"virbr" "docker"
];
};
programs.dconf.enable = true;
security.polkit = {
enable = true;
extraConfig = ''
polkit.addRule(function(action, subject) {
if ( action.id === "org.freedesktop.udisks2.encrypted-unlock-system" && subject.isInGroup("storage") ) {
return polkit.Result.YES;
}
if ( (action.id === "org.freedesktop.udisks2.filesystem-mount-system"
|| action.id === "org.freedesktop.udisks2.filesystem-mount") && subject.isInGroup("storage") ) {
return polkit.Result.YES;
}
});
'';
};
users.groups.storage = {};
services.accounts-daemon.enable = true;
services.gnome3 = {
gnome-keyring.enable = true;
gnome-online-accounts.enable = true;
gnome-online-miners.enable = true;
gnome-settings-daemon.enable = true;
tracker-miners.enable = true;
tracker.enable = true;
};
services.gvfs.enable = true;
services.system-config-printer.enable = true;
services.geoclue2.enable = true;
services.upower.enable = config.powerManagement.enable;
programs.qt5ct.enable = true;
services.compton = {
enable = true;
backend = "glx";
fade = true;
fadeDelta = 3;
fadeSteps = [ "0.31" "0.69" ];
shadow = true;
shadowOffsets = [ 0 (-6) ];
shadowOpacity = "0.31";
settings = {
"no-dock-shadow" = true;
"no-dnd-shadow" = true;
};
};
environment.pathsToLink = [ "/share" ];
environment.systemPackages = (with themes; [
gtk icon cursor
]) ++ apps ++ (with pkgs; [
qt5.qtbase gnome3.adwaita-icon-theme
]);
nixpkgs.config.pulseaudio = true;
}
......@@ -123,6 +123,11 @@
services.xserver.xkbModel = "jp106";
services.xserver.xkbOptions = "ctrl:nocaps";
# Thunderbolt
# -----------
services.hardware.bolt.enable = true;
# Power Managements
# -----------------
powerManagement.enable = true;
......
......@@ -34,22 +34,54 @@
# -------
networking.hostId = "71ca914d";
networking.hostName = "NyXPS15";
networking.wireless = {
enable = true;
networks = {
dummary = {};
};
};
# Firewall
# --------
networking.firewall = {
enable = true;
allowedTCPPorts = [ 445 139 19000 ];
allowedUDPPorts = [ 137 138 19000 ];
allowedTCPPorts = [ 445 139 19000 58080 ];
allowedUDPPorts = [ 137 138 5353 19000 ];
};
# Auto Discovery
# --------------
# mdns
services.avahi.enable = true;
services.avahi.nssmdns = true;
services.avahi = {
enable = true;
interfaces = [ "wlp2s0" ];
ipv4 = true;
ipv6 = false;
reflector = true;
nssmdns = true;
publish = {
enable = true;
userServices = true;
addresses = true;
domain = true;
};
extraServiceFiles = {
"http" = ''
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_http._tcp</type>
<port>58080</port>
</service>
</service-group>
'';
};
};
# Printer
# -------
......
# Terminal
# ========
use_login_shell = false
use_login_shell = true
termtype = xterm-256color
encoding = UTF-8
col_size_of_width_a = 2
......
#!/usr/bin/env sh
# Display Kayout
# --------------
~/.screenlayout/NyXPS15.sh # by arandr
# Input Method
# ------------
ibus-daemon -drx --config=$(readlink /run/current-system/sw/bin/ibus-daemon | sed 's|bin/ibus-daemon|libexec/ibus-dconf|')
# Information Bar
# ---------------
/etc/nixos/dotfiles/nyarla/polybar/launch.sh &
#
# Set system-wide environment variables here for Openbox
# User-specific variables should be placed in $HOME/.config/openbox/environment
#
# To set your language for displaying messages and time/date formats, use the following:
#LANG=en_CA.UTF8
# To set your keyboard layout, you need to modify your X config:
# http://www.google.com/search?q=how+to+set+keyboard+layout+xorg
<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu xmlns="http://openbox.org/3.4/menu">
<menu id="apps-browsers-network" label="Web">
<item label="Firefox">
<action name="Execute">
<command>firefox</command>
</action>
</item>
<item label="Chromium">
<action name="Execute">
<command>chromium</command>
</action>
</item>
<item label="Midori">
<action name="Execute">
<command>midori</command>
</action>
</item>
<separator/>
<item label="Slack: Soozy">
<action name="Execute">
<command>firefox "https://soozy.slack.com"</command>
</action>
</item>
<item label="Slack: N高">
<action name="Execute">
<command>firefox "https://n-highschool.slack.com"</command>
</action>
</item>
<item label="FeedReader">
<action name="Execute">
<command>firefox "https://feedbin.com"</command>
</action>
</item>
<item label="Scrapbox">
<action name="Execute">
<command>chromium --app="https://scrapbox.io"</command>
</action>
</item>
<separator />
<item label="UGet">
<action name="Execute">
<command>uget-gtk</command>
</action>
</item>
</menu>
<menu id="apps-browsers-multimedia" label="Multimedia">
<item label="Nautilus">
<action name="Execute">
<command>nautilus</command>
</action>
</item>
<item label="Evince">
<action name="Execute">
<command>evince</command>
</action>
</item>
<separator/>
<item label="Deadbeef">
<action name="Execute">
<command>deadbeef</command>
</action>
</item>
<item label="VLC">
<action name="Execute">
<command>vlc</command>
</action>
</item>
<item label="Calibre">
<action name="Execute">
<command>calibre</command>
</action>
</item>
</menu>
<menu id="apps-office-suite" label="Office">
<item label="GVim">
<action name="Execute">
<command>gvim</command>
</action>
</item>
<item label="Gedit">
<action name="Execute">
<command>gedit</command>
</action>
</item>
<item label="GHex">
<action name="Execute">
<command>ghex</command>
</action>
</item>
<separator />
<item label="Calculator">
<action name="Execute">
<command>gnome-calculator</command>
</action>
</item>
<item label="CharMap">
<action name="Execute">
<command>gucharmap</command>
</action>
</item>
<separator />
<item label="Gimp">
<action name="Execute">
<command>gimp</command>
</action>
</item>
<item label="Inkscape">
<action name="Execute">
<command>inkscape</command>
</action>
</item>
<separator />
<item label="Peek">
<action name="Execute">
<command>peek</command>
</action>
</item>
<item label="SpiceUP">
<action name="Execute">
<command>com.github.philip-scott.spice-up</command>
</action>
</item>
</menu>
<menu id="system-utilities" label="Utilities">
<item label="System Monitor">
<action name="Execute">
<command>gnome-system-monitor</command>
</action>
</item>
<separater />
<item label="Connman">
<action name="Execute">
<command>connman-gtk</command>
</action>
</item>
<item label="PulseAudio">
<action name="Execute">
<command>pavucontrol</command>
</action>
</item>
<separator />
<item label="LXappearance">
<action name="Execute">
<command>lxappearance</command>
</action>
</item>
<item label="Obconf">
<action name="Execute">
<command>obconf</command>
</action>
</item>
<separator />
<item label="Veracrypt">
<action name="Execute">
<command>veracrypt</command>
</action>
</item>
<separator/>
<item label="Seahouse">
<action name="Execute">
<command>seahorse</command>
</action>
</item>
</menu>
<menu id="dynamic-windows-list" label="Windows" execute="perl /etc/nixos/scripts/openbox-windows-list.pl" />
<menu id="system-actions" label="System">
<item label="Reconfigure">
<action name="Reconfigure" />
</item>
<separator />
<item label="Lock">
<action name="Execute">
<command>dm-tool lock</command>
</action>
</item>
<separator />
<item label="Logout">
<action name="Exit" />
</item>
<item label="Reboot">
<action name="Execute">
<command>systemctl reboot</command>
</action>
</item>
<item label="Shutdown">
<action name="Execute">
<command>systemctl poweroff</command>
</action>
</item>
</menu>
<menu id="root-menu" label="Openbox 3">
<separator label="Applications" />
<item label="Terminal">
<action name="Execute">
<command>mlterm</command>
</action>
</item>
<item label="Web Browser">
<action name="Execute">
<command>firefox</command>
</action>
</item>
<item label="Email">
<action name="Execute">
<command>chromium --app="https://gmail.com"</command>
</action>
</item>
<separator />
<menu id="apps-browsers-network" />
<menu id="apps-browsers-multimedia"/>
<menu id="apps-office-suite"/>
<menu id="system-utilities"/>
<separator />
<menu id="dynamic-windows-list" />
<menu id="system-actions" />
</menu>
</openbox_menu>
This diff is collapsed.
[bar/main]
# monitor = eDP-1
monitor = rdp0
monitor = eDP-1
# monitor = rdp0
offset-x = 0
offset-y = 0
width = 3840
height = 32
height = 48
font-0 = "MyricaM M:size=24;3"
font-1 = "Symbols Nerd Font:size=24;5"
font-0 = "Monospace:size=24;3"
background = #242424
foreground = #FFFFFF
foreground = #F8F8F8
border-size = 0
module-margin-left = 1
modules-left = window
modules-center = bspwm
modules-right = memory cpu volume date time account machine
modules-left = menu
modules-center = window
modules-right = cpu memory volume network date time account machine battery
[module/volume]
type = internal/volume
type = internal/alsa
format-volume = <ramp-volume><label-volume>
format-muted = <label-muted>---
format-volume = %{A3:pavucontrol:}<ramp-volume><label-volume>%{A}
format-muted = %{A3:pavucontrol:}<label-muted>---%{A}
label-volume = %percentage:1%%
label-muted = %{F#C8A0D1}%{F-}
......@@ -52,8 +51,8 @@ ramp-capacity-4 = %{F#CDEE69}%{F-}
[module/network]
type = internal/network
interface = wlp2s0
format-connected = %{F#9CD9F0}%{F-} <label-connected>
format-disconnetted = %{F#5D5D5D}%{F-} <label-disconnected>
format-connected = %{A1:connman-gtk:}%{F#9CD9F0}%{F-}<label-connected>%{A}
format-disconnetted = %{A1:connman-gtk:}%{F#5D5D5D}%{F-}<label-disconnected>%{A}
label-connected = %essid%
label-disconnected = none
......@@ -62,8 +61,8 @@ label-disconnected = none
type = internal/date
interval = 1.0
date = %Y-%m-%d
format = %{F#FFE377}%{F-} <label>
date = %Y-%m-%d (%a)
format = %{F#FFE377}%{F-}<label>
label = %date%
[module/time]
......@@ -72,7 +71,7 @@ interval = 1.0
time = %H:%M:%S
format = %{F#77DFD8}%{F-} <label>
format = %{F#77DFD8}%{F-}<label>
label = %time%
[module/account]
......@@ -81,13 +80,13 @@ type = custom/script
exec = whoami
tail = false
format = %{F#9CD9F0}%{F-} <label>
format = %{F#9CD9F0}%{F-}<label>
[module/machine]
type = custom/script
exec = hostname
tail = false
format = %{F#CDEE69}%{F-} <label>
format = %{F#CDEE69}%{F-}<label>
[module/cpu]
type = internal/cpu
......@@ -104,39 +103,15 @@ ramp-load-7 = %{F#C75646}█%{F-}