Git Product home page Git Product logo

fin's Introduction

Fin, the Fyne Login Manager

A minimal but good-looking login manager for Linux/Unix. The current boot scripts support only systemd on Linux and rc.d on OpenBSD.

If you'd like to try out this project in its early stages then you can simply check out this repo and run (Linux with systemd assumed):

$ make
$ sudo make install
$ systemctl disable display-manager
$ systemctl enable fin

You can then either reboot or start fin directly with:

$ systemctl start fin

That should be all you need if you are transitioning away from another Display Manager. If you run into issues using Fin, please visit Troubleshooting below.

OpenBSD support

Fin builds and runs under OpenBSD as well. Since OpenBSD uses BSD Auth instead of PAM, you will need to get the OpenPAM dependency first and set proper rules by running:

$ doas pkg_add -U openpam
$ doas install -Dm00644 /etc/pam.d/system /etc/pam.d/display_manager

To run Fin under bare X on system boot, build and install it with commands as following. If you have some other display manager enabled, make sure you disable it first, so it doesn't conflict with Fin. Below we assume that you have got xenodm, and disable it explicitly:

$ make build
$ doas make install
$ doas rcctl disable xenodm
$ doas rcctl enable fin

Reboot the system and Fin should start automatically during boot process.

Screenshot

The current version of fin looks like this:

Development

The Fin login app can be tested easily by running as a normal Fyne application (with go run .) or by running it within a Xephyr window (we provide make embed to help).

Once you are ready to test as your display manager replacement, you should execute make && sudo make install and restart the fin service.

Troubleshooting

Logging in Fails

Problem

When attempting to log in, authentication fails despite using the correct username and password.

Solution

Fin, like most other Display Managers, makes use of PAM, the Pluggable Authentication Module system. This requires the appropriate rules be in place. The following snippet creates a display_manager module by copying the login one. It must be run as root: install -Dm00644 /etc/pam.d/login /etc/pam.d/display_manager

Audio Issues

Problem

I'm using PulseAudio, and I had sound before using startx. Now, using Fin, PulseAudio doesn't recognize any of my audio inputs or outputs. pavucontrol shows dummy sinks.

Solution

Fin uses bash --login to run your .xinitrc, and therefore imposes stricter requirements than startx. Create an audio group if it does not already exist, and add your user to it. Log out and back in to reload the group list.

Notifications No Longer Work

Problem

DBUS is not initialized properly in the .xinitrc you're using. This is due to your XDG variables (which startx handles for you) not being set properly. See this issue for more details.

Solution

Be sure your XDG variables are set, such as export XDG_RUNTIME_DIR=/run/user/$(id -u) towards the top of your .xinitrc. Failing to do so breaks dbus and as a result, systemctl in user mode. Be sure your .xinitrc is compliant with the recommendations of your distro, and properly sources config files from /etc/X11/xinit/xinitrc.d (if applicable).

fin's People

Contributors

andydotxyz avatar jacalz avatar taigrr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fin's Issues

Using fin on archlinux with i3 breaks PulseAudio

When running amixer within a terminal emulator inside of i3 (launched with the .xinitrc option), the following is printed to the screen:

ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5111:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5111:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5111:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5599:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib control.c:1481:(snd_ctl_open_noupdate) Invalid CTL sysdefault
cannot open mixer: No such file or directory

Running startx , everything operates as expected.

Make install doesn't work on default archlinux installation

Hi there. Using make install, the manager starts up as expected, but it gets a PAM auth error and refuses to log in.

pam_authenticate: Authentication failure

Relevant journal logs:

Nov 25 23:00:01 archlinux kernel: audit: type=1100 audit(1637910001.595:1030): pid=3975 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:authentication grantors=? acct="test" exe="/usr/local/bin/fin" hostname=? a
ddr=? terminal=? res=failed'
Nov 25 23:00:01 archlinux audit[3975]: USER_AUTH pid=3975 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:authentication grantors=? acct="test" exe="/usr/local/bin/fin" hostname=? addr=? terminal=? res=failed'
Nov 25 23:00:01 archlinux fin[3975]: pam_warn(display_manager:auth): function=[pam_sm_authenticate] flags=0 service=[display_manager] terminal=[<unknown>] user=[test] ruser=[<unknown>] rhost=[<unknown>]
Nov 25 23:00:01 archlinux fin[3975]: pam_authenticate: Authentication failure

Please let me know what information I can hand over (if there's a debug/trace option I can use, etc.) to give you a hint as to what I can look into.

I will continue troubleshooting from my side in the meantime to try to resolve the issue.

Login does not work on OpenBSD

This specific code does not work, from pam.c:

    int result = pam_start(SERVICE_NAME, username, NULL, &pam_handle);
    if (result != PAM_SUCCESS) {
		printf("err %d", result);
        err("pam_start...");
    }

It always return:
pam_start: System error

I have checked and the openpam-20200510p0 is installed in my computer, OpenBSD 7.3 amd64

Code Coverage tests aren't running reliably.

Having just submitted a PR (#11) I wanted to see how the test cases were written. However, I noticed when looking through the logs, that the code coverage report is not actually running, and crashes. This is true for both versions of the check.

image

Running the code locally on my machine, the reason becomes obvious:

$ coverage=`go tool cover -func coverage.out | grep total | tr -s '\t' | cut -f 3 | grep -o '[^%]*'`
$ echo $coverage
30.0

30.0 isn't an integer, it's a float, which is why bash's -lt operator isn't working.

PR incoming.

"fin with more design"?

Hi everyone.

concept

before

image

after

image

question/feedback

  • I would like to know what you all think about this idea, What you all think about this idea?
  • I was thinking of creating something with fin with this concept, What you all think about this concept?

Use Go's built-in embed package instead of fyne's

Fyne's generator for creating embedded static resources was a great idea, and necessary at the time of creation, but as of Go 1.16, there's a new standard library API called embed.

I would like to propose fin moves over to that package instead. Benefits include:

  • no inclusion of gigantic .go files in the workspace that editors can choke one when evaluating
  • the original file can be included in the repo only once
  • no need for go generate functions

I've already implemented this myself, PR incoming.

XDG Spec isn't followed correctly for xsession directories

According to the XDG spec: (here)

  1. XDG_DATA_HOME takes precedence
  2. but if it's not set, it should be assumed to be $HOME/.local/share
  3. Additionally, XDG_DATA_DIRS contains system-wide data which should be taken into account at a lower precedence.
  4. If empty, assume it is /usr/local/share/:/usr/share/

Currently, the code is backwards, checking the XDG_DATA_DIRS variable first, with a couple of fallbacks. XDG_DATA_HOME should be used first, with XDG_DATA_DIRS as a fallback.

The reason this distinction is important: As it is right now, a non-root user is unable to customize their xsessions list, as on any normal system with XDG_DATA_DIRS set, user config files will not be read.

Alternative to systemd services

While I personally have systemd on my Linux systems, we might want to look at an option to not use it for those that wish to do so. I think this also would be important for getting fin running on FreeBSD and OpenBSD as well. This requires more research for other init systems and how their services work and so on before we commit to anything though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.